Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jul 2017 17:49:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 220779] getgroups result is affected by setegid
Message-ID:  <bug-220779-15@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220779

            Bug ID: 220779
           Summary: getgroups result is affected by setegid
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: freebsd-standards@FreeBSD.org
          Reporter: muh.muhten@gmail.com

On FreeBSD, the groups applicable to a process are stored in an array with the
egid in [0] and and zero or more (not necessarily distinct) additional gids in
sorted order.

The setgid, setegid, and setregid functions change the egid of a process, but
the process's supplementary group ids are to remain unchanged. Since getgroups,
which claims to conform to IEEE Std 1003.1-2008 (“POSIX.1”), is defined to fill
its second argument with calling process's supplementary group ids, so its
output must not include the egid, which is changed by setgid &c.. The current
implementation fills the second argument with the entire groups array, which
does include the egid in [0].

- "The setgid() function shall not affect the supplementary group list in any
way. Any supplementary group IDs of the calling process shall remain
unchanged."
- "The setegid() function shall not affect the supplementary group list in any
way."
- (ditto for setregid)
- "The getgroups() function shall fill in the array grouplist with the current
supplementary group IDs of the calling process. It is implementation-defined
whether getgroups() also returns the effective group ID in the grouplist
array."
- "A process has up to {NGROUPS_MAX} supplementary group IDs in addition to the
effective group ID."

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-220779-15>