Imported Upstream version 1.8.3p2
[debian/sudo] / src / sudo.c
index 658d23eeaa588897431fc4596a38c94d5ceb23a0..9e52cd5130ca66bea6d874e60d27d5e9e76fa0da 100644 (file)
@@ -956,12 +956,14 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
      */
 #ifdef HAVE_SETEUID
     if (ISSET(details->flags, CD_SET_EGID) && setegid(details->egid)) {
-       warning(_("unable to set effective gid to runas gid %u"), details->egid);
+       warning(_("unable to set effective gid to runas gid %u"),
+           (unsigned int)details->egid);
        goto done;
     }
 #endif
     if (ISSET(details->flags, CD_SET_GID) && setgid(details->gid)) {
-       warning(_("unable to set gid to runas gid %u"), details->gid);
+       warning(_("unable to set gid to runas gid %u"),
+           (unsigned int)details->gid);
        goto done;
     }
 
@@ -1000,8 +1002,8 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
     }
 #elif HAVE_SETREUID
     if (setreuid(details->uid, details->euid) != 0) {
-       warning(_("unable to change to runas uid (%u, %u)"), details->uid,
-           details->euid);
+       warning(_("unable to change to runas uid (%u, %u)"),
+           (unsigned int)details->uid, (unsigned int)details->euid);
        goto done;
     }
 #else
@@ -1206,15 +1208,15 @@ void
 sudo_debug(int level, const char *fmt, ...)
 {
     va_list ap;
-    char *fmt2;
+    char *buf;
 
     if (level > debug_level)
        return;
 
-    /* Backet fmt with program name and a newline to make it a single write */
-    easprintf(&fmt2, "%s: %s\n", getprogname(), fmt);
+    /* Bracket fmt with program name and a newline to make it a single write */
     va_start(ap, fmt);
-    vfprintf(stderr, fmt2, ap);
+    evasprintf(&buf, fmt, ap);
     va_end(ap);
-    efree(fmt2);
+    fprintf(stderr, "%s: %s\n", getprogname(), buf);
+    efree(buf);
 }