Socket access to low numbered ports?

John Burton john.burton at
Sun Mar 21 23:44:59 CET 2004

Paul Rubin wrote:
 > John Burton <john.burton at> writes:
 >>Ok, I'm now using sudo to launch the application which just opens the
 >>listening sockets and then calls os.setuid to set the uid back to an
 >>unprivilaged account.
 > That's how Apache does it too, more or less.  Another method under
 > Linux is have a separate process that opens the low ports, and use an
 > AF_UNIX socket to pass the low ports back to your application through
 > ancillary messages.  That requires a patch to the socket module, which
 > I'll see about coding up.  I currently have a Sourceforge bug
 > (#815869) open for it.

The advantage of the original approach is that I want this to be
portable back to windows and the code can be the same except that it
doesn't do the the os.setuid on windows. This idea, while interesting,
would be harder to make portable I think.

More information about the Python-list mailing list