tmux/tests/scripts/help-output.sh
David Cantrell 94f9e7ea34 Upgrade to tmux-3.2a (CVE-2020-27347)
Resolves: rhbz#2003007

Signed-off-by: David Cantrell <david.l.cantrell@gmail.com>
2021-12-03 11:38:29 -05:00

22 lines
406 B
Bash
Executable File

#!/bin/sh
PATH=/usr/bin
TMUX=/usr/bin/tmux
echo -n "checking for ${TMUX} --help output and exit code..."
STDOUT="$(${TMUX} --help 2>/dev/null)"
STDERR="$(${TMUX} --help 2>&1 | head -n 1 | cut -c-11)"
${TMUX} --help >/dev/null 2>&1
EXITCODE=$?
if [ ${EXITCODE} -eq 1 ] && [ -z "${STDOUT}" ] && [ "${STDERR}" = "usage: tmux" ]; then
echo "ok"
RET=0
else
echo "FAIL"
RET=1
fi
exit ${RET}