From 94f9e7ea34d4bac33028bb5dd1ae6394f29bebac Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 3 Dec 2021 11:38:29 -0500 Subject: [PATCH] Upgrade to tmux-3.2a (CVE-2020-27347) Resolves: rhbz#2003007 Signed-off-by: David Cantrell --- .gitignore | 1 + gating.yaml | 6 ++++++ sources | 2 +- tests/scripts/correct-elf.sh | 19 +++++++++++++++++++ tests/scripts/exists.sh | 16 ++++++++++++++++ tests/scripts/filename-lowercase.sh | 19 +++++++++++++++++++ tests/scripts/help-output.sh | 21 +++++++++++++++++++++ tests/scripts/launch-top.sh | 23 +++++++++++++++++++++++ tests/tests.yml | 25 +++++++++++++++++++++++++ tmux.spec | 27 ++++++++++++++++++++++++--- 10 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 gating.yaml create mode 100755 tests/scripts/correct-elf.sh create mode 100755 tests/scripts/exists.sh create mode 100755 tests/scripts/filename-lowercase.sh create mode 100755 tests/scripts/help-output.sh create mode 100755 tests/scripts/launch-top.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index dd7ae6a..98d9d8f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ tmux-1.3.tar.gz /tmux-3.0a.tar.gz /tmux-3.1.tar.gz /tmux-3.1c.tar.gz +/tmux-3.2a.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/sources b/sources index 375914c..893765d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (tmux-3.1c.tar.gz) = aad2e6457dd350369f245f711f1936a575d0588b72e660d10e7abc7d373da0d322903b451ad00b96a3e0e6847ca855673da6a4c5447cea91fa756edd23659397 +SHA512 (tmux-3.2a.tar.gz) = 6e52c7f5d03b2c8b8c4c8caac092a166956ba97334b426f2823d74dc5849a1d31a80145924f641f69dd2c244809e9350d9bd7070897fa2e3e1f9f086f9b2f365 diff --git a/tests/scripts/correct-elf.sh b/tests/scripts/correct-elf.sh new file mode 100755 index 0000000..acaef74 --- /dev/null +++ b/tests/scripts/correct-elf.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/usr/bin +TMUX=/usr/bin/tmux + +echo -n "checking to see that ${TMUX} is an ELF executable..." + +case "$(file -b --mime-type "${TMUX}")" in + application/x-executable|application/x-pie-executable|application/x-sharedlib) + echo "ok" + RET=0 + ;; + *) + echo "FAIL" + RET=1 + ;; +esac + +exit ${RET} diff --git a/tests/scripts/exists.sh b/tests/scripts/exists.sh new file mode 100755 index 0000000..c0ef34f --- /dev/null +++ b/tests/scripts/exists.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +PATH=/usr/bin +TMUX=/usr/bin/tmux + +echo -n "checking to see that ${TMUX} exists..." + +if [ -f "${TMUX}" ]; then + echo "ok" + RET=0 +else + echo "FAIL" + RET=1 +fi + +exit ${RET} diff --git a/tests/scripts/filename-lowercase.sh b/tests/scripts/filename-lowercase.sh new file mode 100755 index 0000000..24f9c52 --- /dev/null +++ b/tests/scripts/filename-lowercase.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/usr/bin +TMUX=/usr/bin/tmux + +echo -n "verifying ${TMUX}'s filename contains all lowercase letters..." + +BASETMUX="$(basename $(stat -L -c "%n" ${TMUX}))" +LOWERTMUX="$(echo "${BASETMUX}" | tr [A-Z] [a-z])" + +if [ "${BASETMUX}" = "${LOWERTMUX}" ]; then + echo "ok" + RET=0 +else + echo "FAIL" + RET=1 +fi + +exit ${RET} diff --git a/tests/scripts/help-output.sh b/tests/scripts/help-output.sh new file mode 100755 index 0000000..ff865c6 --- /dev/null +++ b/tests/scripts/help-output.sh @@ -0,0 +1,21 @@ +#!/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} diff --git a/tests/scripts/launch-top.sh b/tests/scripts/launch-top.sh new file mode 100755 index 0000000..c66dbe1 --- /dev/null +++ b/tests/scripts/launch-top.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +PATH=/usr/bin +TMUX=/usr/bin/tmux +SESSION_NAME="$(basename $0 .sh)" +RET=0 + +echo -n "checking that ${TMUX} can start a new session with 'top'..." + +${TMUX} new-session -d -s ${SESSION_NAME} 'top' || ( echo "FAIL" ; exit 1 ) + +TOPPID=$(pgrep -x top) +PGREPCODE=$? +if [ -z "${TOPPID}" ] || [ ${PGREPCODE} -ne 0 ]; then + RET=1 +elif [ ! -d /proc/${TOPPID} ]; then + RET=1 +fi + +${TMUX} kill-session -t ${SESSION_NAME} || ( echo "FAIL" ; exit 1 ) + +[ ${RET} -eq 0 ] && echo "ok" || echo "FAIL" +exit ${RET} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..ba812f7 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,25 @@ +--- + +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - tmux + tests: + - exists: + dir: scripts/ + run: ./exists.sh + - correct-elf: + dir: scripts/ + run: ./correct-elf.sh + - filename-lowercase: + dir: scripts/ + run: ./filename-lowercase.sh + - help-output: + dir: scripts/ + run: ./help-output.sh + - launch-top: + dir: scripts/ + run: ./launch-top.sh diff --git a/tmux.spec b/tmux.spec index 1424784..1da5779 100644 --- a/tmux.spec +++ b/tmux.spec @@ -1,7 +1,7 @@ %global _hardened_build 1 Name: tmux -Version: 3.1c +Version: 3.2a Release: 4%{?dist} Summary: A terminal multiplexer @@ -13,8 +13,11 @@ Source0: https://github.com/tmux/%{name}/releases/download/%{version}/%{n # Examples has been removed - so include the bash_completion here Source1: bash_completion_tmux.sh -BuildRequires: make +BuildRequires: make BuildRequires: gcc +BuildRequires: bison +BuildRequires: automake +BuildRequires: autoconf BuildRequires: pkgconfig(libevent) BuildRequires: pkgconfig(tinfo) BuildRequires: pkgconfig(ncurses) @@ -28,9 +31,11 @@ intended to be a simple, modern, BSD-licensed alternative to programs such as GNU Screen. %prep -%autosetup +%setup + %build +autoreconf -f -i -v %configure %make_build @@ -67,6 +72,22 @@ fi %{_datadir}/bash-completion/completions/tmux %changelog +* Fri Dec 03 2021 David Cantrell - 3.2a-4 +- Rebuild + Resolves: rhbz#2003007 + +* Mon Sep 27 2021 David Cantrell - 3.2a-3 +- Rebuild + Related: rhbz#1910707 + +* Wed Sep 22 2021 David Cantrell - 3.2a-2 +- Ensure gating test files are present in the source repo + Related: rhbz#1910707 + +* Wed Sep 01 2021 David Cantrell - 3.2a-1 +- Upgrade to tmux-3.2a (CVE-2020-27347) + Resolves: rhbz#1910707 + * Tue Aug 10 2021 Mohan Boddu - 3.1c-4 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688