blob: f4cb8e77abc1e4c14c37323598238f50e8956c5e [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. Levind2a9ce62015-01-14 10:13:59 +00007check_prog gawk
Dmitry V. Levin1da7c952014-12-13 18:24:13 +00008
9s="${uid_syscall_suffix-}"
10w="${uid_t_size-}"
11uid="uid$s$w"
12./"$uid" || {
13 if [ $? -eq 77 ]; then
14 framework_skip_ "some uid$s or uid${w}_t syscalls are not available"
15 else
16 fail_ "$uid failed"
17 fi
18}
19
Dmitry V. Levin530bed02014-12-14 13:30:54 +000020syscalls="getuid$s,setuid$s,getresuid$s,setreuid$s,setresuid$s,chown$s,getgroups$s"
Dmitry V. Levin1da7c952014-12-13 18:24:13 +000021args="-e trace=$syscalls"
22$STRACE -o "$LOG" $args ./"$uid"|| {
23 cat "$LOG"
24 fail_ "$STRACE $args ./$uid failed"
25}
26
Dmitry V. Levind2a9ce62015-01-14 10:13:59 +000027gawk -f "$srcdir"/uid.awk -v suffix="$s" "$LOG" || {
Dmitry V. Levin1da7c952014-12-13 18:24:13 +000028 cat "$LOG"
29 fail_ 'unexpected output'
30}
31
32exit 0