blob: e214272d4670da5db4b9bec7889e5b3859ba1fee [file] [log] [blame]
Dmitry V. Levin1da7c952014-12-13 18:24:13 +00001#!/bin/sh
2
3# Check uid decoding.
4
5. "${srcdir=.}/init.sh"
6
Dmitry V. Levin1da7c952014-12-13 18:24:13 +00007s="${uid_syscall_suffix-}"
8w="${uid_t_size-}"
Dmitry V. Levin8f546642015-03-17 17:07:57 +00009
10run_prog ./uid$s$w
Dmitry V. Levin1da7c952014-12-13 18:24:13 +000011
Dmitry V. Levin8ef54392015-07-16 09:09:11 +000012syscalls=
13for n in "getuid$s" "getxuid$s"; do
14 if $STRACE -e "$n" -h > /dev/null; then
15 syscalls="$n"
16 break
17 fi
18done
19test -n "$syscalls" ||
20 fail_ "neither getuid$s nor getxuid$s is supported on this architecture"
21
22syscalls="$syscalls,setuid$s,getresuid$s,setreuid$s,setresuid$s,fchown$s,getgroups$s"
Dmitry V. Levin8f546642015-03-17 17:07:57 +000023run_strace -e trace="$syscalls" $args
Dmitry V. Levin1da7c952014-12-13 18:24:13 +000024
Dmitry V. Levin8f546642015-03-17 17:07:57 +000025AWK=gawk
26match_awk "$LOG" "$srcdir"/uid.awk "$STRACE $args output mismatch" -v suffix="$s"
Dmitry V. Levin1da7c952014-12-13 18:24:13 +000027
28exit 0