aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-07-13 13:16:39 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-08-03 10:50:30 -0400
commit73d3ec5abad3f1730ac8530899d2c14d92f3ad63 (patch)
treec2829a1e36ca155eecc7d4b8648fe9755247bec5 /include
parent3e2efce067cec0099f99ae59f28feda99b02b498 (diff)
[PATCH] fix missed create event for directory audit
When an object is created via a symlink into an audited directory, audit misses the event due to not having collected the inode data for the directory. Modify __audit_inode_child() to copy the parent inode data if a parent wasn't found in audit_names[]. Signed-off-by: Amy Griffis <amy.griffis@hp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/audit.h8
-rw-r--r--include/linux/fsnotify.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index e7e5e5348987..bf196c05826c 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -327,7 +327,7 @@ extern void __audit_getname(const char *name);
327extern void audit_putname(const char *name); 327extern void audit_putname(const char *name);
328extern void __audit_inode(const char *name, const struct inode *inode); 328extern void __audit_inode(const char *name, const struct inode *inode);
329extern void __audit_inode_child(const char *dname, const struct inode *inode, 329extern void __audit_inode_child(const char *dname, const struct inode *inode,
330 unsigned long pino); 330 const struct inode *parent);
331extern void __audit_inode_update(const struct inode *inode); 331extern void __audit_inode_update(const struct inode *inode);
332static inline void audit_getname(const char *name) 332static inline void audit_getname(const char *name)
333{ 333{
@@ -339,10 +339,10 @@ static inline void audit_inode(const char *name, const struct inode *inode) {
339 __audit_inode(name, inode); 339 __audit_inode(name, inode);
340} 340}
341static inline void audit_inode_child(const char *dname, 341static inline void audit_inode_child(const char *dname,
342 const struct inode *inode, 342 const struct inode *inode,
343 unsigned long pino) { 343 const struct inode *parent) {
344 if (unlikely(current->audit_context)) 344 if (unlikely(current->audit_context))
345 __audit_inode_child(dname, inode, pino); 345 __audit_inode_child(dname, inode, parent);
346} 346}
347static inline void audit_inode_update(const struct inode *inode) { 347static inline void audit_inode_update(const struct inode *inode) {
348 if (unlikely(current->audit_context)) 348 if (unlikely(current->audit_context))
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index cc5dec70c32c..d4f219ffaa5d 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -67,7 +67,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
67 if (source) { 67 if (source) {
68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); 68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
69 } 69 }
70 audit_inode_child(new_name, source, new_dir->i_ino); 70 audit_inode_child(new_name, source, new_dir);
71} 71}
72 72
73/* 73/*
@@ -98,7 +98,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
98 inode_dir_notify(inode, DN_CREATE); 98 inode_dir_notify(inode, DN_CREATE);
99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, 99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode); 100 dentry->d_inode);
101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
102} 102}
103 103
104/* 104/*
@@ -109,7 +109,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
109 inode_dir_notify(inode, DN_CREATE); 109 inode_dir_notify(inode, DN_CREATE);
110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
111 dentry->d_name.name, dentry->d_inode); 111 dentry->d_name.name, dentry->d_inode);
112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
113} 113}
114 114
115/* 115/*