summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--uidswap.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 89a1a8066..9b5725d26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120041019
2 - (dtucker) [uidswap.c] Don't test dropping of gids for the root user or
3 on Cygwin. Cygwin parts from vinschen at redhat com; ok djm@
4
120041016 520041016
2 - (djm) [auth-pam.c] snprintf->strl*, fix server message length calculations; 6 - (djm) [auth-pam.c] snprintf->strl*, fix server message length calculations;
3 ok dtucker@ 7 ok dtucker@
@@ -1767,4 +1771,4 @@
1767 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1771 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1768 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1772 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1769 1773
1770$Id: ChangeLog,v 1.3560 2004/10/16 08:53:28 djm Exp $ 1774$Id: ChangeLog,v 1.3561 2004/10/19 06:33:33 dtucker Exp $
diff --git a/uidswap.c b/uidswap.c
index 44c4cb626..fa3d7a3b1 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -200,10 +200,12 @@ permanently_set_uid(struct passwd *pw)
200 fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); 200 fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
201#endif 201#endif
202 202
203#ifndef HAVE_CYGWIN
203 /* Try restoration of GID if changed (test clearing of saved gid) */ 204 /* Try restoration of GID if changed (test clearing of saved gid) */
204 if (old_gid != pw->pw_gid && 205 if (old_gid != pw->pw_gid && pw->pw_uid != 0 &&
205 (setgid(old_gid) != -1 || setegid(old_gid) != -1)) 206 (setgid(old_gid) != -1 || setegid(old_gid) != -1))
206 fatal("%s: was able to restore old [e]gid", __func__); 207 fatal("%s: was able to restore old [e]gid", __func__);
208#endif
207 209
208 /* Verify GID drop was successful */ 210 /* Verify GID drop was successful */
209 if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) { 211 if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {