]> andersk Git - openssh.git/blobdiff - uidswap.c
- markus@cvs.openbsd.org 2001/11/07 22:53:21
[openssh.git] / uidswap.c
index 2c43877d68f2519f729e8b1bcc5e8a57aa87a777..cc91fcf25fd54f0e9e557058869c17cad45c2df3 100644 (file)
--- a/uidswap.c
+++ b/uidswap.c
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: uidswap.c,v 1.16 2001/04/20 16:32:22 markus Exp $");
+RCSID("$OpenBSD: uidswap.c,v 1.18 2001/08/08 21:34:19 markus Exp $");
 
 #include "log.h"
 #include "uidswap.h"
@@ -80,9 +80,11 @@ 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_CYWIN */
 #ifndef SAVED_IDS_WORK_WITH_SETEUID
        /* Propagate the privileged gid to all of our gids. */
        if (setgid(getegid()) < 0)
@@ -115,8 +117,7 @@ restore_uid(void)
 #ifdef SAVED_IDS_WORK_WITH_SETEUID
        /* Set the effective uid back to the saved privileged uid. */
        if (seteuid(saved_euid) < 0)
-               fatal("seteuid %u: %.100s", (u_int) saved_euid, 
-                   strerror(errno));
+               fatal("seteuid %u: %.100s", (u_int) saved_euid, strerror(errno));
        if (setegid(saved_egid) < 0)
                fatal("setegid %u: %.100s", (u_int) saved_egid, 
                    strerror(errno));
@@ -130,8 +131,10 @@ 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;
 }
 
This page took 0.032372 seconds and 4 git commands to generate.