setgid system call behavior

John F Haugh II jfh at greenber.austin.ibm.com
Tue Feb 19 09:14:17 AEST 1991


In article <1991Feb14.162043.2900 at nrcnet0.nrc.ca> ng at cfd.di.nrc.ca writes:
>First of all, how can I reply to you by email. The usr at ...ibm.com addresses
>never work.

The University of Texas has added MX records to handle the .austin.ibm.com
addresses.  They should have been working for some time now.

>You are right about the behavior of setgid() and setuid(). If I have mode
>set to 6755 and call the setgid() before setuid(), I'll get the result
>as I expected.
>
>That means should never trust the manual (or man page). It has never
>mentioned the setgid behavior could be under the mercy of setuid.

Actually it is documented.  The info pages are very explicit in the
behavior of the setgid() and setuid() system calls.

The behavior that you are seeing is caused by the effective UID not
being that of the "root" user.  In that case, the documentation states
that the saved GID is not set.  Only in the case that the effective
UID is that of the "root" user does the documentation state that all
three GID's are modified.  This documentation (and the behavior that
goes with it) was borrowed by POSIX.
-- 
John F. Haugh II      |      I've Been Moved     |    MaBellNet: (512) 838-4340
SneakerNet: 809/1D064 |          AGAIN !         |      VNET: LCCB386 at AUSVMQ
BangNet: ..!cs.utexas.edu!ibmchs!auschs!snowball.austin.ibm.com!jfh (e-i-e-i-o)



More information about the Comp.unix.aix mailing list