diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-10-10 15:25:25 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-12 00:32:02 -0400 |
commit | e3d6b07b8ba161f638b026feba0c3c97875d7f1c (patch) | |
tree | d40cea06665f9092820d76948d38e329c178011b /kernel/audit.h | |
parent | 29e9a3467c1367549568d7d411d5f30209ae181b (diff) |
audit: optimize audit_compare_dname_path
In the cases where we already know the length of the parent, pass it as
a parm so we don't need to recompute it. In the cases where we don't
know the length, pass in AUDIT_NAME_FULL (-1) to indicate that it should
be determined.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/audit.h')
-rw-r--r-- | kernel/audit.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/audit.h b/kernel/audit.h index 1038e23eb61c..d51cba868e1b 100644 --- a/kernel/audit.h +++ b/kernel/audit.h | |||
@@ -74,12 +74,15 @@ static inline int audit_hash_ino(u32 ino) | |||
74 | return (ino & (AUDIT_INODE_BUCKETS-1)); | 74 | return (ino & (AUDIT_INODE_BUCKETS-1)); |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Indicates that audit should log the full pathname. */ | ||
78 | #define AUDIT_NAME_FULL -1 | ||
79 | |||
77 | extern int audit_match_class(int class, unsigned syscall); | 80 | extern int audit_match_class(int class, unsigned syscall); |
78 | extern int audit_comparator(const u32 left, const u32 op, const u32 right); | 81 | extern int audit_comparator(const u32 left, const u32 op, const u32 right); |
79 | extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right); | 82 | extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right); |
80 | extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right); | 83 | extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right); |
81 | extern int parent_len(const char *path); | 84 | extern int parent_len(const char *path); |
82 | extern int audit_compare_dname_path(const char *dname, const char *path); | 85 | extern int audit_compare_dname_path(const char *dname, const char *path, int plen); |
83 | extern struct sk_buff * audit_make_reply(int pid, int seq, int type, | 86 | extern struct sk_buff * audit_make_reply(int pid, int seq, int type, |
84 | int done, int multi, | 87 | int done, int multi, |
85 | const void *payload, int size); | 88 | const void *payload, int size); |