GNU bug report logs - #35209
Bug in zdiff argument of an option separated by a space is not handled correctly

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: gzip; Reported by: Bram Mertens <mertensb.mazda@HIDDEN>; dated Tue, 9 Apr 2019 14:24:02 UTC; Maintainer for gzip is bug-gzip@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Apr 2019 14:23:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 10:23:22 2019
Received: from localhost ([127.0.0.1]:51821 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hDrek-0002zC-8R
	for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 10:23:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57260)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mertensb.mazda@HIDDEN>) id 1hDrTN-0002ba-LV
 for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 10:11:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:57320)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <mertensb.mazda@HIDDEN>)
 id 1hDrTI-0007RN-IO
 for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 10:11:32 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43402)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <mertensb.mazda@HIDDEN>) id 1hDrTG-0005at-BM
 for bug-gzip@HIDDEN; Tue, 09 Apr 2019 10:11:32 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mertensb.mazda@HIDDEN>) id 1hDrTF-0007QF-K5
 for bug-gzip@HIDDEN; Tue, 09 Apr 2019 10:11:30 -0400
Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:33637)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <mertensb.mazda@HIDDEN>)
 id 1hDrTF-0007Pj-EX
 for bug-gzip@HIDDEN; Tue, 09 Apr 2019 10:11:29 -0400
Received: by mail-qk1-x732.google.com with SMTP id k189so10334115qkc.0
 for <bug-gzip@HIDDEN>; Tue, 09 Apr 2019 07:11:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=;
 b=dTTB+sU2RxcXP4Xz8upurixn65MlfS0/HNJry2F7MNF4Gkysxxdgqo2wBMbD9un/Qk
 LV0PajieTMTHKWUaUWkiQTJMWyGleCSn3QuipDrOmQthIa27Ch+kqYNZPHtn4ldQohcT
 2lqikg5v/PBl5Go0faHdhNcUNSb5jQiEoyePkNMCLFjaoiv4zVyu/9pVY23XLkrIqp1Q
 IanThymzB4aWTTcPn1Hl8RL23kg2xa7zrikTe3b1MsWNUgRDiqTwPRtoe+hCLv+1HT17
 gaj3NWIiP6QMKjRCWhxt0NZa/dbyBD22HRjgaKoekKDQ44+X/tFdjy1JZk0WV6xYUo7y
 sb8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=;
 b=tVYsoOIR2tCtBR2TgSu1gdGT4LRzD8Mgye7gvrfqFdKabR0WJVYIbBjuEdRqjQpbiM
 F5cwcS0yzU5293jzFEz2Lyyhf7/B67uhLR8lnCXJCGZdT13TTXKrpCATiAxPYqnLiuAQ
 k6g8rBJ3JXMoJkEmLn4aYBqennAGjEgTI7j3hmwd1oqMOqDIDCttgqYsmhrHCrM+dZun
 E4ykPBdYMm4n6zIGaghd6bm7Iy79ZtX6DUE7sdGKz20MbxIm2vwTkoczR7EuCr72Umcn
 ZkCFMclz+Vs7Lesy8021OZWqvaOxQdWR9cfJ5GD2IaTEFRLicmUI3BIuG5fxbzXlr600
 pPfw==
X-Gm-Message-State: APjAAAU9EYrS68XpBk1a2I0psLKuge3Hw4m4Fx0CHVDu3Bd7mBQ6PqNr
 2rzTg1WUZziSPgS1QFOyU6nA4+co+CRGM+sHJXVG+u49dwE=
X-Google-Smtp-Source: APXvYqxnbT7kbwzYo0h7A9MhCtezPSs3c8PEx8TMaSLp5JepQO3rivFATyUTlGu2jANc0IxsGvwj9FNX05XxzGaW84E=
X-Received: by 2002:a37:6381:: with SMTP id
 x123mr24925719qkb.110.1554819087629; 
 Tue, 09 Apr 2019 07:11:27 -0700 (PDT)
MIME-Version: 1.0
From: Bram Mertens <mertensb.mazda@HIDDEN>
Date: Tue, 9 Apr 2019 16:11:14 +0200
Message-ID: <CAKxHvy1w=ubGoLSKcGe8mwU36MYjHvXLW_1j3=rBi9sLJNw8UQ@HIDDEN>
Subject: Bug in zdiff argument of an option separated by a space is not
 handled correctly
To: bug-gzip@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::732
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 09 Apr 2019 10:23:21 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi,

The zdiff script does not handle options with arguments separated by a
space correctly.

The following if a valid diff command: "diff -y -W 200 /tmp/b1 /tmp/b2".
But when passed to zdiff the space between "-W" and 200 causes the
COLUMNS argument to be interpreted as a file:
zdiff -y -W 200 /tmp/b1 /tmp/b2
/bin/zdiff: 72: /bin/zdiff: cannot open 200: No such file

The error is caused by the following line in the loop that processes
the arguments:
-?*) cmp="$cmp '$1'";; (line 63 in version  1.6)

There should be an additional check to catch options with arguments. I
couldn't come up with a working solution quickly so I am currently
using a workaround.
If I remove the space between the option "-W" and it's COLUMNS
argument the script works as expected.

With this workaround the zdiff utility is great solution for the
problem I'm working on, thanks!

Thanks in advance

Bram Mertens




Acknowledgement sent to Bram Mertens <mertensb.mazda@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gzip@HIDDEN. Full text available.
Report forwarded to bug-gzip@HIDDEN:
bug#35209; Package gzip. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.