From: Todd C. Miller Date: Wed, 9 Sep 2015 16:14:03 +0000 (-0600) Subject: Cast uid_t to unsigned int when printing as %u X-Git-Tag: SUDO_1_8_15^2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dbfbee03559dd24e36cb7fd7c5b2816eede3a21;p=sudo Cast uid_t to unsigned int when printing as %u --- diff --git a/src/sudo.c b/src/sudo.c index 060c4fba4..7dd76b2cd 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -1015,10 +1015,10 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd) */ unlimit_nproc(); -#ifdef HAVE_SETRESUID +#if defined(HAVE_SETRESUID) if (setresuid(details->uid, details->euid, details->euid) != 0) { - sudo_warn(U_("unable to change to runas uid (%u, %u)"), details->uid, - details->euid); + sudo_warn(U_("unable to change to runas uid (%u, %u)"), + (unsigned int)details->uid, (unsigned int)details->euid); goto done; } #elif defined(HAVE_SETREUID) @@ -1029,8 +1029,8 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd) } #else if (seteuid(details->euid) != 0 || setuid(details->euid) != 0) { - sudo_warn(U_("unable to change to runas uid (%u, %u)"), details->uid, - details->euid); + sudo_warn(U_("unable to change to runas uid (%u, %u)"), + (unsigned int)details->uid, (unsigned int)details->euid); goto done; } #endif /* !HAVE_SETRESUID && !HAVE_SETREUID */