Enable passprompt_override by default if SUDO_PROMPT is present in
the environment. This is consistent with how "sudo -p prompt" is handled.
This commit is contained in:
@@ -693,10 +693,12 @@ init_vars(char * const envp[])
|
|||||||
user_path = *ep + 5;
|
user_path = *ep + 5;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (!user_prompt && strncmp("SUDO_PROMPT=", *ep, 12) == 0)
|
if (!user_prompt && strncmp("SUDO_PROMPT=", *ep, 12) == 0) {
|
||||||
user_prompt = *ep + 12;
|
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;
|
prev_user = *ep + 10;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user