]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordtucker@openbsd.org <dtucker@openbsd.org>
Wed, 24 Jun 2015 01:49:19 +0000 (01:49 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 24 Jun 2015 23:50:12 +0000 (09:50 +1000)
Revert previous commit.  We still want to call setgroups
 in the case where there are zero groups to remove any that we might otherwise
 inherit (as pointed out by grawity at gmail.com) and since the 2nd argument
 to setgroups is always a static global it's always valid to dereference in
 this case.  ok deraadt@ djm@

Upstream-ID: 895b5ac560a10befc6b82afa778641315725fd01

uidswap.c

index 36fe9c896d7ef3a6762e7b905a6aa199f41e2b93..0702e1d9e1b8c6f42e6fa2b2ec79ed972d5ac1e6 100644 (file)
--- a/uidswap.c
+++ b/uidswap.c
@@ -187,8 +187,7 @@ restore_uid(void)
        setgid(getgid());
 #endif /* SAVED_IDS_WORK_WITH_SETEUID */
 
-       if (saved_egroupslen > 0 &&
-           setgroups(saved_egroupslen, saved_egroups) < 0)
+       if (setgroups(saved_egroupslen, saved_egroups) < 0)
                fatal("setgroups: %.100s", strerror(errno));
        temporarily_use_uid_effective = 0;
 }