Running subshells under setuid

Anders Hammarquist iko at cd.chalmers.se
Thu Feb 13 16:20:45 EST 2003


In article <mailman.1045163457.4803.python-list at python.org>,
Jp Calderone  <exarkun at intarweb.us> wrote:
>On Thu, Feb 13, 2003 at 09:17:37AM -0800, czrpb wrote:
>> Anders/All:
>> 
>> Unfortunately using os.exec I can not then do something like:
>> 
>>   for path in paths:
>>     os.exec(RSYNC,path)
>> 
>
>  def rsync(params):
>      if os.fork() == 0:
>          os.execl('/usr/bin/rsync', 'rsync', *params)

Or possibly

   def rsync(params):
       pid = os.fork()
       if pid == 0:
           os.execl(...)
       elif pid > 0:
           os.waitpid(pid,0)

if you don't want them running in parallell.

/Anders

-- 
 -- Of course I'm crazy, but that doesn't mean I'm wrong.
Anders Hammarquist                                  | iko at cd.chalmers.se
Physics student, Chalmers University of Technology, | Hem: +46 31 88 48 50
G|teborg, Sweden.           RADIO: SM6XMM and N2JGL | Mob: +46 707 27 86 87




More information about the Python-list mailing list