diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-31 17:44:57 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-19 13:01:26 -0500 |
| commit | 9f45f5bf302daad6835ce64701fb3c286a2cc6af (patch) | |
| tree | f267e8363c8c9db15195f1698997179a1370687c /include/linux | |
| parent | 6f4e0d5aaa9efaa701f4c3c0bb9b22d7943157c9 (diff) | |
new helper: audit_file()
... for situations when we don't have any candidate in pathnames - basically,
in descriptor-based syscalls.
[Folded the build fix for !CONFIG_AUDITSYSCALL configs from Chen Gang]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/audit.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index e58fe7df8b9c..0c04917c2f12 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -130,6 +130,7 @@ extern void audit_putname(struct filename *name); | |||
| 130 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ | 130 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ |
| 131 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, | 131 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, |
| 132 | unsigned int flags); | 132 | unsigned int flags); |
| 133 | extern void __audit_file(const struct file *); | ||
| 133 | extern void __audit_inode_child(const struct inode *parent, | 134 | extern void __audit_inode_child(const struct inode *parent, |
| 134 | const struct dentry *dentry, | 135 | const struct dentry *dentry, |
| 135 | const unsigned char type); | 136 | const unsigned char type); |
| @@ -183,6 +184,11 @@ static inline void audit_inode(struct filename *name, | |||
| 183 | __audit_inode(name, dentry, flags); | 184 | __audit_inode(name, dentry, flags); |
| 184 | } | 185 | } |
| 185 | } | 186 | } |
| 187 | static inline void audit_file(struct file *file) | ||
| 188 | { | ||
| 189 | if (unlikely(!audit_dummy_context())) | ||
| 190 | __audit_file(file); | ||
| 191 | } | ||
| 186 | static inline void audit_inode_parent_hidden(struct filename *name, | 192 | static inline void audit_inode_parent_hidden(struct filename *name, |
| 187 | const struct dentry *dentry) | 193 | const struct dentry *dentry) |
| 188 | { | 194 | { |
| @@ -357,6 +363,9 @@ static inline void audit_inode(struct filename *name, | |||
| 357 | const struct dentry *dentry, | 363 | const struct dentry *dentry, |
| 358 | unsigned int parent) | 364 | unsigned int parent) |
| 359 | { } | 365 | { } |
| 366 | static inline void audit_file(struct file *file) | ||
| 367 | { | ||
| 368 | } | ||
| 360 | static inline void audit_inode_parent_hidden(struct filename *name, | 369 | static inline void audit_inode_parent_hidden(struct filename *name, |
| 361 | const struct dentry *dentry) | 370 | const struct dentry *dentry) |
| 362 | { } | 371 | { } |
