Subject: bug#19725: closed (Re: bug#19725: Correction for md5sum manual page)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 29 Jan 2015 19:09:02 +0000

Your bug report

#19725: Correction for md5sum manual page

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19725: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19725
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19725: Correction for md5sum manual page
From: Pádraig Brady <[email-masked]>
To: Terry Hoye <[email-masked]>, [email-masked]
Date: Thu, 29 Jan 2015 19:08:46 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On 29/01/15 16:11, Terry Hoye wrote:
> 
> Regarding GNU coreutils 8.12.197-032bb    September 2011,
> man md5sum states in part:
> [quote]
> The sums are computed as described in RFC  1321.   When  checking,  the
> input  should  be a former output of this program.  The default mode is
> to print a line with checksum, a character  indicating  type  (`*'  for
> binary, ` ' for text), and name for each FILE.[/quote]
> 
> I think I am correct in the following observation:
> Taken literally, the second sentence is incorrect. The default mode has
> two characters, often both spaces, between the two stringsets.

True.
The attached should make this more accurate.

> I don't think the algorithm works correctly with only one space between the stringsets.

Well --check still works in this case as it's switching
to "bsd reversed" mode. I.E. supporting the output from `md5 -r` etc.
I've made this clearer also, in the info docs.

thanks,
Pádraig.

From ecc8f8104893f1eaae8a8e7e3e55c8c42f4c7206 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email-masked]>
Date: Thu, 29 Jan 2015 18:44:41 +0000
Subject: [PATCH] doc: clarify the output format for the *sum utilities

* src/md5sum.c (usage): Detail the reasons for the default
double space between checksum and file name.
* doc/coreutils.texi (md5sum invocation): Likewise.
Explicitly mention the 3 formats that --check supports.

Fixes http://bugs.gnu.org/19725
---
 doc/coreutils.texi | 15 ++++++++++-----
 src/md5sum.c       |  6 +++---
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 99c7df3..0a82b65 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -4057,8 +4057,11 @@ consistent.  Synopsis:
 md5sum [@var{option}]@dots{} [@var{file}]@dots{}
 @end example
 
-For each @var{file}, @samp{md5sum} outputs the MD5 checksum, a flag
-indicating binary or text input mode, and the file name.
+For each @var{file}, @samp{md5sum} outputs by default, the MD5 checksum,
+a space, a flag indicating binary or text input mode, and the file name.
+Binary mode is indicated with @samp{*}, text mode with @samp{ } (space).
+Binary mode is the default on systems where it's significant,
+otherwise text mode is the default.
 If @var{file} contains a backslash or newline, the
 line is started with a backslash, and each problematic character in
 the file name is escaped with a backslash, making the output
@@ -4089,9 +4092,11 @@ Read file names and checksum information (not data) from each
 whether the checksums match the contents of the named files.
 The input to this mode of @command{md5sum} is usually the output of
 a prior, checksum-generating run of @samp{md5sum}.
-Each valid line of input consists of an MD5 checksum, a binary/text
-flag, and then a file name.
-Binary mode is indicated with @samp{*}, text with @samp{ } (space).
+Three input formats are supported.  Either the default output
+format described above, the @option{--tag} output format,
+or the BSD reversed mode format which is similar to the default mode,
+but doesn't use a character to distinguish binary and text modes.
+@sp 1
 For each such line, @command{md5sum} reads the named file and computes its
 MD5 checksum.  Then, if the computed message digest does not match the
 one on the line with the file name, the file is noted as having
diff --git a/src/md5sum.c b/src/md5sum.c
index a60e2ff..8c5f876 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -206,9 +206,9 @@ The following four options are useful only when verifying checksums:\n\
       printf (_("\
 \n\
 The sums are computed as described in %s.  When checking, the input\n\
-should be a former output of this program.  The default mode is to print\n\
-a line with checksum, a character indicating input mode ('*' for binary,\n\
-space for text), and name for each FILE.\n"),
+should be a former output of this program.  The default mode is to print a\n\
+line with checksum, a space, a character indicating input mode ('*' for binary,\
+\n' ' for text or where binary is insignificant), and name for each FILE.\n"),
               DIGEST_REFERENCE);
       emit_ancillary_info (PROGRAM_NAME);
     }
-- 
2.1.0

Subject: Correction for md5sum manual page
From: Terry Hoye <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Thu, 29 Jan 2015 16:11:57 +0000 (UTC)
List-Id: <debbugs-submit.debbugs.gnu.org>

Regarding GNU coreutils 8.12.197-032bb    September 2011, 
man md5sum states in part:
[quote]
The sums are computed as described in RFC  1321.   When  checking,  the
input  should  be a former output of this program.  The default mode is
to print a line with checksum, a character  indicating  type  (`*'  for
binary, ` ' for text), and name for each FILE.[/quote]
I think I am correct in the following observatiion:
Taken literally, the second sentence is incorrect. The default mode has
two characters, often both spaces, between the two stringsets.
I don't think the algorithm works correctly with only one space between the stringsets.
Regards,TJ Hoye