summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2015-06-24 01:49:19 +0000
committerDamien Miller <djm@mindrot.org>2015-06-25 09:50:12 +1000
commit7ed01a96a1911d8b4a9ef4f3d064e1923bfad7e3 (patch)
tree819f863c074356773c0467f5c54efcca5a87c804 /uidswap.c
parent882f8bf94f79528caa65b0ba71c185d705bb7195 (diff)
upstream commit
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
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/uidswap.c b/uidswap.c
index 36fe9c896..0702e1d9e 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -187,8 +187,7 @@ restore_uid(void)
187 setgid(getgid()); 187 setgid(getgid());
188#endif /* SAVED_IDS_WORK_WITH_SETEUID */ 188#endif /* SAVED_IDS_WORK_WITH_SETEUID */
189 189
190 if (saved_egroupslen > 0 && 190 if (setgroups(saved_egroupslen, saved_egroups) < 0)
191 setgroups(saved_egroupslen, saved_egroups) < 0)
192 fatal("setgroups: %.100s", strerror(errno)); 191 fatal("setgroups: %.100s", strerror(errno));
193 temporarily_use_uid_effective = 0; 192 temporarily_use_uid_effective = 0;
194} 193}