summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-setres_id.c
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2020-08-21 00:00:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-08-21 00:00:13 +0000
commited358b3546c776c1c677fd88eb8f716cf6187510 (patch)
tree3c6134bcb2cda4b9dccc57b4a8b997a945aab62d /openbsd-compat/bsd-setres_id.c
parent22246b08952d746a7cc5a292570636cf4277598f (diff)
parent44a1065de8a58c51a021243a28bfa01e87822e4f (diff)
Merge changes I934c73d4,I28cdc9a0,I9e734da9,I3c079d86
* changes: UPSTREAM: depend UPSTREAM: upstream: avoid possible NULL deref; from Pedro Martelletto Revert "upstream: fix compilation with DEBUG_KEXDH; bz#3160 ok dtucker@" Merge upstream-master into master
Diffstat (limited to 'openbsd-compat/bsd-setres_id.c')
-rw-r--r--openbsd-compat/bsd-setres_id.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/openbsd-compat/bsd-setres_id.c b/openbsd-compat/bsd-setres_id.c
index 018bde8c..04752d5a 100644
--- a/openbsd-compat/bsd-setres_id.c
+++ b/openbsd-compat/bsd-setres_id.c
@@ -1,5 +1,3 @@
-/* $Id: bsd-setres_id.c,v 1.2 2013/12/07 21:23:09 djm Exp $ */
-
/*
* Copyright (c) 2012 Darren Tucker (dtucker at zip com au).
*
@@ -39,20 +37,20 @@ setresgid(gid_t rgid, gid_t egid, gid_t sgid)
#if defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID)
if (setregid(rgid, egid) < 0) {
saved_errno = errno;
- error("setregid %u: %.100s", rgid, strerror(errno));
+ error("setregid %lu: %.100s", (u_long)rgid, strerror(errno));
errno = saved_errno;
ret = -1;
}
#else
if (setegid(egid) < 0) {
saved_errno = errno;
- error("setegid %u: %.100s", (u_int)egid, strerror(errno));
+ error("setegid %lu: %.100s", (u_long)egid, strerror(errno));
errno = saved_errno;
ret = -1;
}
if (setgid(rgid) < 0) {
saved_errno = errno;
- error("setgid %u: %.100s", rgid, strerror(errno));
+ error("setgid %lu: %.100s", (u_long)rgid, strerror(errno));
errno = saved_errno;
ret = -1;
}
@@ -74,7 +72,7 @@ setresuid(uid_t ruid, uid_t euid, uid_t suid)
#if defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID)
if (setreuid(ruid, euid) < 0) {
saved_errno = errno;
- error("setreuid %u: %.100s", ruid, strerror(errno));
+ error("setreuid %lu: %.100s", (u_long)ruid, strerror(errno));
errno = saved_errno;
ret = -1;
}
@@ -83,14 +81,14 @@ setresuid(uid_t ruid, uid_t euid, uid_t suid)
# ifndef SETEUID_BREAKS_SETUID
if (seteuid(euid) < 0) {
saved_errno = errno;
- error("seteuid %u: %.100s", euid, strerror(errno));
+ error("seteuid %lu: %.100s", (u_long)euid, strerror(errno));
errno = saved_errno;
ret = -1;
}
# endif
if (setuid(ruid) < 0) {
saved_errno = errno;
- error("setuid %u: %.100s", ruid, strerror(errno));
+ error("setuid %lu: %.100s", (u_long)ruid, strerror(errno));
errno = saved_errno;
ret = -1;
}