summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/uidswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/uidswap.c')
-rw-r--r--crypto/openssh/uidswap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/openssh/uidswap.c b/crypto/openssh/uidswap.c
index 26d17f9..1f09d58 100644
--- a/crypto/openssh/uidswap.c
+++ b/crypto/openssh/uidswap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uidswap.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: uidswap.c,v 1.36 2013/11/08 11:15:19 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -20,6 +20,7 @@
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <grp.h>
@@ -133,7 +134,9 @@ temporarily_use_uid(struct passwd *pw)
void
permanently_drop_suid(uid_t uid)
{
+#ifndef HAVE_CYGWIN
uid_t old_uid = getuid();
+#endif
debug("permanently_drop_suid: %u", (u_int)uid);
if (setresuid(uid, uid, uid) < 0)
@@ -196,8 +199,10 @@ restore_uid(void)
void
permanently_set_uid(struct passwd *pw)
{
+#ifndef HAVE_CYGWIN
uid_t old_uid = getuid();
gid_t old_gid = getgid();
+#endif
if (pw == NULL)
fatal("permanently_set_uid: no user given");
OpenPOWER on IntegriCloud