chown'ing by script

Cameron Simpson cs at
Wed Jan 6 07:29:10 CET 2010

On 06Jan2010 01:21, Victor Subervi <victorsubervi at> wrote:
| I have a script that is called via the web. This script writes another
| script that is also called by the web, which in turn needs to have execution
| privileges. The problem is that the programmatically created file is owned
| by apache.apache and thus doesn't have execution privileges. I've tried
| os.chown(...) but this throws an OSError. I understand that chown'ing
| programmatically opens a big security hole. However, setting the gid to give
| apache execution privileges isn't any better. What do you suggest?

Are you sure you don't want chmod?
Cameron Simpson <cs at> DoD#743

Winter is gods' way of telling us to polish.
        - Peter Harper <bo165 at> <harperp at>

More information about the Python-list mailing list