Re: proposal: add setresuid() system call to python

2009-08-25 Thread Hrvoje Niksic
travis+ml-pyt...@subspacefield.org writes: On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid): return _setresuid(__uid_t(ruid), __uid_t(euid),

Re: proposal: add setresuid() system call to python

2009-08-25 Thread travis
On Tue, Aug 25, 2009 at 03:03:12PM +0200, Hrvoje Niksic wrote: You should use ctypes.get_errno() instead of os.errno; sorry about that. Also, when raising OSError, you should set the 'errno' attribute to the appropriate code. How does that compare to: raise

Re: proposal: add setresuid() system call to python

2009-08-25 Thread travis+ml-python
On Fri, Aug 21, 2009 at 03:13:12PM -0500, tra...@subspacefield.org wrote: Since the authors of the paper (Wagner et. al.) are proposing a new set of APIs to make all of this clearer, I'm thinking that I will create a module specifically for dropping permissions. I've created the module here:

Re: proposal: add setresuid() system call to python

2009-08-21 Thread travis
On Fri, Jul 17, 2009 at 04:59:53PM -0400, Jean-Paul Calderone wrote: On Fri, 17 Jul 2009 15:01:41 -0500, travis+ml-pyt...@subspacefield.org wrote: I am suggesting that the setresuid function be added to python, perhaps in the OS module, because it has the clearest semantics for manipulating

Re: proposal: add setresuid() system call to python

2009-08-21 Thread travis+ml-python
On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid): return _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid)) def setresuid(ruid, euid,

Re: proposal: add setresuid() system call to python

2009-08-21 Thread Carl Banks
On Aug 21, 1:50 pm, travis+ml-pyt...@subspacefield.org wrote: On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid):     return

Re: proposal: add setresuid() system call to python

2009-07-20 Thread Neal Becker
Mahmoud Abdelkader wrote: Why don't you write a python extension module? This is a perfect opportunity for that. I think having a module just for one system call is a bit silly. Why not add to os module? -- http://mail.python.org/mailman/listinfo/python-list

Re: proposal: add setresuid() system call to python

2009-07-20 Thread Diez B. Roggisch
Neal Becker wrote: again with his notorious gmane.comp.python.general group that doesn't work for any decent news-reader. Mahmoud Abdelkader wrote: Why don't you write a python extension module? This is a perfect opportunity for that. I think having a module just for one system

Re: proposal: add setresuid() system call to python

2009-07-20 Thread Hrvoje Niksic
Diez B. Roggisch de...@nospam.web.de writes: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid): return _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid)) def setresuid(ruid, euid, suid): res =

Re: proposal: add setresuid() system call to python

2009-07-17 Thread Mahmoud Abdelkader
Why don't you write a python extension module? This is a perfect opportunity for that. -- mahmoud mack abdelkader http://blog.mahmoudimus.com/ On Fri, Jul 17, 2009 at 4:01 PM, travis+ml-pyt...@subspacefield.orgtravis%2bml-pyt...@subspacefield.org wrote: Hello, Historically, I have used

Re: proposal: add setresuid() system call to python

2009-07-17 Thread Robert Kern
On 2009-07-17 15:01, travis+ml-pyt...@subspacefield.org wrote: Hello, Historically, I have used scripting languages like python for typical uses, but they tend to not fare very well at system programming; for close interfacing with the operating system, I'm often forced to use a language like

Re: proposal: add setresuid() system call to python

2009-07-17 Thread Jean-Paul Calderone
On Fri, 17 Jul 2009 15:01:41 -0500, travis+ml-pyt...@subspacefield.org wrote: Hello, [snip] I am suggesting that the setresuid function be added to python, perhaps in the OS module, because it has the clearest semantics for manipulating user ids. The reason why is best described in the