summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-10-19 16:33:33 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-10-19 16:33:33 +1000
commit35beaddc7e86a47d782d5b69b26e940d2a8b6f73 (patch)
treef2bf757b002d22338995951f4653ab3a10767c0b
parent0e035d816a1d08ae2cf1b49916c5bb6d4ac62a6d (diff)
- (dtucker) [uidswap.c] Don't test dropping of gids for the root user or
on Cygwin. Cygwin parts from vinschen at redhat com; ok djm@
-rw-r--r--ChangeLog6
-rw-r--r--uidswap.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 89a1a806..9b5725d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20041019
+ - (dtucker) [uidswap.c] Don't test dropping of gids for the root user or
+ on Cygwin. Cygwin parts from vinschen at redhat com; ok djm@
+
20041016
- (djm) [auth-pam.c] snprintf->strl*, fix server message length calculations;
ok dtucker@
@@ -1767,4 +1771,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3560 2004/10/16 08:53:28 djm Exp $
+$Id: ChangeLog,v 1.3561 2004/10/19 06:33:33 dtucker Exp $
diff --git a/uidswap.c b/uidswap.c
index 44c4cb62..fa3d7a3b 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -200,10 +200,12 @@ permanently_set_uid(struct passwd *pw)
fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
#endif
+#ifndef HAVE_CYGWIN
/* Try restoration of GID if changed (test clearing of saved gid) */
- if (old_gid != pw->pw_gid &&
+ if (old_gid != pw->pw_gid && pw->pw_uid != 0 &&
(setgid(old_gid) != -1 || setegid(old_gid) != -1))
fatal("%s: was able to restore old [e]gid", __func__);
+#endif
/* Verify GID drop was successful */
if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {