os.seteuid

holger krekel pyth at devel.trillke.net
Tue May 7 10:53:32 EDT 2002


Daniel wrote:
> I'm new at this, so maybe I've just got it all wrong, but I have a
> python script owned by root:root with chmod +s.  Should this script be
> able to set-uid/gid/euid/egid or anything?  The script fails at
> changing any of these to anything else.

IIRC scripts cannot be executed as set-uid. (for security reasons, ugh)
At least this is so on my versions of linux. 
You have to write a C-wrapper or use 'sudo' or friends
to call your script. A C-program can be set-uid and can
'execve' your python script.

regards,

    holger





More information about the Python-list mailing list