2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-02 07:15:27 +00:00

Cast uid_t to unsigned int when printing as %u

This commit is contained in:
Todd C. Miller
2015-09-09 10:14:03 -06:00
parent 2042aa2b75
commit 0dbfbee035

View File

@@ -1015,10 +1015,10 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
*/ */
unlimit_nproc(); unlimit_nproc();
#ifdef HAVE_SETRESUID #if defined(HAVE_SETRESUID)
if (setresuid(details->uid, details->euid, details->euid) != 0) { if (setresuid(details->uid, details->euid, details->euid) != 0) {
sudo_warn(U_("unable to change to runas uid (%u, %u)"), details->uid, sudo_warn(U_("unable to change to runas uid (%u, %u)"),
details->euid); (unsigned int)details->uid, (unsigned int)details->euid);
goto done; goto done;
} }
#elif defined(HAVE_SETREUID) #elif defined(HAVE_SETREUID)
@@ -1029,8 +1029,8 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
} }
#else #else
if (seteuid(details->euid) != 0 || setuid(details->euid) != 0) { if (seteuid(details->euid) != 0 || setuid(details->euid) != 0) {
sudo_warn(U_("unable to change to runas uid (%u, %u)"), details->uid, sudo_warn(U_("unable to change to runas uid (%u, %u)"),
details->euid); (unsigned int)details->uid, (unsigned int)details->euid);
goto done; goto done;
} }
#endif /* !HAVE_SETRESUID && !HAVE_SETREUID */ #endif /* !HAVE_SETRESUID && !HAVE_SETREUID */