]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Audit: remove spaces from audit_log_d_path
authorEric Paris <eparis@redhat.com>
Tue, 10 Mar 2009 22:00:14 +0000 (18:00 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 5 Apr 2009 17:49:04 +0000 (13:49 -0400)
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>
kernel/audit.c
kernel/auditsc.c

index 5560390cb0f5eec2d630144f8b4419974795c297..9442c3533ba9f8be398333d8ee7b74882b339ae0 100644 (file)
@@ -1440,13 +1440,13 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix,
        /* We will allow 11 spaces for ' (deleted)' to be appended */
        pathname = kmalloc(PATH_MAX+11, ab->gfp_mask);
        if (!pathname) {
-               audit_log_format(ab, "<no memory>");
+               audit_log_string(ab, "<no_memory>");
                return;
        }
        p = d_path(path, pathname, PATH_MAX+11);
        if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */
                /* FIXME: can we save some information here? */
-               audit_log_format(ab, "<too long>");
+               audit_log_string(ab, "<too_long>");
        } else
                audit_log_untrustedstring(ab, p);
        kfree(pathname);
index aa0428e08367101c535df871a85971ddddd7bb6c..7d6ac7c1f414479ada4a58af0c4b9e241051062e 100644 (file)
@@ -1478,7 +1478,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
                        case 0:
                                /* name was specified as a relative path and the
                                 * directory component is the cwd */
-                               audit_log_d_path(ab, " name=", &context->pwd);
+                               audit_log_d_path(ab, "name=", &context->pwd);
                                break;
                        default:
                                /* log the name's directory component */