summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2014-01-18 20:43:49 +1100
committerDarren Tucker <dtucker@zip.com.au>2014-01-18 20:43:49 +1100
commit89c532d843c95a085777c66365067d64d1937eb9 (patch)
tree8ab067f574170caead72d64488c81e6e357148d1 /uidswap.c
parent355f861022be7b23d3009fae8f3c9f6f7fc685f7 (diff)
- (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch
from vinschen at redhat.com
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/uidswap.c b/uidswap.c
index 23217ba5c..1f09d5887 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -134,7 +134,9 @@ temporarily_use_uid(struct passwd *pw)
134void 134void
135permanently_drop_suid(uid_t uid) 135permanently_drop_suid(uid_t uid)
136{ 136{
137#ifndef HAVE_CYGWIN
137 uid_t old_uid = getuid(); 138 uid_t old_uid = getuid();
139#endif
138 140
139 debug("permanently_drop_suid: %u", (u_int)uid); 141 debug("permanently_drop_suid: %u", (u_int)uid);
140 if (setresuid(uid, uid, uid) < 0) 142 if (setresuid(uid, uid, uid) < 0)
@@ -197,8 +199,10 @@ restore_uid(void)
197void 199void
198permanently_set_uid(struct passwd *pw) 200permanently_set_uid(struct passwd *pw)
199{ 201{
202#ifndef HAVE_CYGWIN
200 uid_t old_uid = getuid(); 203 uid_t old_uid = getuid();
201 gid_t old_gid = getgid(); 204 gid_t old_gid = getgid();
205#endif
202 206
203 if (pw == NULL) 207 if (pw == NULL)
204 fatal("permanently_set_uid: no user given"); 208 fatal("permanently_set_uid: no user given");