- (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch

from vinschen at redhat.com
This commit is contained in:
Darren Tucker 2014-01-18 20:43:49 +11:00
parent 355f861022
commit 89c532d843
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
20140118
- (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch
from vinschen at redhat.com
20140117 20140117
- (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain - (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain
hardening flags including -fstack-protector-strong. These default to on hardening flags including -fstack-protector-strong. These default to on

View File

@ -134,7 +134,9 @@ temporarily_use_uid(struct passwd *pw)
void void
permanently_drop_suid(uid_t uid) permanently_drop_suid(uid_t uid)
{ {
#ifndef HAVE_CYGWIN
uid_t old_uid = getuid(); uid_t old_uid = getuid();
#endif
debug("permanently_drop_suid: %u", (u_int)uid); debug("permanently_drop_suid: %u", (u_int)uid);
if (setresuid(uid, uid, uid) < 0) if (setresuid(uid, uid, uid) < 0)
@ -197,8 +199,10 @@ restore_uid(void)
void void
permanently_set_uid(struct passwd *pw) permanently_set_uid(struct passwd *pw)
{ {
#ifndef HAVE_CYGWIN
uid_t old_uid = getuid(); uid_t old_uid = getuid();
gid_t old_gid = getgid(); gid_t old_gid = getgid();
#endif
if (pw == NULL) if (pw == NULL)
fatal("permanently_set_uid: no user given"); fatal("permanently_set_uid: no user given");