Fix trace=set regression introduced by commit v4.7-111-g9cbc15b
* syscall.c (qual_syscall, qualify): Pass personality down to qualify_one. * tests/qual_syscall: New test. * tests/Makefile.am (TESTS): Add qual_syscall.
This commit is contained in:
parent
879ddddeba
commit
7b9e45e891
@ -462,7 +462,7 @@ qual_syscall(const char *s, int bitflag, int not)
|
||||
if (sysent_vec[p][i].sys_name
|
||||
&& strcmp(s, sysent_vec[p][i].sys_name) == 0
|
||||
) {
|
||||
qualify_one(i, bitflag, not, 0);
|
||||
qualify_one(i, bitflag, not, p);
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
@ -575,7 +575,7 @@ qualify(const char *s)
|
||||
for (pers = 0; pers < SUPPORTED_PERSONALITIES; pers++) {
|
||||
for (i = 0; i < nsyscall_vec[pers]; i++)
|
||||
if (sysent_vec[pers][i].sys_flags & n)
|
||||
qualify_one(i, opt->bitflag, not, 0);
|
||||
qualify_one(i, opt->bitflag, not, pers);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Automake input for strace tests.
|
||||
|
||||
TESTS = ptrace_setoptions strace-f
|
||||
TESTS = ptrace_setoptions strace-f qual_syscall
|
||||
|
||||
EXTRA_DIST = init.sh $(TESTS)
|
||||
|
||||
|
29
tests/qual_syscall
Executable file
29
tests/qual_syscall
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Ensure that strace -e trace=set works.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
check_strace
|
||||
check_prog timeout
|
||||
check_prog ls
|
||||
check_prog grep
|
||||
|
||||
timeout -s 9 $check_timeout \
|
||||
$STRACE -e execve ls > /dev/null 2> check.log &&
|
||||
grep '^execve(' check.log > /dev/null ||
|
||||
{ cat check.log; fail_ 'strace -e execve does not work'; }
|
||||
|
||||
grep -v '^execve(' check.log |
|
||||
LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
|
||||
{ cat check.log; fail_ 'strace -e execve does not work properly'; }
|
||||
|
||||
timeout -s 9 $check_timeout \
|
||||
$STRACE -e trace=process ls > /dev/null 2> check.log &&
|
||||
grep '^execve(' check.log > /dev/null ||
|
||||
{ cat check.log; fail_ 'strace -e trace=process does not work'; }
|
||||
|
||||
grep '^open' check.log > /dev/null &&
|
||||
{ cat check.log; fail_ 'strace -e trace=process does not work properly'; }
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user