Index: uidswap.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/uidswap.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- uidswap.c	24 Feb 2004 02:17:30 -0000	1.44
+++ uidswap.c	19 Oct 2004 06:33:33 -0000	1.45
@@ -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) {
