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:48:41 +1000
commit882f8bf94f79528caa65b0ba71c185d705bb7195 (patch)
tree0d93589d0f3ec530f72dbc31c796385fba4fff95 /uidswap.c
parent9488538a726951e82b3a4374f3c558d72c80a89b (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/uidswap.c b/uidswap.c
index 27a2faa62..36fe9c896 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: uidswap.c,v 1.38 2015/06/22 12:29:57 dtucker Exp $ */ 1/* $OpenBSD: uidswap.c,v 1.39 2015/06/24 01:49:19 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -113,7 +113,7 @@ temporarily_use_uid(struct passwd *pw)
113 } 113 }
114 } 114 }
115 /* Set the effective uid to the given (unprivileged) uid. */ 115 /* Set the effective uid to the given (unprivileged) uid. */
116 if (user_groupslen > 0 && setgroups(user_groupslen, user_groups) < 0) 116 if (setgroups(user_groupslen, user_groups) < 0)
117 fatal("setgroups: %.100s", strerror(errno)); 117 fatal("setgroups: %.100s", strerror(errno));
118#ifndef SAVED_IDS_WORK_WITH_SETEUID 118#ifndef SAVED_IDS_WORK_WITH_SETEUID
119 /* Propagate the privileged gid to all of our gids. */ 119 /* Propagate the privileged gid to all of our gids. */