From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 12:01:00 2013 Received: (at submit) by debbugs.gnu.org; 18 Oct 2013 16:01:01 +0000 Received: from localhost ([127.0.0.1]:57076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXCTz-00016v-Do for submit@debbugs.gnu.org; Fri, 18 Oct 2013 12:01:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38960) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXAQR-0005GI-Af for submit@debbugs.gnu.org; Fri, 18 Oct 2013 09:49:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXAQC-00009r-IP for submit@debbugs.gnu.org; Fri, 18 Oct 2013 09:49:05 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAQC-00009l-FY for submit@debbugs.gnu.org; Fri, 18 Oct 2013 09:48:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAQ5-0006ld-0E for bug-coreutils@gnu.org; Fri, 18 Oct 2013 09:48:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXAPx-000072-Mx for bug-coreutils@gnu.org; Fri, 18 Oct 2013 09:48:48 -0400 Received: from know-smtprelay-omc-10.server.virginmedia.net ([80.0.253.74]:43613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAPx-00006p-E9 for bug-coreutils@gnu.org; Fri, 18 Oct 2013 09:48:41 -0400 Received: from [192.168.0.6] ([82.24.163.6]) by know-smtprelay-10-imp with bizsmtp id edof1m00k08bX4q01dofxZ; Fri, 18 Oct 2013 14:48:40 +0100 X-Originating-IP: [82.24.163.6] X-Spam: 0 X-Authority: v=2.0 cv=GOJQiZxK c=1 sm=1 a=l9RqC/1DVThHhplJvyd7ng==:17 a=4qSYlRtI_JwA:10 a=vS7hgyFcjOMA:10 a=uObrxnre4hsA:10 a=8nJEP1OIZ-IA:10 a=NLZqzBF-AAAA:8 a=ToAZjKjMaFIA:10 a=5uWbF5BGLnmjOLWUn2kA:9 a=wPNLvfGTeEIA:10 a=l9RqC/1DVThHhplJvyd7ng==:117 Message-ID: <52613C37.8080306@ntlworld.com> Date: Fri, 18 Oct 2013 14:48:39 +0100 From: jock97@ntlworld.com User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Possible bug in md5sum, sha1 and sha2 checksum utilities Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 18 Oct 2013 12:00:57 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Hi, First, I hope this isn't some strange manifestation of shell backslash escaping that has fooled me. I've fiddled around trying to eliminate that possibility, but it could still happen. Apologies if it is... Anyway, what I think might be a bug is as follows: If you use any of md5sum, sha1sum, sha224sum, sha256sum, sha384sum or sha512sum (are there any others?) on a file whose name contains a backslash, then the output is prefixed with what appears to be an erroneous backslash. I'm using version 7.1 of these GNU coreutils commands. The problem was also present in version 6.9. To demonstrate the problem, do the following at a shell prompt >>> : # Create empty file with backslash in its name. >>> touch 'jun\k' # Checksum it. >>> sha1sum 'jun\k' \da39a3ee5e6b4b0d3255bfef95601890afd80709 jun\\k # Checksum it via stdin. >>> sha1sum <'jun\k' da39a3ee5e6b4b0d3255bfef95601890afd80709 - In case the backslashes don't make it through the email system, the file has a single backslash in its name. The first checksum starts with a backslash. The second doesn't. I think both outputs should be the same. Redirecting the output to a file makes no difference, so I don't think it's a terminal issue. Regards, Rodney Warren-Smith From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 12:14:43 2013 Received: (at control) by debbugs.gnu.org; 18 Oct 2013 16:14:43 +0000 Received: from localhost ([127.0.0.1]:57090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXChH-0001nb-BB for submit@debbugs.gnu.org; Fri, 18 Oct 2013 12:14:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41777) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXChC-0001nK-AF; Fri, 18 Oct 2013 12:14:40 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9IGEZRF006397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Oct 2013 12:14:35 -0400 Received: from [10.3.113.38] (ovpn-113-38.phx2.redhat.com [10.3.113.38]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9IGEZNX010279; Fri, 18 Oct 2013 12:14:35 -0400 Message-ID: <52615E6A.2080606@redhat.com> Date: Fri, 18 Oct 2013 10:14:34 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: jock97@ntlworld.com, 15644-done@debbugs.gnu.org Subject: Re: bug#15644: Possible bug in md5sum, sha1 and sha2 checksum utilities References: <52613C37.8080306@ntlworld.com> In-Reply-To: <52613C37.8080306@ntlworld.com> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4va9Amdv2IXTLOMevOEfrrBg9vs8vbJ0e" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.5 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4va9Amdv2IXTLOMevOEfrrBg9vs8vbJ0e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 15644 notabug thanks On 10/18/2013 07:48 AM, jock97@ntlworld.com wrote: > Hi, > First, I hope this isn't some strange manifestation of shell > backslash escaping that has fooled me. I've fiddled around trying to > eliminate that possibility, but it could still happen. Apologies if it = is... No, what you are seeing is intentional. It also occurs for literal newlines in files. Basically, since *sum output is line oriented, we have to have a way to escape newlines in file names; and in order to escape newlines, we also have to have a way to escape our escape. Hence, we have documented that our output format starts with a backslash on any line where the filename requires unescaping. > # Checksum it. >>>> sha1sum 'jun\k' > \da39a3ee5e6b4b0d3255bfef95601890afd80709 jun\\k >=20 > # Checksum it via stdin. >>>> sha1sum <'jun\k' > da39a3ee5e6b4b0d3255bfef95601890afd80709 - >=20 > In case the backslashes don't make it through the email system, the fil= e > has a single backslash in its name. The first checksum starts with a > backslash. The second doesn't. I think both outputs should be the same.= The difference on checking the named file vs. checking from stdin is that from stdin, nothing needs escaping. The difference is intentional, and there's nothing to fix, at least not related to your question. [There IS the related matter that we SHOULD be escaping carriage returns as well, because of sum files that get transmitted with DOS-style line endings; the fact that we have unambiguous output for newline, but not for trailing carriage return (was it part of the file name or just the transmitter sending it in DOS format?) is awkward] I'm closing this as not a bug, but feel free to add further comments to the thread as needed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4va9Amdv2IXTLOMevOEfrrBg9vs8vbJ0e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSYV5rAAoJEKeha0olJ0NqpB4IAKOU8hZKkjiQ+5t1y2TU3d0Q FjLl62lK8tCGhtdXyG7X7FKNe4/lpl1ivm71CEaiGQFXk8W2fzaEVNGZAUI31fIe AfE5IYstZTql5H3P4VYc5j6sEiMLXzD2pGWyi2nJi7/bwphGHKxcG4EhY3e6r5zP XbTuwdBXxSALrVwILgynsnFA9569raVq76KVJ2gdGk2V4mhPIA5GB0kUslMesz4V BIQQlgAqfKvW2J2g603UYBSd28XMynUFsQV/UZ6HbTa75/SADNaWD1LBugG2RBhu 6HNVfNw9UtO4zqUtKhpM68c7GuQ2ry/YD+PWFed4bSdS0V/ABQ3AdKBeeLZvJHc= =s2Zq -----END PGP SIGNATURE----- --4va9Amdv2IXTLOMevOEfrrBg9vs8vbJ0e-- From unknown Thu Sep 11 09:18:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 16 Nov 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator