Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs.usg Subject: Re: suid() and root Message-ID: <2120@sun.uucp> Date: Fri, 12-Apr-85 23:08:35 EST Article-I.D.: sun.2120 Posted: Fri Apr 12 23:08:35 1985 Date-Received: Wed, 17-Apr-85 00:30:45 EST References: <45@wcom.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 27 > It seems that under my "System III" Xenix system, the suid() call doesn't > work if the user is already root. Is this normal? Proper? Do you mean the set-UID bit, or the "setuid()" system call? If the former, "setuid()" had better work if the user is root. If the latter, then no, it is neither normal nor proper. Standard System III (and System V, and also 4.2BSD) honor the set-UID bit even if the process is running as "root"; this was probably done for the very reason you mention - that many set-UID programs want to run with the specified UID even if by "root" happens to run them. Microsoft may have taken a V7 system and converted it into a System III system (which isn't too hard; no, they are NOT radically different versions of UNIX!), but missed the change to the handling of set-UID (when we did our System III UNIX at CCI, we did it the same way, and missed the set-UID change; I stuck it in later). > Is there any solution other than going back to a non-superuser status > before running uucico? Unfortunately, no. You could write a tiny program which resets the UID and executes "/usr/lib/uucp/uucico.rl" or somesuch, and move "/usr/lib/uucp/uucico" to "/usr/lib/uucp/uucico.rl". The 4.2BSD UUCP, which was originally the Research Triangle Institute UUCP (i.e., it wasn't just for 4.2BSD, which *does* handle set-UID properly) set the UID to "uucp"s UID if it was run as root, to handle this very problem. Guy Harris sun!guy