From: Todd C. Miller Date: Sat, 28 Aug 1999 09:50:27 +0000 (+0000) Subject: add check for case where there are no auth methods X-Git-Tag: SUDO_1_6_0~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba31293c29aad94d3e5ecefb1ba950bcaaf64db7;p=sudo add check for case where there are no auth methods --- diff --git a/auth/sudo_auth.c b/auth/sudo_auth.c index 6dc578506..5775534ca 100644 --- a/auth/sudo_auth.c +++ b/auth/sudo_auth.c @@ -103,8 +103,15 @@ verify_user() char *p; sudo_auth *auth; - /* Set FLAG_ONEANDONLY if there is only one auth method. */ - if (auth_switch[0].name && !auth_switch[1].name) + /* Make sure we have at least one auth method. */ + if (auth_switch[0].name == NULL) + log_error(0, "%s %s %s", + "There are no authentication methods compiled into sudo!", + "If you want to turn off authentication, use the", + "--disable-authentication configure option."); + + /* Set FLAG_ONEANDONLY if there is only one auth method. */ + if (auth_switch[1].name == NULL) auth_switch[0].flags |= FLAG_ONEANDONLY; /* Initialize auth methods and unconfigure the method if necessary. */