Re: Re. suid/sudo in python

2009-03-30 Thread rustom
On Mar 30, 9:41 pm, "Martin P. Hellwig" wrote: > Rustom Mody wrote: > > The essence of your program is that you only want information, that is > great! Since that makes it all a bit simpler. > > How about writing a cronjob that outputs the require information into a > file and then write a separa

Re: Re. suid/sudo in python

2009-03-30 Thread Martin P. Hellwig
Rustom Mody wrote: I don't think this is necessary a python problem but a generic, SUID scripts considered dangerous, problem. The essence of your program is that you only want information, that is great! Since that makes it all a bit simpler. How about writing a cronjob that outputs the re

Re: Re. suid/sudo in python

2009-03-30 Thread rustom
On Mar 30, 6:47 pm, bieff...@gmail.com wrote: > On Mar 30, 1:16 pm, Rustom Mody wrote: > > > > > Ben Finney wrote > > > > The key thing to realise is that, having relinquished privilege, the same > > > process can't get it back again as easily. So if you need to > > > do some tasks as a privilege

Re: Re. suid/sudo in python

2009-03-30 Thread bieffe62
On Mar 30, 1:16 pm, Rustom Mody wrote: > Ben Finney wrote > > > The key thing to realise is that, having relinquished privilege, the same > > process can't get it back again as easily. So if you need to > > do some tasks as a privileged user, do those *very* early and then drop the > > privilege

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
The outline of what I do (in C) is: 1. Write the CGI program in C, put setuid(0), setgid(0) statements in that file and then perform any other actions (including calling other scripts) 2. Set the S bit of the executable of the CGI binary compiled from the C file (chmod +S xxx.cgi) The C code runs

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
On Mon, Mar 30, 2009 at 5:17 PM, andrew cooke wrote: > Rustom Mody wrote: >> Ben Finney wrote >>> The key thing to realise is that, having relinquished privilege, the >>> same process can't get it back again as easily. So if you need to >>> do some tasks as a privileged user, do those *very* early

Re: Re. suid/sudo in python

2009-03-30 Thread andrew cooke
Rustom Mody wrote: > Ben Finney wrote >> The key thing to realise is that, having relinquished privilege, the >> same process can't get it back again as easily. So if you need to >> do some tasks as a privileged user, do those *very* early and then drop >> the privileges for the rest of the life of

Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
Ben Finney wrote > The key thing to realise is that, having relinquished privilege, the same > process can't get it back again as easily. So if you need to > do some tasks as a privileged user, do those *very* early and then drop the > privileges for the rest of the life of the process. > > Takin

Re: suid/sudo in python

2009-03-30 Thread Ben Finney
rustom writes: > Im trying to write a program that has su permissions for some file > system tasks and is non-su elsewhere. On Unix, ‘su’ is a program for switching to a different user; it's not the name of a particular user. I presume you mean “ … that has root permissions for tome file system