]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/, src/: Unconditionally call setgroups(2)
authorAlejandro Colomar <alx@kernel.org>
Thu, 14 Nov 2024 18:05:31 +0000 (19:05 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 24 Jan 2025 13:58:13 +0000 (07:58 -0600)
commit1b8ae5b55131ec5679147811bf71488299624ba2
tree16f8b2498b7799992b9f335f4f62ed92fa14b935
parenta2841ce77c9a5688c9c3eba06bf9f19d65df6959
lib/, src/: Unconditionally call setgroups(2)

Call it regardless of having added any groups.  If the group list is the
same that getgroups(3) gave us, setgroups(3) will be a no-op, and it
simplifies the surrounding code, by removing the 'added' variable, and
allowing to call lsearch(3) instead of lfind(3).

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/addgrps.c
src/newgrp.c