Dmitry V. Levin | 1da7c95 | 2014-12-13 18:24:13 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Check uid decoding. |
| 4 | |
| 5 | . "${srcdir=.}/init.sh" |
| 6 | |
Dmitry V. Levin | 1da7c95 | 2014-12-13 18:24:13 +0000 | [diff] [blame] | 7 | s="${uid_syscall_suffix-}" |
| 8 | w="${uid_t_size-}" |
Dmitry V. Levin | 8f54664 | 2015-03-17 17:07:57 +0000 | [diff] [blame] | 9 | |
| 10 | run_prog ./uid$s$w |
Dmitry V. Levin | 1da7c95 | 2014-12-13 18:24:13 +0000 | [diff] [blame] | 11 | |
Dmitry V. Levin | 8ef5439 | 2015-07-16 09:09:11 +0000 | [diff] [blame] | 12 | syscalls= |
| 13 | for n in "getuid$s" "getxuid$s"; do |
| 14 | if $STRACE -e "$n" -h > /dev/null; then |
| 15 | syscalls="$n" |
| 16 | break |
| 17 | fi |
| 18 | done |
| 19 | test -n "$syscalls" || |
| 20 | fail_ "neither getuid$s nor getxuid$s is supported on this architecture" |
| 21 | |
| 22 | syscalls="$syscalls,setuid$s,getresuid$s,setreuid$s,setresuid$s,fchown$s,getgroups$s" |
Dmitry V. Levin | 8f54664 | 2015-03-17 17:07:57 +0000 | [diff] [blame] | 23 | run_strace -e trace="$syscalls" $args |
Dmitry V. Levin | 1da7c95 | 2014-12-13 18:24:13 +0000 | [diff] [blame] | 24 | |
Dmitry V. Levin | 8f54664 | 2015-03-17 17:07:57 +0000 | [diff] [blame] | 25 | AWK=gawk |
| 26 | match_awk "$LOG" "$srcdir"/uid.awk "$STRACE $args output mismatch" -v suffix="$s" |
Dmitry V. Levin | 1da7c95 | 2014-12-13 18:24:13 +0000 | [diff] [blame] | 27 | |
| 28 | exit 0 |