Remove the NO_EXIT flag to log_error() and add a log_fatal() function
that exits and is marked no_return. Fixes false positives from static analyzers and is easier for humans to read too.
This commit is contained in:
@@ -114,7 +114,7 @@ sudo_auth_init(struct passwd *pw)
|
||||
standalone = IS_STANDALONE(&auth_switch[0]);
|
||||
if (standalone && auth_switch[1].name != NULL) {
|
||||
audit_failure(NewArgv, "invalid authentication methods");
|
||||
log_error(0, _("Invalid authentication methods compiled into sudo! "
|
||||
log_fatal(0, _("Invalid authentication methods compiled into sudo! "
|
||||
"You may mix standalone and non-standalone authentication."));
|
||||
debug_return_int(-1);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ verify_user(struct passwd *pw, char *prompt)
|
||||
/* XXX - check FLAG_DISABLED too */
|
||||
if (auth_switch[0].name == NULL) {
|
||||
audit_failure(NewArgv, "no authentication methods");
|
||||
log_error(0,
|
||||
log_fatal(0,
|
||||
_("There are no authentication methods compiled into sudo! "
|
||||
"If you want to turn off authentication, use the "
|
||||
"--disable-authentication configure option."));
|
||||
@@ -268,7 +268,7 @@ done:
|
||||
flags = 0;
|
||||
else
|
||||
flags = NO_MAIL;
|
||||
log_error(flags, ngettext("%d incorrect password attempt",
|
||||
log_fatal(flags, ngettext("%d incorrect password attempt",
|
||||
"%d incorrect password attempts",
|
||||
def_passwd_tries - counter), def_passwd_tries - counter);
|
||||
}
|
||||
|
Reference in New Issue
Block a user