Article View: news.software.nntp
Article #40957Re: inndstart: setreuid(222, 0) failed: Not owner
From: Andrew Gierth
Date: Tue, 19 Oct 1999 00:00
Date: Tue, 19 Oct 1999 00:00
33 lines
2072 bytes
2072 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes: Russ> The method that inndstart is using is what I understood to be Russ> the standard mechanism for dropping permissions temporarily. Russ> It calls setreuid(0, xxx) to set its real user ID to root (so Russ> that it will be able to regain permissions later) and its Russ> effective UID to the news user, basically swapping its real and Russ> effective UIDs. It then does things that should be done Russ> unprivileged, with slightly more safety since the effective UID Russ> isn't root. When it's done, it tries to swap the UIDs back Russ> with a call to setreuid(xxx, 0). On systems with saved-ids (even ones like FreeBSD where _POSIX_SAVED_IDS isn't defined) you should probably do something like setreuid(-1, news_user); to become the news user (temporarily dropping permissions), and setreuid(-1, 0); to switch back to root. (This works because your saved-set-uid is root, so you're allowed to do this.) If you have seteuid() available you should probably use that instead of setreuid(). Messing with the real uid is the historical method. -- Andrew.
Technical Details
Message-ID:
<87k8ojr9bb.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>Show Full Headers
Complete Article Headers
Message-ID: <87k8ojr9bb.fsf@erlenstar.demon.co.uk> Subject: Re: inndstart: setreuid(222, 0) failed: Not owner Date: Tue, 19 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> 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: 537864936 X-Mayan-Date: Long count = 12.19.6.11.6; tzolkin = 13 Cimi; haab = 14 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