Blob Blame History Raw
diff -urp audit-1.7.2/lib/audit_logging.c audit-1.7.3/lib/audit_logging.c
--- audit-1.7.2/lib/audit_logging.c	2008-04-01 12:25:33.000000000 -0400
+++ audit-1.7.3/lib/audit_logging.c	2008-04-11 17:07:24.000000000 -0400
@@ -633,7 +633,6 @@ int audit_log_user_command(int audit_fd,
 	// We borrow the commname buffer
 	if (getcwd(commname, PATH_MAX) == NULL)
 		strcpy(commname, "?");
-	strcpy(cwdname, commname);
 	p = commname;
 	len = strlen(commname);
 	while (*p) {
@@ -644,6 +643,8 @@ int audit_log_user_command(int audit_fd,
 		}
 		p++;
 	}
+	if (cwdenc == 0)
+		strcpy(cwdname, commname);
 
 	len = strlen(cmd);
 	// Trim the trailing carriage return and spaces
@@ -665,6 +666,8 @@ int audit_log_user_command(int audit_fd,
 		}
 		p++;
 	}
+	if (cmdenc == 0)
+		strcpy(commname, cmd);
 	free(cmd);
 
 	// Make the format string