Re: Running one Python program from another as a different user

2005-08-13 Thread Alessandro Bottoni
Jeff Schwab wrote: > [EMAIL PROTECTED] wrote: >> Thanks, that looks very promising... >> Is there a solution for pre-Python v2.4? I have to have code that works >> on 2.x, 0<=x<=4. Do I just use the os.popen instead? > > import os > > def run_as(username): > pipe = os.popen("su %s" % us

Re: Running one Python program from another as a different user

2005-08-12 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Thanks, that looks very promising... > Is there a solution for pre-Python v2.4? I have to have code that works > on 2.x, 0<=x<=4. Do I just use the os.popen instead? import os def run_as(username): pipe = os.popen("su %s" % username, 'w') pipe.write("w

Re: Running one Python program from another as a different user

2005-08-12 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Greetings- > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and gr

Re: Running one Python program from another as a different user

2005-08-12 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and group ids. What

Re: Running one Python program from another as a different user

2005-08-12 Thread [EMAIL PROTECTED]
Thanks, that looks very promising... Is there a solution for pre-Python v2.4? I have to have code that works on 2.x, 0<=x<=4. Do I just use the os.popen instead? -Don -- http://mail.python.org/mailman/listinfo/python-list

Re: Running one Python program from another as a different user

2005-08-12 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Greetings- > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and group ids. What I don't un