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:
@@ -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':
|
||||
|
Reference in New Issue
Block a user