]> granicus.if.org Git - sudo/commitdiff
Cast uid_t to unsigned int when printing as %u
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 16:14:03 +0000 (10:14 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 16:14:03 +0000 (10:14 -0600)
src/sudo.c

index 060c4fba448c1e06fcecbb3038c66170ba66eb9e..7dd76b2cddbedbc2aab2fb0ce1b2648a060617b3 100644 (file)
@@ -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 */