Add log_warningx

This commit is contained in:
Todd C. Miller
2014-05-02 16:40:30 -06:00
parent 7f0b9eca03
commit 954a3e77b1
13 changed files with 91 additions and 75 deletions

View File

@@ -376,9 +376,9 @@ log_auth_failure(int status, unsigned int tries)
* If sudoers denied the command we'll log that separately.
*/
if (ISSET(status, FLAG_BAD_PASSWORD))
log_warning(flags, INCORRECT_PASSWORD_ATTEMPT, tries);
log_warningx(flags, INCORRECT_PASSWORD_ATTEMPT, tries);
else if (ISSET(status, FLAG_NON_INTERACTIVE))
log_warning(flags, N_("a password is required"));
log_warningx(flags, N_("a password is required"));
debug_return;
}
@@ -424,7 +424,7 @@ log_allowed(int status)
}
/*
* Perform logging for log_warning().
* Perform logging for log_warning()/log_warningx().
*/
static void
vlog_warning(int flags, const char *fmt, va_list ap)
@@ -521,6 +521,20 @@ log_warning(int flags, const char *fmt, ...)
va_list ap;
debug_decl(log_error, SUDO_DEBUG_LOGGING)
/* Log the error. */
va_start(ap, fmt);
vlog_warning(flags|USE_ERRNO, fmt, ap);
va_end(ap);
debug_return;
}
void
log_warningx(int flags, const char *fmt, ...)
{
va_list ap;
debug_decl(log_error, SUDO_DEBUG_LOGGING)
/* Log the error. */
va_start(ap, fmt);
vlog_warning(flags, fmt, ap);