diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-06-07 12:19:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2007-10-21 02:37:18 -0400 |
commit | 5a190ae69766da9a34bf31200c5cea4c0667cf94 (patch) | |
tree | 340c500fe42518abe6d1159a00619b1bd02f07fc /kernel/auditsc.c | |
parent | cfa76f024f7c9e65169425804e5b32e71f66d0ee (diff) |
[PATCH] pass dentry to audit_inode()/audit_inode_child()
makes caller simpler *and* allows to scan ancestors
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index e19b5a33aede..8a85c203be12 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1403,10 +1403,11 @@ static void audit_copy_inode(struct audit_names *name, const struct inode *inode | |||
1403 | * | 1403 | * |
1404 | * Called from fs/namei.c:path_lookup(). | 1404 | * Called from fs/namei.c:path_lookup(). |
1405 | */ | 1405 | */ |
1406 | void __audit_inode(const char *name, const struct inode *inode) | 1406 | void __audit_inode(const char *name, const struct dentry *dentry) |
1407 | { | 1407 | { |
1408 | int idx; | 1408 | int idx; |
1409 | struct audit_context *context = current->audit_context; | 1409 | struct audit_context *context = current->audit_context; |
1410 | const struct inode *inode = inode = dentry->d_inode; | ||
1410 | 1411 | ||
1411 | if (!context->in_syscall) | 1412 | if (!context->in_syscall) |
1412 | return; | 1413 | return; |
@@ -1443,12 +1444,13 @@ void __audit_inode(const char *name, const struct inode *inode) | |||
1443 | * must be hooked prior, in order to capture the target inode during | 1444 | * must be hooked prior, in order to capture the target inode during |
1444 | * unsuccessful attempts. | 1445 | * unsuccessful attempts. |
1445 | */ | 1446 | */ |
1446 | void __audit_inode_child(const char *dname, const struct inode *inode, | 1447 | void __audit_inode_child(const char *dname, const struct dentry *dentry, |
1447 | const struct inode *parent) | 1448 | const struct inode *parent) |
1448 | { | 1449 | { |
1449 | int idx; | 1450 | int idx; |
1450 | struct audit_context *context = current->audit_context; | 1451 | struct audit_context *context = current->audit_context; |
1451 | const char *found_parent = NULL, *found_child = NULL; | 1452 | const char *found_parent = NULL, *found_child = NULL; |
1453 | const struct inode *inode = dentry->d_inode; | ||
1452 | int dirlen = 0; | 1454 | int dirlen = 0; |
1453 | 1455 | ||
1454 | if (!context->in_syscall) | 1456 | if (!context->in_syscall) |