Running subshells under setuid

czrpb nanotech at europa.com
Wed Feb 12 18:23:59 EST 2003


All:

I have the following Python script being run by a setuid binary:

    import os,pwd
 
    s="uid: %s, euid: %s"%(pwd.getpwuid(os.getuid())[0],pwd.getpwuid(os.geteuid())[0])
    print ">>>",s
    os.system("rsync -v --progress setuid.c dog")

In short, rsync is basically copying the local 'setuid.c' file to the file 'dog'. In tsch and perl after this rsync cmd 'dog' is owned by uid of the setuid binary. Not with python -- the owner is the person executing the setuid binary, in other words 'dog' gets the ownership of the real-uid and not the effective-uid.

What am I missing??

thanks!! -- Quentin






More information about the Python-list mailing list