GNU bug report logs - #81541
Script-breaking changes to "sum" command

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: coreutils; Reported by: "Fine, Thomas" <tfine@HIDDEN>; Keywords: notabug; Done: Collin Funk <collin.funk1@HIDDEN>; Maintainer for coreutils is bug-coreutils@HIDDEN.
bug closed, send any further explanations to 81541 <at> debbugs.gnu.org and "Fine, Thomas" <tfine@HIDDEN> Request was from Collin Funk <collin.funk1@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Collin Funk <collin.funk1@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 81541) by debbugs.gnu.org; 3 Aug 2026 04:58:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 03 00:58:10 2026
Received: from localhost ([127.0.0.1]:51624 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wqkkc-000363-1D
	for submit <at> debbugs.gnu.org; Mon, 03 Aug 2026 00:58:10 -0400
Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:54566)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <collin.funk1@HIDDEN>)
 id 1wqkkW-00034v-9e
 for 81541 <at> debbugs.gnu.org; Mon, 03 Aug 2026 00:58:06 -0400
Received: by mail-pj1-x1032.google.com with SMTP id
 98e67ed59e1d1-38deea72eebso2754420a91.1
 for <81541 <at> debbugs.gnu.org>; Sun, 02 Aug 2026 21:58:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1785733078; x=1786337878; darn=debbugs.gnu.org;
 h=content-type:mime-version:user-agent:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to:content-type;
 bh=/empsuPAk0JgWQ58oMGVbBOBFg2zOI0D9fIF3pxONFU=;
 b=ZeWdNo1CfbP27m7KegDGXmjTbaFIuANYAEWuSffZrq6suyDZBN/kGeQLZmPhE6T3yW
 k0jKwILQO+mhtPJdocsy17/Wibu0zVUWenHY8ILl6irk+nfo09VLrffRj8d/++nBcA6D
 XlJx2fcOKXp4dppRngzL6U0jUNoWI65QnxOpH+rA2iY1o+f9S4OCNv3r4xFwcQhsiWjy
 C+BOrOnfAnCtSvFKOIotmkc6hRPakzBURP0/j57ec3DSzR/u0QxD25yKOAOGme2oo2wq
 lJFwUc6iWZaq83UWAqibwBSu76ZFBhiEsD0iyPNG+oeWsBzGoZXe7D5QMrIKcRhA9v41
 PeJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1785733078; x=1786337878;
 h=content-type:mime-version:user-agent:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to:content-type;
 bh=/empsuPAk0JgWQ58oMGVbBOBFg2zOI0D9fIF3pxONFU=;
 b=QIKgK3yG5tuDgihT8FKDzoXYsj4/8R/G01bgg/+JCkFJ/ePns4s8U9u/D2+U66Q43B
 zYBggj48EALyE8hVgbF+5LtHhwq8KXIT76N0pp4diqWY1RNsw174haeUq9ZguGeYwyhW
 QbRMBeS+RkYta3r3YyxwMUl5Co3opEzAbEIXpMmUkoQzQXOvOl6bgQ3jtARpyHRTNXNj
 YPOeKZhenDWgA4dvJxhFnjuafja80tECOq1Cv6x4y2QHFWdW0DC/NtBQ6QH6gmJRcdQd
 78UDIY6eq/gnxUosMOBXJmh3ZHjvjvpGtvFjEOTg6KY1ToRB5auipzB6/p3ZMwHX8BZd
 E7ug==
X-Gm-Message-State: AOJu0YyxycjZ6Os4Q1NjNA7BEJwt/MrVQfLWTV91quSaFjm8M4Y74EQ2
 qTCXWv0SzKSaL8vnUG7Dpc3yooZyutioKeBejxH6qxanJ2Q8lHIYHG0feysj2Q==
X-Gm-Gg: AR+sD10CeMcTTl+uEa5VWMz8ku7Rl6tu+/gcFYJei46hFOVPZtwv6I2tCO/cYgspYho
 u0vrPB+YY55Lh3e5klwvtk5IOczMFnKw49dsfsCXqTHVNsJzjK+fj3bfFEXzAiOEsHcOv7e36uH
 QCAy57nDQzr/L26eUul1DgC6stSb2jVC4Oi19VdzbLwqIxxQxtPa8yWfma95Ri7p6yRpHXk/OS+
 DHpl/KVP3QChA2uCtpXtgPb5ZNBC4UR4u22YoKFJ1hoIEc18FjN+9cf2gP0ulSmwW1cwI9uYGE8
 gYcYVS39rUb1ma7E5Ua17cSwVeDajNLmzFf3FfYWbSA0tT5GUJ0c76JsxGOKaMVxvfZK6ufZdR2
 +SohtafDlOontw6kdxSU6CWLODo6M3E+fR/afB6zbGavTsoyRbJoiifz6avT4DoRd/8iKwDgmZ9
 Lkh4enw3N9q3OVPjZOFPCixs3TzN2IqaF6PeygWqJl
X-Received: by 2002:a17:90b:1d48:b0:38e:7f34:b23d with SMTP id
 98e67ed59e1d1-38fbc598be1mr8021727a91.35.1785733077815; 
 Sun, 02 Aug 2026 21:57:57 -0700 (PDT)
Received: from fedora ([2601:646:8081:3770::4bd])
 by smtp.gmail.com with ESMTPSA id
 5a478bee46e88-3153dd4f0f0sm32134354eec.2.2026.08.02.21.57.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 02 Aug 2026 21:57:57 -0700 (PDT)
From: Collin Funk <collin.funk1@HIDDEN>
To: "Fine, Thomas" <tfine@HIDDEN>
Subject: Re: bug#81541: Script-breaking changes to "sum" command
In-Reply-To: <CANVEBdgrBenRGEvKMH2Dcp9tCc_nRtAVcQhA6Ha5T9nPONpHZQ@HIDDEN>
References: <CANVEBdgrBenRGEvKMH2Dcp9tCc_nRtAVcQhA6Ha5T9nPONpHZQ@HIDDEN>
Date: Sun, 02 Aug 2026 21:57:56 -0700
Message-ID: <87wlu7ssvf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  "Fine, Thomas" via GNU coreutils Bug Reports writes: > At
 some point between 8.3 and 9.5, the behavior of the sum command changed. >
 > It used to not print the filename, when only one file was checked. > Now
 it always prints the filename no matter what. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:1032 listed in]
 [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (collin.funk1[at]gmail.com)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (collin.funk1[at]gmail.com)
X-Debbugs-Envelope-To: 81541
Cc: 81541 <at> debbugs.gnu.org
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.3 (/)

"Fine, Thomas" via GNU coreutils Bug Reports <bug-coreutils@HIDDEN>
writes:

> At some point between 8.3 and 9.5, the behavior of the sum command changed.
>
> It used to not print the filename, when only one file was checked.
> Now it always prints the filename no matter what.
>
> Scripts which compare checksums of individual files are now broken because
> they don't expect to see a filename there, and therefore the checksums of
> two different files no longer match.
>
> This is breaking scripts.  It should have been added as an option for the
> future to preserve script behavior, but, failing that, at least an option
> should have been added to make for a trivial fix for scripts.

It was changed in 9.0. The decision was not mine, but I feel that the
rationale is sound. Here is the NEWS entry:

   sum [-r] will output a file name, even if only a single name is passed.
   This is consistent with sum -s, cksum, and other sum(1) implementations.

That is, your script would be broken on NetBSD, DragonFlyBSD, FreeBSD,
macOS, and Solaris anyways. There are likely others that I am
unfortunately not able to test.

Regarding your scripts, you can have them use the following instead:

    $ sum < /dev/null
    00000     0

Alternatively, you can use 'cksum' which supports much better algorithms
which are less likely to have hash collisions.

Collin




Information forwarded to bug-coreutils@HIDDEN:
bug#81541; Package coreutils. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 3 Aug 2026 04:42:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 03 00:42:40 2026
Received: from localhost ([127.0.0.1]:51538 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wqkVb-0002Bj-OK
	for submit <at> debbugs.gnu.org; Mon, 03 Aug 2026 00:42:40 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:39592)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <tfine@HIDDEN>)
 id 1wqhmz-0002qy-PO
 for submit <at> debbugs.gnu.org; Sun, 02 Aug 2026 21:48:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <tfine@HIDDEN>)
 id 1wqhmu-0001VV-AX
 for bug-coreutils@HIDDEN; Sun, 02 Aug 2026 21:48:20 -0400
Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <tfine@HIDDEN>)
 id 1wqhms-00048Q-Uv
 for bug-coreutils@HIDDEN; Sun, 02 Aug 2026 21:48:20 -0400
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-51c0cea8883so20073961cf.1
 for <bug-coreutils@HIDDEN>; Sun, 02 Aug 2026 18:48:17 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1785721696; cv=none;
 d=google.com; s=arc-20260327;
 b=HEql3nSHFCNA0iwbrrrvTt/rjPl6gaEnueuiXRSlzAVi8LXGJL/MMj0H0TOeveKbzt
 YbXxw8bcTVrqHuy1m/VALwOaSZ7Lkui1tM13uHRpG5sD0KNO2KhXbgKFTZUePjFuq5EE
 higsTboEioqRcGWOOLeS7s8dpdlEO2gqZcht3oIfDxr22ISTy9aMweVtn9a/g/orX3jQ
 qapheP5UwCEBNBmGg7fQlTHYMSN4CLUHb4xD9tlZL10/nso65XP1YEKBMZaPDkYynIt+
 bn6pxeQXMp2Ao8IRYRiY65bIlXLXdCnhKlFfvyInfaLQHIgHv/8FE/1Mv3tLGl2h6eVR
 BTSQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
 s=arc-20260327; 
 h=to:subject:message-id:date:from:mime-version:dkim-signature;
 bh=D7Uq7oVzvRs0k61EX2Oi+xk4/aZsiNG/sXLmVQOdC0E=;
 fh=ScPEsXXZxjUO/SyfaKBND7w77mVWHCttHT1i+nAxu0Q=;
 b=FQvhHHFEmpB+LY49UQ7z2XJgbZk5QlROkHr1/cb0sTDGbFyFQhezzM0w1ki9vS/qsL
 qpf2L8Fffyoad8KtrJ2NA/66DIpJdfzyCZn7Mm9+nTOBZG2U2Zi0TqiJ67eNX1Qi39O7
 7Z8+nwjWYuhw35Myq7RBQE3s1NxCZ0/i16tOoGG8m+SNutZ8l6Oh5Hdptbw0xu0aURoj
 cPhOxyn1DYgjERctEbnbIWcUBML02++KCjB11WLbMHBA458BeAJ+ltC6UBX+7kKdF15Y
 4id2qTTaZDFO7jfX6KFQIRxIWz4se7AtQJdUCcAy9OXFAAF+MZhDsxUoINuPaIYDvPtB
 BiPg==; darn=gnu.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=cfa.harvard.edu; s=google; t=1785721696; x=1786326496; darn=gnu.org;
 h=content-type:to:subject:message-id:date:from:mime-version:from:to
 :cc:subject:date:message-id:reply-to:content-type;
 bh=D7Uq7oVzvRs0k61EX2Oi+xk4/aZsiNG/sXLmVQOdC0E=;
 b=MCn60+VVeeRgZg7YKDTFuazF9dX7fpbGboRjLrCSXXnB8AB6ZnpLOBHFeFoG4K9eTh
 vk2igTagzIzespunPJlhkmgN7aLDwWggslxQU2vgjGE/GduVhE9/a9Jt0D2aoecAP7ol
 5yMnLLGLx+S2WE1yliwwenn+qg9wGH9gsGejEAB0ytWYb2uyVEoOknnAeesFKOo5gJ+g
 XVzZQOgz00Uk7Z5L85pAWFFJWMkde6bdcqB6vdLIjJ0vtudQQ621j3iP25xLy8j6qRFI
 nbVvJVxY2wEnjLmvFYRqYFOAUs/QSvbuVv+srdfhjHezsVAqyUyhRI2U5V8zbbFMrKU7
 YaZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1785721696; x=1786326496;
 h=content-type:to:subject:message-id:date:from:mime-version:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
 :content-type;
 bh=D7Uq7oVzvRs0k61EX2Oi+xk4/aZsiNG/sXLmVQOdC0E=;
 b=PucSbDr2PCOOxbhM3BvGHqN1U8LhiUxKx0SOztnb/wHCvlk4TbT+sg1BynjaoWjll9
 E5PbvY49PcVErDfMyuyWU524vMq4jKHEP/IfuyBXL+qJ/Hn2Q0OqozCyPmQK92CGI4CW
 jHXWqRvkG0ja18JHWy95yrReu4noYuQsYKTkgMffLVEOtbUyEtCiaJ/UCIi+xZUagbAY
 Tmn2UhYf1fw998LCv23szLAFnyMEbAiDN0T6VRYECoNONqf4Jxrc1B6kXzTcXdAUrTyK
 ePm5Iv67zMIuWF2uNpj5o8c2f+jtLhHAA4TxZ/vzcODzQC5ieZIsjvpu+uLPGNZF6mUH
 ajmg==
X-Gm-Message-State: AOJu0YwQr9NXJErVaX9bf4DUWuKw7NLClKw26QI4SMfFVi0l7cfw/4rW
 Wp+Tb+5FMsOWesiKeT/OzdunyXATvK/xCdrs4krzca2MlILwQ09AF8E1Iacjpg9paUgHNMpfJI8
 xwQQ4O/Dm6PNrW19/ra72iOTUAifLG8k1Xu5QG9CPrDvoL0EzlnU=
X-Gm-Gg: AR+sD10EFbMpvwK0ASJS+zsrgPNXgwsCPtu5cqiqaeckd9r3CPc453dw7P5pprB2oqe
 TTfJU5hSHwT/OZzG0r4Clr7PijM7t+9i3Twud1egAecOmoffVkUpPtifrcNipolvR56eNOYaHC1
 3EYrqd3cRWuSOoWpLYmVOTsjSvBq0VUuijc+QSShGM1W/Jr/HhnXRlsUonIrvW8nAWjYpyX5+11
 jLiIIrMxVeieS8L8WI6ThNdp/fFlxqbd/62NcPQ/7J7llBXPzboe6OtY2/JtdbuAznKaM/u2Kmz
 mdy/jaQerpSgVULKhrUby+NLUTkd+KqS4eLXq6fE++4nl1M0A1xYt5f6GO2vpiNjYeneAUrpzlj
 T+NEfsNJpYBRH8b/KchBpQGwZybGxVJPCfDsS3Rvaz4FO
X-Received: by 2002:a05:622a:580c:b0:517:63df:91a5 with SMTP id
 d75a77b69052e-52b4c5dc695mr179346551cf.19.1785721696500; Sun, 02 Aug 2026
 18:48:16 -0700 (PDT)
MIME-Version: 1.0
From: "Fine, Thomas" <tfine@HIDDEN>
Date: Sun, 2 Aug 2026 21:48:04 -0400
X-Gm-Features: AUfX_mwTUAAJphaAMKkZP7VUYQ2VDO514PPcjQVi1cgXJDTqHpDBMhvjs-eDbss
Message-ID: <CANVEBdgrBenRGEvKMH2Dcp9tCc_nRtAVcQhA6Ha5T9nPONpHZQ@HIDDEN>
Subject: Script-breaking changes to "sum" command
To: bug-coreutils@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000634df706581abba1"
Received-SPF: pass client-ip=2607:f8b0:4864:20::82c;
 envelope-from=tfine@HIDDEN; helo=mail-qt1-x82c.google.com
X-Spam_score_int: -19
X-Spam_score: -2.0
X-Spam_bar: --
X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 03 Aug 2026 00:42:36 -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.1 (/)

--000000000000634df706581abba1
Content-Type: text/plain; charset="UTF-8"

At some point between 8.3 and 9.5, the behavior of the sum command changed.

It used to not print the filename, when only one file was checked.
Now it always prints the filename no matter what.

Scripts which compare checksums of individual files are now broken because
they don't expect to see a filename there, and therefore the checksums of
two different files no longer match.

This is breaking scripts.  It should have been added as an option for the
future to preserve script behavior, but, failing that, at least an option
should have been added to make for a trivial fix for scripts.

--000000000000634df706581abba1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">At some point between 8.3 and 9.5, the behavior of the sum=
 command changed.<div><br>It used to not print the filename, when only one =
file was checked.</div><div>Now it always prints the filename no matter wha=
t.</div><div><br></div><div>Scripts which compare checksums of individual f=
iles are now broken because they don&#39;t expect to see a filename there, =
and therefore the checksums of two different files no longer match.</div><d=
iv><br>This is breaking scripts.=C2=A0 It should have been added as an opti=
on for the future to preserve script behavior, but, failing that, at least =
an option should have=C2=A0been added to make for a trivial fix for scripts=
.</div></div>

--000000000000634df706581abba1--




Acknowledgement sent to "Fine, Thomas" <tfine@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#81541; Package coreutils. 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: Fri, 7 Aug 2026 02:30:02 UTC

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