urllib/ftpwrapper

Michael Ströder michael at stroeder.com
Wed May 24 02:40:01 EDT 2000


Kent Polk wrote:
> 
> On Tue, 23 May 2000 09:10:38 +0200, Michael Ströder wrote:
> >Kent Polk wrote:
> >>
> >> What would be a suggested method to allow outgoing port 20
> >> connections
> >> from a Python setuid'd server such as Medusa?
> >
> >Isn't it possible to bind to the privileged port 20 and do a setuid
> >afterwards?
> 
> If you use connect, since it doesn't create a new socket, but you
> could use it for only one connection as the first one would have
> to be closed to terminate the connection. I think...

Disclaimer:
1. I'm very new to the socket programming stuff.
2. I only had a very brief look at Medusa.

In one of my projects I'm using the SocketServer.ThreadingMixIn to
drive a multi-threaded HTTP server. For binding to a privileged port
my naive approach was to do all the initialization stuff as root and
do a setuid(wwwrun) just before calling method serve_forever() of
the server class. Works just fine.

Does anybody see any security problems with that approach?

Can someone explain to me how different Medusa handles this
situation?

Ciao, Michael.



More information about the Python-list mailing list