Public bug reported:

The output of GNU sha256sum --check (or -c), and related tools (i.e., sha1sum,
sha224sum, sha384sum, and sha512sum) depends on the order of the --quiet and
--warn options.  This is counter-intuitive, not documented in the man(1) pages,
and unnecessary.

Simple example:

  1$ date >/tmp/data
  2$ sha256sum /tmp/data >/tmp/sums
  3$ sha256sum -c --warn --quiet /tmp/sums    # No output (expected)
  4$ sha256sum -c --quiet --warn /tmp/sums    # Unexpected "Ok"...
  /tmp/data: OK
  5$ 

The manual page says (spurious lines omitted):

   The following five options are useful only when verifying checksums:
     --quiet       don't print OK for each successfully verified file
     -w, --warn    warn about improperly formatted checksum lines

There is no reason --warn should affect the operation of --quiet (nor
visa-versa).  The operations as documented are orthogonal.

Attached is a bash(1) shell script written when puzzling over this
inconsistent behaviour; it may be useful (use --help for a summary).

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: coreutils 8.30-3ubuntu2
ProcVersionSignature: Ubuntu 5.4.0-52.57-generic 5.4.65
Uname: Linux 5.4.0-52-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.10
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Fri Oct 30 21:34:31 2020
InstallationDate: Installed on 2020-10-19 (11 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: coreutils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

** Attachment added: "GNU Bash(1) script to show various differing behaviours 
(--help for summary)"
   
https://bugs.launchpad.net/bugs/1902311/+attachment/5429603/+files/sha-sum-chk.sh

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1902311

Title:
  GNU sha256(1) &tc --check (-c) output depends on order of --quiet and
  --warn

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1902311/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to