Using an external python method I am trying to change the group ownership of a directory on a Red Hat 6 server. Here is the line of code in question: os.system('chgrp -R extranet /web/htdocs/clients/test') When run from the command line it works fine or if run as a python program from the command line it works fine, but if run as an external method it doesn't work. An "Operation not permitted" error occurs if I try to do the same thing using the os.chown(path, UID, GID) command in the external method. I'm assuming it has something to do with the permissions that Zope/Python is running under. (user:nobody) Any suggestions or insights about how to accomplish this task from an external method? Thanks, Eric
Eric Shuman wrote:
Using an external python method I am trying to change the group ownership of a directory on a Red Hat 6 server.
The problem is most likely one of permission. If the Zope server is started as the root user, it will change its UID to nobody, and I'd wager that 'nobody' doesn't have permission to -
os.system('chgrp -R extranet /web/htdocs/clients/test')
The files and directories in this path would have to be owned by nobody for this to succeed (which would account for why it's working when you execute it from the command line). If you can't do that, then you may need to write a setuid program/script to perform this task as the person who owns the files/directories (something the other P language does with its setuid interpreter). Regards, Daryl Tester
participants (2)
-
Daryl Tester -
Eric Shuman