writing daemons under SunOS 4.0

Mikel Lechner ames!decwrl!teraida!mikel at uunet.uu.net
Wed May 3 21:04:06 AEST 1989


bnr-fos!leibniz!hwt at 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



More information about the Comp.sys.sun mailing list