1 |
jpp |
1.1 |
diff -up sudo-1.8.6p3/plugins/sudoers/sudoers.c.auditeditor sudo-1.8.6p3/plugins/sudoers/sudoers.c |
2 |
|
|
--- sudo-1.8.6p3/plugins/sudoers/sudoers.c.auditeditor 2012-09-24 16:16:07.577331344 +0200 |
3 |
|
|
+++ sudo-1.8.6p3/plugins/sudoers/sudoers.c 2012-09-24 16:30:16.738174293 +0200 |
4 |
|
|
@@ -709,7 +709,24 @@ sudoers_policy_main(int argc, char * con |
5 |
|
|
#endif /* HAVE_SELINUX */ |
6 |
|
|
|
7 |
|
|
/* Must audit before uid change. */ |
8 |
|
|
- audit_success(NewArgv); |
9 |
|
|
+ if (ISSET(sudo_mode, MODE_EDIT)) { |
10 |
|
|
+ /* |
11 |
|
|
+ * Build a new argv, argc for the audit system |
12 |
|
|
+ * so that the editor being invoked is visible |
13 |
|
|
+ * in audit messages. |
14 |
|
|
+ */ |
15 |
|
|
+ char *editor = NULL; |
16 |
|
|
+ char **editor_argv = NULL; |
17 |
|
|
+ |
18 |
|
|
+ editor = find_editor(NewArgc - 1, NewArgv + 1, &editor_argv); |
19 |
|
|
+ |
20 |
|
|
+ if (editor) { |
21 |
|
|
+ audit_success(editor_argv); |
22 |
|
|
+ efree(editor_argv); |
23 |
|
|
+ } else |
24 |
|
|
+ errorx(1, _("Can't find an editor")); |
25 |
|
|
+ } else |
26 |
|
|
+ audit_success(NewArgv); |
27 |
|
|
|
28 |
|
|
*command_infop = command_info; |
29 |
|
|
|