summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-12 16:57:14 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-12 16:57:14 +0000
commit837461bf9a8f71b96a522bf6f51d6fdcb5b2a8cd (patch)
tree8d9133b0e60ad650bf440158bb742a8af7f5c06f /uidswap.c
parentda394cae048e9106ad4f280c91e37ab0df2f1f97 (diff)
downloadopenssh-git-837461bf9a8f71b96a522bf6f51d6fdcb5b2a8cd.tar.gz
- (bal) Build noop setgroups() for cygwin to clean up code (For other
platforms without the setgroups() requirement, you MUST define SETGROUPS_NOOP in the configure.ac) Based on patch by vinschen@redhat.com
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/uidswap.c b/uidswap.c
index 9377ca4b..0a772c7b 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -80,11 +80,9 @@ temporarily_use_uid(struct passwd *pw)
if (user_groupslen < 0)
fatal("getgroups: %.100s", strerror(errno));
}
-#ifndef HAVE_CYGWIN
/* Set the effective uid to the given (unprivileged) uid. */
if (setgroups(user_groupslen, user_groups) < 0)
fatal("setgroups: %.100s", strerror(errno));
-#endif /* !HAVE_CYGWIN */
#ifndef SAVED_IDS_WORK_WITH_SETEUID
/* Propagate the privileged gid to all of our gids. */
if (setgid(getegid()) < 0)
@@ -130,10 +128,8 @@ restore_uid(void)
setgid(getgid());
#endif /* SAVED_IDS_WORK_WITH_SETEUID */
-#ifndef HAVE_CYGWIN
if (setgroups(saved_egroupslen, saved_egroups) < 0)
fatal("setgroups: %.100s", strerror(errno));
-#endif /* !HAVE_CYGWIN */
temporarily_use_uid_effective = 0;
}