Skip to content

Commit

Permalink
audit: support the "standard" <asm-generic/unistd.h>
Browse files Browse the repository at this point in the history
Many of the syscalls mentioned in the audit code are not present
for architectures that implement only the "standard" set of
Linux syscalls (e.g. openat, but not open, etc.).  This change
adds proper #ifdefs for all those syscalls.

Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Chris Metcalf <[email protected]>
  • Loading branch information
cmetcalf-tilera committed May 4, 2011
1 parent d07bd86 commit aaeb012
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/asm-generic/audit_change_attr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#ifdef __NR_chmod
__NR_chmod,
#endif
__NR_fchmod,
#ifdef __NR_chown
__NR_chown,
Expand All @@ -20,7 +22,9 @@ __NR_chown32,
__NR_fchown32,
__NR_lchown32,
#endif
#ifdef __NR_link
__NR_link,
#endif
#ifdef __NR_linkat
__NR_linkat,
#endif
14 changes: 14 additions & 0 deletions include/asm-generic/audit_dir_write.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#ifdef __NR_rename
__NR_rename,
#endif
#ifdef __NR_mkdir
__NR_mkdir,
#endif
#ifdef __NR_rmdir
__NR_rmdir,
#endif
#ifdef __NR_creat
__NR_creat,
#endif
#ifdef __NR_link
__NR_link,
#endif
#ifdef __NR_unlink
__NR_unlink,
#endif
#ifdef __NR_symlink
__NR_symlink,
#endif
#ifdef __NR_mknod
__NR_mknod,
#endif
#ifdef __NR_mkdirat
__NR_mkdirat,
__NR_mknodat,
Expand Down
5 changes: 5 additions & 0 deletions include/asm-generic/audit_read.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#ifdef __NR_readlink
__NR_readlink,
#endif
__NR_quotactl,
__NR_listxattr,
__NR_llistxattr,
__NR_flistxattr,
__NR_getxattr,
__NR_lgetxattr,
__NR_fgetxattr,
#ifdef __NR_readlinkat
__NR_readlinkat,
#endif
2 changes: 2 additions & 0 deletions include/asm-generic/audit_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ __NR_acct,
__NR_swapon,
#endif
__NR_quotactl,
#ifdef __NR_truncate
__NR_truncate,
#endif
#ifdef __NR_truncate64
__NR_truncate64,
#endif
Expand Down
2 changes: 2 additions & 0 deletions lib/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ int audit_classify_arch(int arch)
int audit_classify_syscall(int abi, unsigned syscall)
{
switch(syscall) {
#ifdef __NR_open
case __NR_open:
return 2;
#endif
#ifdef __NR_openat
case __NR_openat:
return 3;
Expand Down

0 comments on commit aaeb012

Please sign in to comment.