summaryrefslogtreecommitdiff
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-05-08 10:32:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-04 10:57:03 -0800
commit3733596c40dc8ef2be53b2945e978373d86312c6 (patch)
treec4f24f3eb770afed5d4766fbbbfdd30a5339e802 /kernel/audit.c
parent1ec12a816c2312d55a51a0bcf8748e9c7049d015 (diff)
downloadlwn-3733596c40dc8ef2be53b2945e978373d86312c6.tar.gz
lwn-3733596c40dc8ef2be53b2945e978373d86312c6.zip
audit: log the audit_names record type
commit d3aea84a4ace5ff9ce7fb7714cee07bebef681c2 upstream. ...to make it clear what the intent behind each record's operation was. In many cases you can infer this, based on the context of the syscall and the result. In other cases it's not so obvious. For instance, in the case where you have a file being renamed over another, you'll have two different records with the same filename but different inode info. By logging this information we can clearly tell which one was created and which was deleted. This fixes what was broken in commit bfcec708. Commit 79f6530c should also be backported to stable v3.7+. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 34eeb48f9c34..7ddfd8a00a2a 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1537,6 +1537,26 @@ void audit_log_name(struct audit_context *context, struct audit_names *n,
}
}
+ /* log the audit_names record type */
+ audit_log_format(ab, " nametype=");
+ switch(n->type) {
+ case AUDIT_TYPE_NORMAL:
+ audit_log_format(ab, "NORMAL");
+ break;
+ case AUDIT_TYPE_PARENT:
+ audit_log_format(ab, "PARENT");
+ break;
+ case AUDIT_TYPE_CHILD_DELETE:
+ audit_log_format(ab, "DELETE");
+ break;
+ case AUDIT_TYPE_CHILD_CREATE:
+ audit_log_format(ab, "CREATE");
+ break;
+ default:
+ audit_log_format(ab, "UNKNOWN");
+ break;
+ }
+
audit_log_fcaps(ab, n);
audit_log_end(ab);
}