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>

authored by Eric Paris and committed by Al Viro def57543 679173b7

+3 -3
+2 -2
kernel/audit.c
··· 1440 /* We will allow 11 spaces for ' (deleted)' to be appended */ 1441 pathname = kmalloc(PATH_MAX+11, ab->gfp_mask); 1442 if (!pathname) { 1443 - audit_log_format(ab, "<no memory>"); 1444 return; 1445 } 1446 p = d_path(path, pathname, PATH_MAX+11); 1447 if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */ 1448 /* FIXME: can we save some information here? */ 1449 - audit_log_format(ab, "<too long>"); 1450 } else 1451 audit_log_untrustedstring(ab, p); 1452 kfree(pathname);
··· 1440 /* We will allow 11 spaces for ' (deleted)' to be appended */ 1441 pathname = kmalloc(PATH_MAX+11, ab->gfp_mask); 1442 if (!pathname) { 1443 + audit_log_string(ab, "<no_memory>"); 1444 return; 1445 } 1446 p = d_path(path, pathname, PATH_MAX+11); 1447 if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */ 1448 /* FIXME: can we save some information here? */ 1449 + audit_log_string(ab, "<too_long>"); 1450 } else 1451 audit_log_untrustedstring(ab, p); 1452 kfree(pathname);
+1 -1
kernel/auditsc.c
··· 1478 case 0: 1479 /* name was specified as a relative path and the 1480 * directory component is the cwd */ 1481 - audit_log_d_path(ab, " name=", &context->pwd); 1482 break; 1483 default: 1484 /* log the name's directory component */
··· 1478 case 0: 1479 /* name was specified as a relative path and the 1480 * directory component is the cwd */ 1481 + audit_log_d_path(ab, "name=", &context->pwd); 1482 break; 1483 default: 1484 /* log the name's directory component */