CGI, python, and setgid
Posted
by
user331398
on Stack Overflow
See other posts from Stack Overflow
or by user331398
Published on 2011-02-27T15:18:34Z
Indexed on
2011/02/27
15:25 UTC
Read the original article
Hit count: 287
I'm running a compiled python cgi script (using cxfreeze) in Apache. The script, among other things, calls
os.setuid(some_uid)
os.setgid(some_gid)
Obviously some_uid/gid are legal and I set the sticky bit for both user and group, and verified it is indeed set. However on every call i get an error
os.setgid(int(self.gid))
OSError: [Errno 1] Operation not permitted
As you may notice, setuid() is successful, setgid is not. Which is very weird, at least for me, though I admit I have little experience with permissions in Linux. Any thoughts/ideas are welcome.
I'm using apache 2.2.15, python 2.6.5, RHEL 5.4 (kernel 2.6.18)
Thank you
© Stack Overflow or respective owner