summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/gen_tests.in9
-rwxr-xr-xtests/getuid.test12
-rw-r--r--tests/trace_creds.in8
4 files changed, 27 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7f5287bd3..f6016b3a0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -478,6 +478,7 @@ EXTRA_DIST = \
strace.supp \
sun_path.expected \
syntax.sh \
+ trace_creds.in \
trace_fstat.in \
trace_fstatfs.in \
trace_lstat.in \
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 19b013faa..72c9c5627 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -105,11 +105,17 @@ getcwd -a18
getdents -a22 -v
getdents64 -a24 -v
getegid +getuid.test
+getegid-creds +getuid.test
getegid32 +getuid.test
+getegid32-creds +getuid.test
geteuid +getuid.test
+geteuid-creds +getuid.test
geteuid32 +getuid.test
+geteuid32-creds +getuid.test
getgid +getuid.test
+getgid-creds +getuid.test
getgid32 +getuid.test
+getgid32-creds +getuid.test
getgroups -a17
getgroups32 -a19
getpeername -a27
@@ -126,7 +132,9 @@ getrusage -v
getsid -a10
getsockname -a27
gettid -a9
+getuid-creds +getuid.test
getuid32 +getuid.test
+getuid32-creds +getuid.test
getxxid -a10 -e trace=getxpid,getxuid,getxgid
group_req -e trace=setsockopt
inet-cmsg -e trace=recvmsg
@@ -537,6 +545,7 @@ timer_xettime -e trace=timer_create,timer_settime,timer_gettime
timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime
times -esignal=none
times-fail -a12 -e trace=times
+trace_creds test_trace_expr '([gs]et[^p]*([gu]id|groups)|caps|prctl|[fl]?chown|print(path-umovestr|strn-umoven)-undumpable|ptrace|quotactl|rt_sigtimedwait|rt_(tg)?sigqueueinfo).*' -e%creds
trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full
trace_fstatfs test_trace_expr '' -e%fstatfs
trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full
diff --git a/tests/getuid.test b/tests/getuid.test
index a0bbb3ed1..50ed835c7 100755
--- a/tests/getuid.test
+++ b/tests/getuid.test
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# Check getuid syscall decoding.
+# Check get(e)?[gu]id(32)? syscalls decoding.
#
-# Copyright (c) 2016-2018 The strace developers.
+# Copyright (c) 2016-2020 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -10,7 +10,13 @@
. "${srcdir=.}/init.sh"
check_prog uniq
+if [ "${NAME%-creds}" = "$NAME" ]; then
+ syscall="$NAME"
+else
+ NAME="${NAME%-creds}"
+ syscall='%creds'
+fi
run_prog > /dev/null
-run_strace -qq -a9 -e$NAME $args > "$EXP"
+run_strace -qq -a9 -e"$syscall" $args > "$EXP"
uniq < "$LOG" > "$OUT"
match_diff "$OUT" "$EXP"
diff --git a/tests/trace_creds.in b/tests/trace_creds.in
new file mode 100644
index 000000000..ce78253a5
--- /dev/null
+++ b/tests/trace_creds.in
@@ -0,0 +1,8 @@
+getgroups -a17
+getgroups32 -a19
+getresgid -a25
+getresgid32 -a27
+getresuid -a25
+getresuid32 -a27
+setgroups -s2 -a17
+setgroups32 -s2 -a19