Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.programmer Subject: Re: rdist/setreuid Message-ID: <6921@auspex.auspex.com> Date: 30 Mar 91 23:43:40 GMT References: <13726@arctic.nprdc.navy.mil> Organization: Auspex Systems, Santa Clara Lines: 16 >We ran into a problem while trying to port rdist from 4.3bsd to sysVr3. >rdist uses setreuid to switch back and forth between root and the user, >but sysVr3 (and even sysVr4 apparently) only has setuid; ie, once >you're the user, there's no going back to root. Are we overlooking >something? It's particularly surprising that sysVr4 also seems to >have this limitation. S5R4 may have, as an undocumented feature, a "seteuid()" call that, even if you're root, sets *only* the effective UID and leaves the saved-set-user ID alone. I think the next POSIX 1003.1 supplement will mandate "seteuid()", so it shouldn't remain undocumented forever.... (S5R4 apparently has a "setreuid()" call in the BSD compatibility library; whether any particular vendor supplies that library is up to them. I don't know how complete it is, and I think it's implemented, in part, atop "seteuid()"....)