From: Todd C. Miller Date: Sat, 27 Sep 2014 02:39:40 +0000 (-0600) Subject: Move pass_warn() so that it is defined before it is called(). X-Git-Tag: SUDO_1_8_12^2~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41057347437327a14c258aed3d49404188848bbe;p=sudo Move pass_warn() so that it is defined before it is called(). --- diff --git a/plugins/sudoers/auth/sudo_auth.c b/plugins/sudoers/auth/sudo_auth.c index 42ef9dd70..adae8a76b 100644 --- a/plugins/sudoers/auth/sudo_auth.c +++ b/plugins/sudoers/auth/sudo_auth.c @@ -95,8 +95,6 @@ static sudo_auth auth_switch[] = { static int standalone; -static void pass_warn(void); - /* * Initialize sudoers authentication method(s). * Returns 0 on success and -1 on error. @@ -161,6 +159,21 @@ sudo_auth_cleanup(struct passwd *pw) debug_return_int(status == AUTH_FATAL ? -1 : 0); } +static void +pass_warn(void) +{ + const char *warning = def_badpass_message; + debug_decl(pass_warn, SUDO_DEBUG_AUTH) + +#ifdef INSULT + if (def_insults) + warning = INSULT; +#endif + sudo_printf(SUDO_CONV_ERROR_MSG, "%s\n", warning); + + debug_return; +} + /* * Verify the specified user. * Returns true if verified, false if not or -1 on error. @@ -310,21 +323,6 @@ sudo_auth_end_session(struct passwd *pw) debug_return_int(status == AUTH_FATAL ? -1 : 1); } -static void -pass_warn(void) -{ - const char *warning = def_badpass_message; - debug_decl(pass_warn, SUDO_DEBUG_AUTH) - -#ifdef INSULT - if (def_insults) - warning = INSULT; -#endif - sudo_printf(SUDO_CONV_ERROR_MSG, "%s\n", warning); - - debug_return; -} - char * auth_getpass(const char *prompt, int timeout, int type) {