*/
#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;
}
}
#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
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);
}