Xref: utzoo news.admin:14628 news.software.b:7952 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: news.admin,news.software.b Subject: Re: Help on Relaynews Message-ID: <8028@auspex.auspex.com> Date: 25 May 91 02:39:30 GMT References: <1991May17.003758.17351@bpdsun1.uucp> <1991May18.212857.21302@zoo.toronto.edu> Followup-To: news.software.b Organization: Auspex Systems, Santa Clara Lines: 32 >You said "yes" when build asked whether you could do setuid(geteuid()). >Wrong. (On SunOS, yet... sigh.) Really? I tried running a program that read: main() { printf("ruid %d, euid %d\n", getuid(), geteuid()); if (setuid(geteuid()) < 0) perror("setuid"); else printf("ruid %d, euid %d\n", getuid(), geteuid()); } set-UID to "bin", while running as myself, and on both a 4.0.3 and a 4.1.1 machine it printed: ruid 126, euid 3 ruid 3, euid 3 so it did, indeed, set the real UID to match the effective UID, which is exactly what "setuid(geteuid())" is supposed to do. It did the same when I ran it as "root": ruid 0, euid 3 ruid 3, euid 3 and when it was set-UID to "root" and run as me: ruid 126, euid 0 ruid 0, euid 0