diff options
author | Eric Paris <eparis@redhat.com> | 2009-03-10 18:00:14 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-04-05 13:49:04 -0400 |
commit | def57543418a5f47debae28a0a9dea2effc11692 (patch) | |
tree | 9f27756c75502f6331c5c4260f36779a7b9555bc /kernel | |
parent | 679173b724631f49e537a15fa48ea2000bdc1808 (diff) |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 4 | ||||
-rw-r--r-- | kernel/auditsc.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 5560390cb0f5..9442c3533ba9 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -1440,13 +1440,13 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix, | |||
1440 | /* We will allow 11 spaces for ' (deleted)' to be appended */ | 1440 | /* We will allow 11 spaces for ' (deleted)' to be appended */ |
1441 | pathname = kmalloc(PATH_MAX+11, ab->gfp_mask); | 1441 | pathname = kmalloc(PATH_MAX+11, ab->gfp_mask); |
1442 | if (!pathname) { | 1442 | if (!pathname) { |
1443 | audit_log_format(ab, "<no memory>"); | 1443 | audit_log_string(ab, "<no_memory>"); |
1444 | return; | 1444 | return; |
1445 | } | 1445 | } |
1446 | p = d_path(path, pathname, PATH_MAX+11); | 1446 | p = d_path(path, pathname, PATH_MAX+11); |
1447 | if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */ | 1447 | if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */ |
1448 | /* FIXME: can we save some information here? */ | 1448 | /* FIXME: can we save some information here? */ |
1449 | audit_log_format(ab, "<too long>"); | 1449 | audit_log_string(ab, "<too_long>"); |
1450 | } else | 1450 | } else |
1451 | audit_log_untrustedstring(ab, p); | 1451 | audit_log_untrustedstring(ab, p); |
1452 | kfree(pathname); | 1452 | kfree(pathname); |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index aa0428e08367..7d6ac7c1f414 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1478,7 +1478,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
1478 | case 0: | 1478 | case 0: |
1479 | /* name was specified as a relative path and the | 1479 | /* name was specified as a relative path and the |
1480 | * directory component is the cwd */ | 1480 | * directory component is the cwd */ |
1481 | audit_log_d_path(ab, " name=", &context->pwd); | 1481 | audit_log_d_path(ab, "name=", &context->pwd); |
1482 | break; | 1482 | break; |
1483 | default: | 1483 | default: |
1484 | /* log the name's directory component */ | 1484 | /* log the name's directory component */ |