Skip to content

Commit def5754

Browse files
eparisAl Viro
authored andcommitted
Audit: remove spaces from audit_log_d_path
audit_log_d_path had spaces in the strings which would be emitted on the error paths. This patch simply replaces those spaces with an _ or removes the needless spaces entirely. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 679173b commit def5754

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎kernel/audit.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,13 +1440,13 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix,
14401440
/* We will allow 11 spaces for ' (deleted)' to be appended */
14411441
pathname = kmalloc(PATH_MAX+11, ab->gfp_mask);
14421442
if (!pathname) {
1443-
audit_log_format(ab, "<no memory>");
1443+
audit_log_string(ab, "<no_memory>");
14441444
return;
14451445
}
14461446
p = d_path(path, pathname, PATH_MAX+11);
14471447
if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */
14481448
/* FIXME: can we save some information here? */
1449-
audit_log_format(ab, "<too long>");
1449+
audit_log_string(ab, "<too_long>");
14501450
} else
14511451
audit_log_untrustedstring(ab, p);
14521452
kfree(pathname);

‎kernel/auditsc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
14781478
case 0:
14791479
/* name was specified as a relative path and the
14801480
* directory component is the cwd */
1481-
audit_log_d_path(ab, " name=", &context->pwd);
1481+
audit_log_d_path(ab, "name=", &context->pwd);
14821482
break;
14831483
default:
14841484
/* log the name's directory component */

0 commit comments

Comments
 (0)