diff options
author | Andrew Morton <akpm@osdl.org> | 2004-01-18 18:38:22 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-18 18:38:22 -0800 |
commit | 605303cc340d482ef0ae7b4e3301733ab9e5de5d (patch) | |
tree | b757296eed426f72557df2c8d83358eefc54d340 /security | |
parent | da6e57a2e6bd7939f610d957afacaf6a131e75ed (diff) | |
download | history-605303cc340d482ef0ae7b4e3301733ab9e5de5d.tar.gz |
[PATCH] selinux: Add dname to audit output when a path cannot be generated.
From: James Morris <jmorris@redhat.com>
This patch adds dname to audit output when a path cannot be generated.
This makes analysis of SELinux audit logs easier.
Patch by Stephen Smalley <sds@epoch.ncsc.mil>.
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/avc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index b6c792db23efbc..bbe243cabb2df6 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -575,17 +575,26 @@ void avc_audit(u32 ssid, u32 tsid, break; case AVC_AUDIT_DATA_FS: if (a->u.fs.dentry) { + struct dentry *dentry = a->u.fs.dentry; if (a->u.fs.mnt) { - p = d_path(a->u.fs.dentry, + p = d_path(dentry, a->u.fs.mnt, avc_audit_buffer, PAGE_SIZE); if (p) printk(" path=%s", p); + } else { + printk(" name=%s", dentry->d_name.name); } - inode = a->u.fs.dentry->d_inode; + inode = dentry->d_inode; } else if (a->u.fs.inode) { + struct dentry *dentry; inode = a->u.fs.inode; + dentry = d_find_alias(inode); + if (dentry) { + printk(" name=%s", dentry->d_name.name); + dput(dentry); + } } if (inode) printk(" dev=%s ino=%ld", |