Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-06 Thread cassiope
On Jan 5, 10:58 am, Nobody wrote: > On Mon, 04 Jan 2010 21:30:31 -0800, cassiope wrote: > > One more tidbit observed: my last note, that it works when using > > seteuid/setegid? > > Well - that only applies if the daemon is running under strace (!). > > It fails > > if started directly by root, or

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-05 Thread Nobody
On Mon, 04 Jan 2010 21:30:31 -0800, cassiope wrote: > One more tidbit observed: my last note, that it works when using > seteuid/setegid? > Well - that only applies if the daemon is running under strace (!). > It fails > if started directly by root, or if the strace session has ended, > leaving th

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-04 Thread cassiope
One more tidbit observed: my last note, that it works when using seteuid/setegid? Well - that only applies if the daemon is running under strace (!). It fails if started directly by root, or if the strace session has ended, leaving the main body of the daemon running in its normal headless manner.

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-04 Thread cassiope
On Jan 4, 4:23 pm, Cameron Simpson wrote: > On 04Jan2010 09:16, cassiope wrote: > | To Cameron: the file doesn't (yet) exist; and it has the correct full > | path. > > Can you show us the strace output of the failing open() call? Ah...presumably you mean: [pid 1976] open("/var/tmp/share/lvrq

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-04 Thread Cameron Simpson
On 04Jan2010 09:16, cassiope wrote: | To Cameron: the file doesn't (yet) exist; and it has the correct full | path. Can you show us the strace output of the failing open() call? | To "Nobody" : hey, this seems interesting. First test, invoking | seteuid() | and setegid() didn't help - but stran

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-04 Thread cassiope
On Jan 4, 7:46 am, Nobody wrote: > On Sun, 03 Jan 2010 13:56:24 -0800, cassiope wrote: > > I'm changing the uid and gid in the daemon (which runs with root > > permissions > > until the fork and uid/gid change).  The uid and gid are confirmed by > > printing os.getuid() and os.getgid() in the scri

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-04 Thread Nobody
On Sun, 03 Jan 2010 13:56:24 -0800, cassiope wrote: > I'm changing the uid and gid in the daemon (which runs with root > permissions > until the fork and uid/gid change). The uid and gid are confirmed by > printing os.getuid() and os.getgid() in the script. Those tell you the *real* UID/GID. Fil

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread Cameron Simpson
On 03Jan2010 15:56, cassiope wrote: | Strace confirms the uid and gid == "lesser user". Changing the | directory | permissions to 775 changes nothing. Clearly get EACCES error on the | attempted | file creation. | | The only other thing is that as part of the python interpreter call, I | provid

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread cassiope
On Jan 3, 3:00 pm, Cameron Simpson wrote: > On 03Jan2010 14:20, cassiope wrote: > | On Jan 2, 8:02 pm, Cameron Simpson wrote: > | > Can you show us: > | >   - the directory user and group ownership and permissions > | >   - the daemon's user and group values? > | > | Directory permissions: 774 >

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread Cameron Simpson
On 03Jan2010 14:20, cassiope wrote: | On Jan 2, 8:02 pm, Cameron Simpson wrote: | > Can you show us: | >   - the directory user and group ownership and permissions | >   - the daemon's user and group values? | | Directory permissions: 774 That's unusual - why the "4"? Directories with read but

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread cassiope
On Jan 2, 8:02 pm, Cameron Simpson wrote: > On 02Jan2010 15:21, cassiope wrote: > | [...]  I want > | to save a copy of the email in a particular directory which is > | accessible to the Windows clients via samba. > | > | The strange thing is that even with the right user-id, I cannot seem > | to

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread Steve Holden
cassiope wrote: > On Jan 2, 6:40 pm, Christian Heimes wrote: >> cassiope wrote: >>> 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

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread cassiope
On Jan 2, 6:40 pm, Christian Heimes wrote: > cassiope wrote: > > 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 sc

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-03 Thread cassiope
On Jan 2, 3:46 pm, Steve Holden wrote: > cassiope wrote: > > I have a daemon on a Linux system that supports a number of Windows > > clients.  Among the functions is to send e-mails, which is > > sufficiently complicated that I fork() a separate process which gets > > setuid to a lesser user, and

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-02 Thread Cameron Simpson
On 02Jan2010 15:21, cassiope wrote: | [...] I want | to save a copy of the email in a particular directory which is | accessible to the Windows clients via samba. | | The strange thing is that even with the right user-id, I cannot seem | to write to the directory, getting an IOError exception.

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-02 Thread Christian Heimes
cassiope wrote: > 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 befo

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-02 Thread Steve Holden
cassiope wrote: > I have a daemon on a Linux system that supports a number of Windows > clients. Among the functions is to send e-mails, which is > sufficiently complicated that I fork() a separate process which gets > setuid to a lesser user, and calls a python script which does the > actual form

IOError - cannot create file (linux daemon-invoked script)

2010-01-02 Thread cassiope
I have a daemon on a Linux system that supports a number of Windows clients. Among the functions is to send e-mails, which is sufficiently complicated that I fork() a separate process which gets setuid to a lesser user, and calls a python script which does the actual formatting and emailing (the d