1 |
diff -up sudo-1.8.6p7/plugins/sudoers/sudoers.c.closefrom-override-fix sudo-1.8.6p7/plugins/sudoers/sudoers.c |
2 |
--- sudo-1.8.6p7/plugins/sudoers/sudoers.c.closefrom-override-fix 2016-02-15 10:31:11.694164366 +0100 |
3 |
+++ sudo-1.8.6p7/plugins/sudoers/sudoers.c 2016-02-15 10:33:47.711362062 +0100 |
4 |
@@ -336,15 +336,6 @@ sudoers_policy_main(int argc, char * con |
5 |
goto bad; |
6 |
} |
7 |
|
8 |
- /* Check for -C overriding def_closefrom. */ |
9 |
- if (user_closefrom >= 0 && user_closefrom != def_closefrom) { |
10 |
- if (!def_closefrom_override) { |
11 |
- warningx(_("you are not permitted to use the -C option")); |
12 |
- goto bad; |
13 |
- } |
14 |
- def_closefrom = user_closefrom; |
15 |
- } |
16 |
- |
17 |
set_perms(PERM_INITIAL); |
18 |
|
19 |
/* Environment variables specified on the command line. */ |
20 |
@@ -374,8 +365,17 @@ sudoers_policy_main(int argc, char * con |
21 |
if (ISSET(sudo_mode, MODE_PRESERVE_GROUPS)) |
22 |
def_preserve_groups = true; |
23 |
|
24 |
- /* Find command in path */ |
25 |
+ /* Find command in path and apply per-command Defaults. */ |
26 |
cmnd_status = set_cmnd(); |
27 |
+ |
28 |
+ /* Check for -C overriding def_closefrom. */ |
29 |
+ if (user_closefrom >= 0 && user_closefrom != def_closefrom) { |
30 |
+ if (!def_closefrom_override) { |
31 |
+ warningx(_("you are not permitted to use the -C option")); |
32 |
+ goto bad; |
33 |
+ } |
34 |
+ def_closefrom = user_closefrom; |
35 |
+ } |
36 |
|
37 |
#ifdef HAVE_SETLOCALE |
38 |
if (!setlocale(LC_ALL, def_sudoers_locale)) { |