forked from Minki/linux
audit_inode(): switch to passing AUDIT_INODE_...
don't bother with remapping LOOKUP_... values - all callers pass constants and we can just as well pass the right ones from the very beginning. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
39145f5f0c
commit
c9b07eab0c
@ -2391,7 +2391,7 @@ static struct filename *filename_parentat(int dfd, struct filename *name,
|
|||||||
if (likely(!retval)) {
|
if (likely(!retval)) {
|
||||||
*last = nd.last;
|
*last = nd.last;
|
||||||
*type = nd.last_type;
|
*type = nd.last_type;
|
||||||
audit_inode(name, parent->dentry, LOOKUP_PARENT);
|
audit_inode(name, parent->dentry, AUDIT_INODE_PARENT);
|
||||||
} else {
|
} else {
|
||||||
putname(name);
|
putname(name);
|
||||||
name = ERR_PTR(retval);
|
name = ERR_PTR(retval);
|
||||||
@ -2718,7 +2718,7 @@ filename_mountpoint(int dfd, struct filename *name, struct path *path,
|
|||||||
if (unlikely(error == -ESTALE))
|
if (unlikely(error == -ESTALE))
|
||||||
error = path_mountpoint(&nd, flags | LOOKUP_REVAL, path);
|
error = path_mountpoint(&nd, flags | LOOKUP_REVAL, path);
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
audit_inode(name, path->dentry, LOOKUP_NO_EVAL);
|
audit_inode(name, path->dentry, AUDIT_INODE_NOEVAL);
|
||||||
restore_nameidata();
|
restore_nameidata();
|
||||||
putname(name);
|
putname(name);
|
||||||
return error;
|
return error;
|
||||||
@ -3299,7 +3299,7 @@ static int do_last(struct nameidata *nd,
|
|||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
audit_inode(nd->name, dir, LOOKUP_PARENT);
|
audit_inode(nd->name, dir, AUDIT_INODE_PARENT);
|
||||||
/* trailing slashes? */
|
/* trailing slashes? */
|
||||||
if (unlikely(nd->last.name[nd->last.len]))
|
if (unlikely(nd->last.name[nd->last.len]))
|
||||||
return -EISDIR;
|
return -EISDIR;
|
||||||
|
@ -252,6 +252,10 @@ static inline int audit_signal_info(int sig, struct task_struct *t)
|
|||||||
#define audit_is_compat(arch) false
|
#define audit_is_compat(arch) false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
|
||||||
|
#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
|
||||||
|
#define AUDIT_INODE_NOEVAL 4 /* audit record incomplete */
|
||||||
|
|
||||||
#ifdef CONFIG_AUDITSYSCALL
|
#ifdef CONFIG_AUDITSYSCALL
|
||||||
#include <asm/syscall.h> /* for syscall_get_arch() */
|
#include <asm/syscall.h> /* for syscall_get_arch() */
|
||||||
|
|
||||||
@ -265,9 +269,6 @@ extern void __audit_syscall_exit(int ret_success, long ret_value);
|
|||||||
extern struct filename *__audit_reusename(const __user char *uptr);
|
extern struct filename *__audit_reusename(const __user char *uptr);
|
||||||
extern void __audit_getname(struct filename *name);
|
extern void __audit_getname(struct filename *name);
|
||||||
|
|
||||||
#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
|
|
||||||
#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
|
|
||||||
#define AUDIT_INODE_NOEVAL 4 /* audit record incomplete */
|
|
||||||
extern void __audit_inode(struct filename *name, const struct dentry *dentry,
|
extern void __audit_inode(struct filename *name, const struct dentry *dentry,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
extern void __audit_file(const struct file *);
|
extern void __audit_file(const struct file *);
|
||||||
@ -328,16 +329,9 @@ static inline void audit_getname(struct filename *name)
|
|||||||
}
|
}
|
||||||
static inline void audit_inode(struct filename *name,
|
static inline void audit_inode(struct filename *name,
|
||||||
const struct dentry *dentry,
|
const struct dentry *dentry,
|
||||||
unsigned int flags) {
|
unsigned int aflags) {
|
||||||
if (unlikely(!audit_dummy_context())) {
|
if (unlikely(!audit_dummy_context()))
|
||||||
unsigned int aflags = 0;
|
|
||||||
|
|
||||||
if (flags & LOOKUP_PARENT)
|
|
||||||
aflags |= AUDIT_INODE_PARENT;
|
|
||||||
if (flags & LOOKUP_NO_EVAL)
|
|
||||||
aflags |= AUDIT_INODE_NOEVAL;
|
|
||||||
__audit_inode(name, dentry, aflags);
|
__audit_inode(name, dentry, aflags);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
static inline void audit_file(struct file *file)
|
static inline void audit_file(struct file *file)
|
||||||
{
|
{
|
||||||
@ -561,7 +555,7 @@ static inline void __audit_inode_child(struct inode *parent,
|
|||||||
{ }
|
{ }
|
||||||
static inline void audit_inode(struct filename *name,
|
static inline void audit_inode(struct filename *name,
|
||||||
const struct dentry *dentry,
|
const struct dentry *dentry,
|
||||||
unsigned int parent)
|
unsigned int aflags)
|
||||||
{ }
|
{ }
|
||||||
static inline void audit_file(struct file *file)
|
static inline void audit_file(struct file *file)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user