From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113856 invoked by alias); 11 Jul 2019 23:29:56 -0000 Mailing-List: contact bzip2-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Sender: bzip2-devel-owner@sourceware.org Received: (qmail 113846 invoked by uid 89); 11 Jul 2019 23:29:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org From: Mark Wielaard To: bzip2-devel@sourceware.org Cc: Anibal Monsalve Salazar , =?UTF-8?q?Santiago=20Ruano=20Rinc=C3=B3n?= , Anthony Fok , Vincent Lefevre , Mark Wielaard Subject: [PATCH] fix bzdiff when TMPDIR contains spaces Date: Tue, 01 Jan 2019 00:00:00 -0000 Message-Id: <20190711232910.19290-1-mark@klomp.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-SW-Source: 2019-q3/txt/msg00025.txt.bz2 Hi, bzip2 lost its domain and got a new home at https://sourceware.org/bzip2/ It also didn't see a release for a very long time. Causing various patches used by distros to not have been integrated upstream. We are trying to collect them all and do a new release. The following patch comes from Debian. Please let us know if we missed some others. Thanks, Mark The bzdiff script doesn't contain enough quotes, so that it doesn't work if the TMPDIR environment variable is defined and contains spaces. https://bugs.debian.org/493710 Author: Vincent Lefevre --- bzdiff | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 bzdiff diff --git a/bzdiff b/bzdiff old mode 100644 new mode 100755 index 6fc38f9..bd96c27 --- a/bzdiff +++ b/bzdiff @@ -37,10 +37,6 @@ if test -z "$FILES"; then echo "Usage: $prog [${comp}_options] file [file]" exit 1 fi -tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || { - echo 'cannot create a temporary file' >&2 - exit 1 -} set $FILES if test $# -eq 1; then FILE=`echo "$1" | sed 's/.bz2$//'` @@ -53,10 +49,14 @@ elif test $# -eq 2; then case "$2" in *.bz2) F=`echo "$2" | sed 's|.*/||;s|.bz2$||'` - bzip2 -cdfq "$2" > $tmp - bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp + tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || { + echo 'cannot create a temporary file' >&2 + exit 1 + } + bzip2 -cdfq "$2" > "$tmp" + bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp" STAT="$?" - /bin/rm -f $tmp;; + /bin/rm -f "$tmp";; *) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2" STAT="$?";; @@ -69,8 +69,8 @@ elif test $# -eq 2; then STAT="$?";; esac;; esac - exit "$STAT" else echo "Usage: $prog [${comp}_options] file [file]" exit 1 fi +exit "$STAT" -- 2.20.1