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 /include | |
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 'include')
-rw-r--r-- | include/linux/audit.h | 16 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 9 |
2 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 9ae740936a65..133b81be60a3 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -366,8 +366,8 @@ extern void audit_syscall_entry(int arch, | |||
366 | extern void audit_syscall_exit(int failed, long return_code); | 366 | extern void audit_syscall_exit(int failed, long return_code); |
367 | extern void __audit_getname(const char *name); | 367 | extern void __audit_getname(const char *name); |
368 | extern void audit_putname(const char *name); | 368 | extern void audit_putname(const char *name); |
369 | extern void __audit_inode(const char *name, const struct inode *inode); | 369 | extern void __audit_inode(const char *name, const struct dentry *dentry); |
370 | extern void __audit_inode_child(const char *dname, const struct inode *inode, | 370 | extern void __audit_inode_child(const char *dname, const struct dentry *dentry, |
371 | const struct inode *parent); | 371 | const struct inode *parent); |
372 | extern void __audit_ptrace(struct task_struct *t); | 372 | extern void __audit_ptrace(struct task_struct *t); |
373 | 373 | ||
@@ -381,15 +381,15 @@ static inline void audit_getname(const char *name) | |||
381 | if (unlikely(!audit_dummy_context())) | 381 | if (unlikely(!audit_dummy_context())) |
382 | __audit_getname(name); | 382 | __audit_getname(name); |
383 | } | 383 | } |
384 | static inline void audit_inode(const char *name, const struct inode *inode) { | 384 | static inline void audit_inode(const char *name, const struct dentry *dentry) { |
385 | if (unlikely(!audit_dummy_context())) | 385 | if (unlikely(!audit_dummy_context())) |
386 | __audit_inode(name, inode); | 386 | __audit_inode(name, dentry); |
387 | } | 387 | } |
388 | static inline void audit_inode_child(const char *dname, | 388 | static inline void audit_inode_child(const char *dname, |
389 | const struct inode *inode, | 389 | const struct dentry *dentry, |
390 | const struct inode *parent) { | 390 | const struct inode *parent) { |
391 | if (unlikely(!audit_dummy_context())) | 391 | if (unlikely(!audit_dummy_context())) |
392 | __audit_inode_child(dname, inode, parent); | 392 | __audit_inode_child(dname, dentry, parent); |
393 | } | 393 | } |
394 | void audit_core_dumps(long signr); | 394 | void audit_core_dumps(long signr); |
395 | 395 | ||
@@ -477,9 +477,9 @@ extern int audit_signals; | |||
477 | #define audit_dummy_context() 1 | 477 | #define audit_dummy_context() 1 |
478 | #define audit_getname(n) do { ; } while (0) | 478 | #define audit_getname(n) do { ; } while (0) |
479 | #define audit_putname(n) do { ; } while (0) | 479 | #define audit_putname(n) do { ; } while (0) |
480 | #define __audit_inode(n,i) do { ; } while (0) | 480 | #define __audit_inode(n,d) do { ; } while (0) |
481 | #define __audit_inode_child(d,i,p) do { ; } while (0) | 481 | #define __audit_inode_child(d,i,p) do { ; } while (0) |
482 | #define audit_inode(n,i) do { ; } while (0) | 482 | #define audit_inode(n,d) do { ; } while (0) |
483 | #define audit_inode_child(d,i,p) do { ; } while (0) | 483 | #define audit_inode_child(d,i,p) do { ; } while (0) |
484 | #define audit_core_dumps(i) do { ; } while (0) | 484 | #define audit_core_dumps(i) do { ; } while (0) |
485 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | 485 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index dfc4e4f68da4..2bd31fa623b6 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -41,8 +41,9 @@ static inline void fsnotify_d_move(struct dentry *entry) | |||
41 | */ | 41 | */ |
42 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 42 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
43 | const char *old_name, const char *new_name, | 43 | const char *old_name, const char *new_name, |
44 | int isdir, struct inode *target, struct inode *source) | 44 | int isdir, struct inode *target, struct dentry *moved) |
45 | { | 45 | { |
46 | struct inode *source = moved->d_inode; | ||
46 | u32 cookie = inotify_get_cookie(); | 47 | u32 cookie = inotify_get_cookie(); |
47 | 48 | ||
48 | if (old_dir == new_dir) | 49 | if (old_dir == new_dir) |
@@ -67,7 +68,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
67 | if (source) { | 68 | if (source) { |
68 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); | 69 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); |
69 | } | 70 | } |
70 | audit_inode_child(new_name, source, new_dir); | 71 | audit_inode_child(new_name, moved, new_dir); |
71 | } | 72 | } |
72 | 73 | ||
73 | /* | 74 | /* |
@@ -98,7 +99,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
98 | inode_dir_notify(inode, DN_CREATE); | 99 | inode_dir_notify(inode, DN_CREATE); |
99 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, | 100 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, |
100 | dentry->d_inode); | 101 | dentry->d_inode); |
101 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode); | 102 | audit_inode_child(dentry->d_name.name, dentry, inode); |
102 | } | 103 | } |
103 | 104 | ||
104 | /* | 105 | /* |
@@ -109,7 +110,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
109 | inode_dir_notify(inode, DN_CREATE); | 110 | inode_dir_notify(inode, DN_CREATE); |
110 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, | 111 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, |
111 | dentry->d_name.name, dentry->d_inode); | 112 | dentry->d_name.name, dentry->d_inode); |
112 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode); | 113 | audit_inode_child(dentry->d_name.name, dentry, inode); |
113 | } | 114 | } |
114 | 115 | ||
115 | /* | 116 | /* |