open() throws permission error and I don't get why
gohanman at gmail.com
Fri Oct 15 17:52:53 CEST 2010
I'm trying to write a script to read e-mail over stdin, extract
attachments, and distribute them around the file system based on the
incoming e-mail address.
Everything works until I actually try writing interesting file system locations.
I've established, through logging, that postfix runs my script with
UID nobody & GID nobody. The directory I'm attempting to write has
permissions 0770. The directory's group is not nobody, but the user
nobody is a member of the relevant group. Nevertheless, python throws
an IOError when I try to create a file there.
The issue seems to be isolated to python. I can run:
sudo -u nobody touch DIRECTORY_IN_QUESTION/test
and that creates a file.
More information about the Python-list