summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/uidswap.c b/uidswap.c
index 7745a976e..96ff931e1 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $"); 10RCSID("$OpenBSD: uidswap.c,v 1.8 2000/08/28 03:50:54 deraadt Exp $");
11 11
12#include "ssh.h" 12#include "ssh.h"
13#include "uidswap.h" 13#include "uidswap.h"
@@ -47,15 +47,15 @@ temporarily_use_uid(uid_t uid)
47 47
48 /* Set the effective uid to the given (unprivileged) uid. */ 48 /* Set the effective uid to the given (unprivileged) uid. */
49 if (seteuid(uid) == -1) 49 if (seteuid(uid) == -1)
50 debug("seteuid %d: %.100s", (int) uid, strerror(errno)); 50 debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
51#else /* SAVED_IDS_WORK_WITH_SETUID */ 51#else /* SAVED_IDS_WORK_WITH_SETUID */
52 /* Propagate the privileged uid to all of our uids. */ 52 /* Propagate the privileged uid to all of our uids. */
53 if (setuid(geteuid()) < 0) 53 if (setuid(geteuid()) < 0)
54 debug("setuid %d: %.100s", (int) geteuid(), strerror(errno)); 54 debug("setuid %u: %.100s", (u_int) geteuid(), strerror(errno));
55 55
56 /* Set the effective uid to the given (unprivileged) uid. */ 56 /* Set the effective uid to the given (unprivileged) uid. */
57 if (seteuid(uid) == -1) 57 if (seteuid(uid) == -1)
58 debug("seteuid %d: %.100s", (int) uid, strerror(errno)); 58 debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
59#endif /* SAVED_IDS_WORK_WITH_SETEUID */ 59#endif /* SAVED_IDS_WORK_WITH_SETEUID */
60} 60}
61 61
@@ -68,7 +68,7 @@ restore_uid()
68#ifdef SAVED_IDS_WORK_WITH_SETEUID 68#ifdef SAVED_IDS_WORK_WITH_SETEUID
69 /* Set the effective uid back to the saved uid. */ 69 /* Set the effective uid back to the saved uid. */
70 if (seteuid(saved_euid) < 0) 70 if (seteuid(saved_euid) < 0)
71 debug("seteuid %d: %.100s", (int) saved_euid, strerror(errno)); 71 debug("seteuid %u: %.100s", (u_int) saved_euid, strerror(errno));
72#else /* SAVED_IDS_WORK_WITH_SETEUID */ 72#else /* SAVED_IDS_WORK_WITH_SETEUID */
73 /* 73 /*
74 * We are unable to restore the real uid to its unprivileged value. 74 * We are unable to restore the real uid to its unprivileged value.
@@ -95,5 +95,5 @@ permanently_set_uid(uid_t uid)
95#endif /* WITH_IRIX_AUDIT */ 95#endif /* WITH_IRIX_AUDIT */
96 96
97 if (setuid(uid) < 0) 97 if (setuid(uid) < 0)
98 debug("setuid %d: %.100s", (int) uid, strerror(errno)); 98 debug("setuid %u: %.100s", (u_int) uid, strerror(errno));
99} 99}