commit 3f199e43b69230ef9ea58ac51a4dab524f1c83f4
parent ebb6b00bf66828c5a2587dd2cd44f8810e01e00b
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Sun, 16 Jul 2017 16:59:34 +0000
More secure s6-applyuidgid on systems with a broken setgroups() (thanks muh)
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemontools-extras/s6-applyuidgid.c b/src/daemontools-extras/s6-applyuidgid.c
@@ -54,7 +54,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (!argc) dieusage() ;
- if (gidn != (size_t)-1 && skalibs_setgroups(gidn, gids) < 0)
+ if (gidn != (size_t)-1 && setgroups_and_gid(gid ? gid : getegid(), gidn, gids) < 0)
strerr_diefu1sys(111, "set supplementary group list") ;
if (gid && setgid(gid) < 0)
strerr_diefu1sys(111, "setgid") ;