New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setuid in smtp.py sheds privileges before binding port #53414
Comments
The SMTP proxy server in Python (smtpd.py) allows you to shed privileges and run as user nobody. However, if you are trying to use port 25, the server will shed privileges before binding the port, causing a bind failure. By moving the setuid code between the creation of the proxy server and the aysncore loop, we can bind a port below 1024 and run as nobody. |
I haven't heard anything on this problem or my patch. What's the status? |
The patch looks good to me and fixes the problem. To reproduce, try this:
It raises a "socket.error: [Errno 13] Permission denied" when trying to bind to the privileged port. Attached a refreshed the patch that applies cleanly on top of current 2.7 branch. |
New changeset 7d92b94b0eec by Florent Xicluna in branch '3.2': New changeset bbd92b42508e by Florent Xicluna in branch 'default': |
New changeset d2f303861c98 by Florent Xicluna in branch '2.7': |
Fixed. Thank you for the patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: