[uidswap.c]
     format spec change/casts and some KNF; ok markus@
This commit is contained in:
Ben Lindstrom 2002-06-06 20:38:49 +00:00
parent 105ccbe192
commit abff1dd050
2 changed files with 13 additions and 11 deletions

View File

@ -41,6 +41,9 @@
- stevesk@cvs.openbsd.org 2002/05/28 16:45:27
[monitor_mm.c]
print strerror(errno) on mmap/munmap error; ok markus@
- stevesk@cvs.openbsd.org 2002/05/28 17:28:02
[uidswap.c]
format spec change/casts and some KNF; ok markus@
20020604
- (stevesk) [channels.c] bug #164 patch from YOSHIFUJI Hideaki (changed
@ -725,4 +728,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
$Id: ChangeLog,v 1.2155 2002/06/06 20:33:06 mouring Exp $
$Id: ChangeLog,v 1.2156 2002/06/06 20:38:49 mouring Exp $

View File

@ -12,7 +12,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: uidswap.c,v 1.20 2002/04/01 21:50:51 stevesk Exp $");
RCSID("$OpenBSD: uidswap.c,v 1.21 2002/05/28 17:28:02 stevesk Exp $");
#include "log.h"
#include "uidswap.h"
@ -52,8 +52,8 @@ temporarily_use_uid(struct passwd *pw)
#ifdef SAVED_IDS_WORK_WITH_SETEUID
saved_euid = geteuid();
saved_egid = getegid();
debug("temporarily_use_uid: %d/%d (e=%d)",
pw->pw_uid, pw->pw_gid, saved_euid);
debug("temporarily_use_uid: %u/%u (e=%u)",
(u_int)pw->pw_uid, (u_int)pw->pw_gid, (u_int)saved_euid);
if (saved_euid != 0) {
privileged = 0;
return;
@ -119,8 +119,7 @@ restore_uid(void)
if (seteuid(saved_euid) < 0)
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));
fatal("setegid %u: %.100s", (u_int)saved_egid, strerror(errno));
#else /* SAVED_IDS_WORK_WITH_SETEUID */
/*
* We are unable to restore the real uid to its unprivileged value.