3 # Check -bexecve behavior.
5 # Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
6 # Copyright (c) 2015-2018 The strace developers.
9 # SPDX-License-Identifier: GPL-2.0-or-later
11 . "${srcdir=.}/init.sh"
16 $STRACE "$@" 2> "$LOG"
19 run_strace_redir -enone ../set_ptracer_any true ||
20 dump_log_and_fail_with "$STRACE $args: unexpected exit status"
22 run_strace_redir -enone ../set_ptracer_any false
24 dump_log_and_fail_with "$STRACE $args: unexpected exit status"
26 run_strace_redir -bexecve -enone ../set_ptracer_any false ||
27 dump_log_and_fail_with "$STRACE $args: unexpected exit status"
29 pattern_detached='[^:]*strace: Process [1-9][0-9]* detached'
30 pattern_personality='[^:]*strace: \[ Process PID=[1-9][0-9]* runs in .* mode. \]'
32 LC_ALL=C grep -x "$pattern_detached" "$LOG" > /dev/null ||
33 dump_log_and_fail_with "$STRACE $args: output mismatch"
35 if LC_ALL=C grep -E -v -x "($pattern_detached|$pattern_personality)" "$LOG" > /dev/null; then
36 dump_log_and_fail_with "$STRACE $args: unexpected output"