]> granicus.if.org Git - sudo/commitdiff
Restore line to set MODE_PRESERVE_ENV in flags when the -E command
authorTodd C. Miller <Todd.Miller@sudo.ws>
Wed, 28 Feb 2018 14:05:36 +0000 (07:05 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Wed, 28 Feb 2018 14:05:36 +0000 (07:05 -0700)
line option is used.  The caller doesn't check MODE_PRESERVE_ENV
these days but parse_args uses it to detect usage errors when -E
is used along with a mutually excusive option.  Problem found by
Yuriy Vostrikov.

src/parse_args.c

index f3e1a1289d951df7b37a7d30947adceded6cd597..d1f5e75b16a1d3044fa342fa3f9f999c255b0520 100644 (file)
@@ -337,6 +337,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv,
                        sudo_settings[ARG_PRESERVE_ENVIRONMENT].value = "true";
                    else
                        parse_env_list(&extra_env, optarg);
+                   SET(flags, MODE_PRESERVE_ENV);
                    break;
                case 'e':
                    if (mode && mode != MODE_EDIT)