|
From: AKASHI T. <tak...@li...> - 2014-07-23 07:38:34
|
On some architectures including arm64, system call numbers are defined
in /usr/include/asm-generic/unistd.h. This file contains irregular
style of definitions like
#define __NR3264_truncate 45
#define __NR_truncate __NR3264_truncate
(In fact, it's more complicated.)
This patch takes care of such cases.
Signed-off-by: AKASHI Takahiro <tak...@li...>
---
audit-test/utils/augrok | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/audit-test/utils/augrok b/audit-test/utils/augrok
index 08f731a..f0542e5 100755
--- a/audit-test/utils/augrok
+++ b/audit-test/utils/augrok
@@ -113,8 +113,12 @@ sub new {
open(S, "gcc $m32 -E -dM /usr/include/syscall.h |") or die;
my $line;
while (defined($line = <S>)) {
- next unless $line =~ /^#define\s+__NR_(\w+)\s+(\w+|\(.*?\))/;
- $singleton->{$1} = $2;
+ if ($line =~ /^#define\s+__NR_(\w+)\s+(\w+|\(.*?\))/) {
+ $singleton->{$1} = $2;
+ }
+ if ($line =~ /^#define\s+__NR3264_(\w+)\s+(\w+|\(.*?\))/) {
+ $singleton->{"3264_$1"} = $2;
+ }
}
close S;
@@ -139,6 +143,13 @@ sub new {
$changed = 1;
}
+ #define __NR_truncate __NR3264_truncate
+ if ($v =~ /^__NR3264_(\w+)$/ and
+ defined($new_v = $singleton->{"3264_$1"})) {
+ $singleton->{$k} = $new_v;
+ $changed = 1;
+ }
+
# don't know how to handle this, hope it wasn't important
else {
print STDERR "Removing syscall{$k} = $v\n" if $opt{'debug'};
--
1.7.9.5
|