diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2006-05-18 16:01:30 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-06-20 05:25:25 -0400 |
| commit | d8945bb51a2bb6623cfa36b9ff63594f46d513aa (patch) | |
| tree | b369c9b853e90790a04baa70ee66a2ef9e15fd18 /include/linux | |
| parent | e0182909297da8d38a5d473ae7bee3d0324632a1 (diff) | |
[PATCH] inline more audit helpers
pull checks for ->audit_context into inlined wrappers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/audit.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index da5f521be04b..4b62743b2e6d 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -301,11 +301,16 @@ extern void audit_syscall_entry(int arch, | |||
| 301 | int major, unsigned long a0, unsigned long a1, | 301 | int major, unsigned long a0, unsigned long a1, |
| 302 | unsigned long a2, unsigned long a3); | 302 | unsigned long a2, unsigned long a3); |
| 303 | extern void audit_syscall_exit(int failed, long return_code); | 303 | extern void audit_syscall_exit(int failed, long return_code); |
| 304 | extern void audit_getname(const char *name); | 304 | extern void __audit_getname(const char *name); |
| 305 | extern void audit_putname(const char *name); | 305 | extern void audit_putname(const char *name); |
| 306 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); | 306 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); |
| 307 | extern void __audit_inode_child(const char *dname, const struct inode *inode, | 307 | extern void __audit_inode_child(const char *dname, const struct inode *inode, |
| 308 | unsigned long pino); | 308 | unsigned long pino); |
| 309 | static inline void audit_getname(const char *name) | ||
| 310 | { | ||
| 311 | if (unlikely(current->audit_context)) | ||
| 312 | __audit_getname(name); | ||
| 313 | } | ||
| 309 | static inline void audit_inode(const char *name, const struct inode *inode, | 314 | static inline void audit_inode(const char *name, const struct inode *inode, |
| 310 | unsigned flags) { | 315 | unsigned flags) { |
| 311 | if (unlikely(current->audit_context)) | 316 | if (unlikely(current->audit_context)) |
| @@ -324,13 +329,26 @@ extern void auditsc_get_stamp(struct audit_context *ctx, | |||
| 324 | struct timespec *t, unsigned int *serial); | 329 | struct timespec *t, unsigned int *serial); |
| 325 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 330 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
| 326 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 331 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
| 327 | extern int audit_ipc_obj(struct kern_ipc_perm *ipcp); | 332 | extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
| 328 | extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 333 | extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
| 329 | extern int audit_bprm(struct linux_binprm *bprm); | 334 | extern int audit_bprm(struct linux_binprm *bprm); |
| 330 | extern int audit_socketcall(int nargs, unsigned long *args); | 335 | extern int audit_socketcall(int nargs, unsigned long *args); |
| 331 | extern int audit_sockaddr(int len, void *addr); | 336 | extern int audit_sockaddr(int len, void *addr); |
| 332 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 337 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
| 333 | extern int audit_set_macxattr(const char *name); | 338 | extern int audit_set_macxattr(const char *name); |
| 339 | |||
| 340 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | ||
| 341 | { | ||
| 342 | if (unlikely(current->audit_context)) | ||
| 343 | return __audit_ipc_obj(ipcp); | ||
| 344 | return 0; | ||
| 345 | } | ||
| 346 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | ||
| 347 | { | ||
| 348 | if (unlikely(current->audit_context)) | ||
| 349 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); | ||
| 350 | return 0; | ||
| 351 | } | ||
| 334 | #else | 352 | #else |
| 335 | #define audit_alloc(t) ({ 0; }) | 353 | #define audit_alloc(t) ({ 0; }) |
| 336 | #define audit_free(t) do { ; } while (0) | 354 | #define audit_free(t) do { ; } while (0) |
