Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: ames!decwrl!teraida!mikel@uunet.uu.net (Mikel Lechner) Newsgroups: comp.sys.sun Subject: Re: writing daemons under SunOS 4.0 Keywords: Software Message-ID: <3706@teraida.UUCP> Date: 3 May 89 11:04:06 GMT References: <359@bnr-fos.UUCP> Sender: usenet@rice.edu Organization: Teradyne EDA Inc., Santa Clara, Calif. Lines: 16 Approved: Sun-Spots@rice.edu Original-Date: 13 Apr 89 18:11:10 GMT X-Sun-Spots-Digest: Volume 7, Issue 264, message 2 of 13 bnr-fos!leibniz!hwt@watmath.waterloo.edu (Henry Troup) writes: >X-Sun-Spots-Digest: Volume 7, Issue 221, message 8 of 12 >I'm writing a daemon process under SunOS 4.0. I've made the program >setuid root, it immediately forks, and gets rid of its controlling >terminal. But I can still kill the process from the general user I >started it from. Is this the correct behaviour? You can also do "setuid(geteuid())". This sets both the effective and real userids to the effective userid. This is good practice in all setuid programs unless they require the original user's permissions. Mikel Lechner UUCP: ...!{decwrl,sun}!teraida!mikel Teradyne EDA, Inc. Phone: (408) 980-5200 5155 Old Ironsides Drive Santa Clara, Ca 95054