2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Add pam_askpass_service sudoers setting for "sudo -A".

This makes it possible to use a different PAM configuration for
when "sudo -A" is used.  The main use case is to only use PAM modules
that can interact with the askpass program.  GitHub issue #112.
This commit is contained in:
Todd C. Miller
2022-01-08 11:35:03 -07:00
parent 763256e464
commit 48bc498a6f
9 changed files with 132 additions and 76 deletions

View File

@@ -104,7 +104,9 @@ static struct sudo_settings sudo_settings[] = {
{ "cmnd_chroot" },
#define ARG_CWD 24
{ "cmnd_cwd" },
#define NUM_SETTINGS 25
#define ARG_ASKPASS 25
{ "askpass" },
#define NUM_SETTINGS 26
{ NULL }
};
@@ -301,7 +303,6 @@ parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
/* Space for environment variables is lazy allocated. */
memset(&extra_env, 0, sizeof(extra_env));
/* XXX - should fill in settings at the end to avoid dupes */
for (;;) {
/*
* Some trickiness is required to allow environment variables
@@ -311,6 +312,7 @@ parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
switch (ch) {
case 'A':
SET(tgetpass_flags, TGP_ASKPASS);
sudo_settings[ARG_ASKPASS].value = "true";
break;
#ifdef HAVE_BSD_AUTH_H
case 'a':