From: Todd C. Miller Date: Thu, 20 Jul 2017 17:40:49 +0000 (-0600) Subject: Enable passprompt_override by default if SUDO_PROMPT is present in X-Git-Tag: SUDO_1_8_21^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37f591d2dd5c05ef4308b9891cd3b5cca2e4d971;p=sudo Enable passprompt_override by default if SUDO_PROMPT is present in the environment. This is consistent with how "sudo -p prompt" is handled. --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 62fd8bd4c..f7f62bcda 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -693,10 +693,12 @@ init_vars(char * const envp[]) user_path = *ep + 5; break; case 'S': - if (!user_prompt && strncmp("SUDO_PROMPT=", *ep, 12) == 0) + if (!user_prompt && strncmp("SUDO_PROMPT=", *ep, 12) == 0) { user_prompt = *ep + 12; - else if (strncmp("SUDO_USER=", *ep, 10) == 0) + def_passprompt_override = true; + } else if (strncmp("SUDO_USER=", *ep, 10) == 0) { prev_user = *ep + 10; + } break; } }