Call setgroups() before setgid() to drop supplementary groups.
authorEmil Mikulic <emikulic@gmail.com>
Sat, 27 Dec 2014 13:58:00 +0000 (00:58 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Sat, 27 Dec 2014 13:58:00 +0000 (00:58 +1100)
commitdbd25d7f8f06770f46fe9f3d460385e699439186
tree432d9b1af6a800213b6a6c54eb310f8e11c41cbc
parentf012d62c2a1c6a4cea31b55cf56d8502163e1130
Call setgroups() before setgid() to drop supplementary groups.

Pointed out to me by: Pavel Alexeev
Caught by rpmlint

See also: https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges
conv.c