[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-22 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: I hope you'll also write some unit tests for privilege.py (actually, I hope you'll do test driven development on it). -- ___ Python tracker rep...@bugs.python.org

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.
New submission from Travis H. travis+w-python@subspacefield.org: It should be easier to write network servers and setuid programs in python. One of the troublesome issues is that the semantics of the setuid/getuid-related calls are quite complicated. There are two papers on this subject

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.
Travis H. travis+w-python@subspacefield.org added the comment: The posixmodule.c seems to have a lot of really complex CPP logic about what chunks to compile. If the target is to put the code there, I would have to be guessing - next to the HAVE_GETEUID looks promising. But wouldn't it be

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.
Travis H. travis+w-python@subspacefield.org added the comment: The routines necessary for implementing Wagner's API for dropping privileges are: sysconf function: available in os module _SC_NGROUPS_MAX constant: unsure abort function: available in os module getresuid function: needs

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Maybe this should just be a third-party module for the time being? That removes the question of which stdlib module to add it to for now. Plus, since it's not just a straightforward platform API wrapper, it probably merits separate

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: If the logic is going to be built on top of the APIs that are already there, I agree that it would be best to implement this as a separate module, and upload it to pypi.python.org. Closing as won't fix. -- nosy: +loewis resolution:

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: It would still be nice to have the currently unimplemented platform wrappers added to the standard library, though. For example, as solinym pointed out, getresuid and getresgid are not currently wrapped at all. There may be other

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It would still be nice to have the currently unimplemented platform wrappers added to the standard library, though. For example, as solinym pointed out, getresuid and getresgid are not currently wrapped at all. There may be other

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.
Travis H. travis+w-python@subspacefield.org added the comment: This is my first stab at creating a privilege module that implements the API suggested in the second aforementioned paper. It is syntactically correct but has some TODO items in it that must be completed before it will work.

[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.
Travis H. travis+w-python@subspacefield.org added the comment: On Fri, Aug 21, 2009 at 08:42:43PM +, Martin v. L??wis wrote: Martin v. L??wis mar...@v.loewis.de added the comment: It would still be nice to have the currently unimplemented platform wrappers added to the standard