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

cassiope fpm at u.washington.edu
Mon Jan 4 12:16:52 EST 2010


On Jan 4, 7:46 am, Nobody <nob... at nowhere.com> 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 script.
>
> Those tell you the *real* UID/GID. Filesystem checks are performed using
> the *effective* UID/GID.
>
> You need to set them with seteuid/setegid and check them with
> geteuid/getegid.

To Cameron: the file doesn't (yet) exist; and it has the correct full
path.

To "Nobody" : hey, this seems interesting.  First test, invoking
seteuid()
and setegid() didn't help - but strange thing was these calls didn't
show
up in the strace, so perhaps I wasn't testing what I thought I was.
I'll
have to check this later as people are now back to work and needing
the
daemon for its other functions...

Thanks for your ideas!  I'll be checking it more later...



More information about the Python-list mailing list