From 41057347437327a14c258aed3d49404188848bbe Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 26 Sep 2014 20:39:40 -0600 Subject: [PATCH] Move pass_warn() so that it is defined before it is called(). --- plugins/sudoers/auth/sudo_auth.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) 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) { -- 2.40.0