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

@@ -71,13 +71,13 @@ bsdauth_init(struct passwd *pw, sudo_auth *auth)
else
state.lc = login_getclass(pw->pw_uid ? LOGIN_DEFCLASS : LOGIN_DEFROOTCLASS);
if (state.lc == NULL) {
log_warning(USE_ERRNO|NO_MAIL,
log_warning(NO_MAIL,
N_("unable to get login class for user %s"), pw->pw_name);
debug_return_int(AUTH_FATAL);
}
if ((state.as = auth_open()) == NULL) {
log_warning(USE_ERRNO|NO_MAIL,
log_warning(NO_MAIL,
N_("unable to begin bsd authentication"));
login_close(state.lc);
debug_return_int(AUTH_FATAL);
@@ -86,7 +86,7 @@ bsdauth_init(struct passwd *pw, sudo_auth *auth)
/* XXX - maybe sanity check the auth style earlier? */
login_style = login_getstyle(state.lc, login_style, "auth-sudo");
if (login_style == NULL) {
log_warning(NO_MAIL, N_("invalid authentication type"));
log_warningx(NO_MAIL, N_("invalid authentication type"));
auth_close(state.as);
login_close(state.lc);
debug_return_int(AUTH_FATAL);
@@ -95,7 +95,7 @@ bsdauth_init(struct passwd *pw, sudo_auth *auth)
if (auth_setitem(state.as, AUTHV_STYLE, login_style) < 0 ||
auth_setitem(state.as, AUTHV_NAME, pw->pw_name) < 0 ||
auth_setitem(state.as, AUTHV_CLASS, login_class) < 0) {
log_warning(NO_MAIL, N_("unable to initialize BSD authentication"));
log_warningx(NO_MAIL, N_("unable to initialize BSD authentication"));
auth_close(state.as);
login_close(state.lc);
debug_return_int(AUTH_FATAL);
@@ -167,7 +167,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
debug_return_int(AUTH_INTR);
if ((s = auth_getvalue(as, "errormsg")) != NULL)
log_warning(NO_MAIL, "%s", s);
log_warningx(NO_MAIL, "%s", s);
debug_return_int(AUTH_FAILURE);
}