strace/tests/caps.test
Dmitry V. Levin 4b9c68b9a3 Implement full decoding of 64-bit capabilities
Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but
before this change only lower 32 capability bits were decoded for
v2 and v3.

* xlat/capabilities1.in: New file.
* capability.c: Define v2/v3 CAP_* constants.
Include xlat/capabilities1.h.
(get_cap_header): New function.
(print_cap_header): Update to use get_cap_header result.
(print_cap_data): Decoder higher capability bits for v2 and v3.
(sys_capget, sys_capset): Use get_cap_header, update print_cap_header
and print_cap_data calls.
* tests/caps.c: New file.
* tests/caps.awk: New file.
* tests/caps.test: New test.
* tests/Makefile.am (CHECK_PROGRAMS): Add caps.
(TESTS): Add caps.test.
(EXTRA_DIST): Add caps.awk.
2014-12-06 03:53:12 +00:00

27 lines
433 B
Bash
Executable File

#!/bin/sh
# Check capget/capset syscalls decoding.
. "${srcdir=.}/init.sh"
check_prog awk
./caps || {
if [ $? -eq 77 ]; then
framework_skip_ 'capget/capset syscalls do not behave as expected'
else
fail_ 'caps failed'
fi
}
args="-e trace=capget,capset ./caps"
$STRACE -o "$LOG" $args || {
cat "$LOG"
fail_ "$STRACE $args failed"
}
awk -f "$srcdir"/caps.awk "$LOG" ||
{ cat "$LOG"; fail_ 'unexpected output'; }
exit 0