diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | uidswap.c | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20041019 | ||
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 | |||
1 | 20041016 | 5 | 20041016 |
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 $ |
@@ -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) { |