Blame SOURCES/sudo-1.8.6p3-auditeditor.patch

1b092f
diff -up sudo-1.8.6p3/plugins/sudoers/sudoers.c.auditeditor sudo-1.8.6p3/plugins/sudoers/sudoers.c
1b092f
--- sudo-1.8.6p3/plugins/sudoers/sudoers.c.auditeditor	2012-09-24 16:16:07.577331344 +0200
1b092f
+++ sudo-1.8.6p3/plugins/sudoers/sudoers.c	2012-09-24 16:30:16.738174293 +0200
1b092f
@@ -709,7 +709,24 @@ sudoers_policy_main(int argc, char * con
1b092f
 #endif /* HAVE_SELINUX */
1b092f
 
1b092f
     /* Must audit before uid change. */
1b092f
-    audit_success(NewArgv);
1b092f
+    if (ISSET(sudo_mode, MODE_EDIT)) {
1b092f
+        /*
1b092f
+        * Build a new argv, argc for the audit system
1b092f
+        * so that the editor being invoked is visible
1b092f
+        * in audit messages.
1b092f
+        */
1b092f
+        char  *editor = NULL;
1b092f
+        char **editor_argv = NULL;
1b092f
+
1b092f
+        editor = find_editor(NewArgc - 1, NewArgv + 1, &editor_argv);
1b092f
+
1b092f
+        if (editor) {
1b092f
+            audit_success(editor_argv);
1b092f
+            efree(editor_argv);
1b092f
+        } else
1b092f
+            errorx(1, _("Can't find an editor"));
1b092f
+    } else
1b092f
+        audit_success(NewArgv);
1b092f
 
1b092f
     *command_infop = command_info;
1b092f