Article View: news.software.nntp
Article #41075Re: inndstart: setreuid(222, 0) failed: Not owner
From: Andrew Gierth
Date: Sat, 23 Oct 1999 00:00
Date: Sat, 23 Oct 1999 00:00
27 lines
1943 bytes
1943 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:
Russ> In the absence of a better idea at the moment, I'm committing
Russ> changes right now that will use seteuid() if it's available to
Russ> only change the effective UID, and if it isn't available, to
Russ> fall back on setreuid() and swap the real and effective UIDs.
Russ> Every system so far that I've seen that has a seteuid()
Russ> function also supports POSIX saved UIDs, so that's a first pass
Russ> at a portable solution.
Russ> I considered using sysconf() to see if _POSIX_SAVED_IDS was
Russ> set, but according to the above even that isn't reliable. :/
How about:
- use seteuid if available
else if _POSIX_SAVED_IDS, then use setreuid(-1, euid)
else swap the IDs
That should work on everything I've come across (though on some HP-UX
systems you may have to conjure up a seteuid or setreuid from the
system's setresuid() function).
--
Andrew.
Technical Details
Message-ID:
<8766zydmwy.fsf@erlenstar.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<7u5k8b$3uu$1@newssvr02.news.prodigy.com> <ylaepltvlk.fsf@windlord.stanford.edu> <87k8ojr9bb.fsf@erlenstar.demon.co.uk> <yliu3y59il.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <8766zydmwy.fsf@erlenstar.demon.co.uk> Subject: Re: inndstart: setreuid(222, 0) failed: Not owner Date: Sat, 23 Oct 1999 00:00:00 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> References: <7u5k8b$3uu$1@newssvr02.news.prodigy.com> <ylaepltvlk.fsf@windlord.stanford.edu> <87k8ojr9bb.fsf@erlenstar.demon.co.uk> <yliu3y59il.fsf@windlord.stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 539687299 X-Mayan-Date: Long count = 12.19.6.11.10; tzolkin = 4 Oc; haab = 18 Yax X-Complaints-To: andrew@erlenstar.demon.co.uk Organization: disorganised X-Attribution: AG X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-P-Persistent-Headers: are a bad idea. Newsgroups: news.software.nntp X-Post-Filter: postfilter v0.6 alpha