IOError - cannot create file (linux daemon-invoked script)
lists at cheimes.de
Sun Jan 3 03:40:17 CET 2010
> The strange thing is that even with the right user-id, I cannot seem
> to write to the directory, getting an IOError exception. Changing the
> directory to world-writable fixes this. I can confirm the uid and gid
> for the script by having the script print these values just before
> trying to create/write the file. Becoming the same lesser user, I
> have no problem writing a file to the same directory.
Are you able to write to the directory with the user id when you tried
to create a file manually?
How are you changing the uid and gid of your script? IIRC you have to
set the effective user id with os.seteuid() and os.setegid().
More information about the Python-list