bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

md5sum not being involked in recent sharutils


From: jayjwa
Subject: md5sum not being involked in recent sharutils
Date: Fri, 4 Nov 2005 04:44:56 -0500


[Versions:] sharutils-4.6, md5sum is from coreutils-5.92

[OS:] Linux atr2 2.4.31 #1 Wed Jun 8 21:13:55 EDT 2005 i686 GNU/Linux
No distro (source build), both sharutils-4.6 and coreutils-5.92
from GNU ftp server.

[Problem:]
At unshar time, either using "unshar" or something as "zsh -C test.shar",
md5sum is not being involked to check md5 sums of files when a working
md5sum exists from the recommended source (GNU Coreutils).

Ex1:

zsh -C shar-test.shar Note: not verifying md5sums. Consider installing GNU coreutils.
x - lock directory sh07318': created
x - extracting remsync.in (binary)
x - extracting Makefile.am (text)
x - lock directory sh07318':  removed

Ex2:

unshar shar-test.shar /tmp/shar-test.shar:
Note: not verifying md5sums.  Consider installing GNU coreutils.
x - lock directory sh07318': created
x - extracting remsync.in (binary)
x - extracting Makefile.am (text)
x - lock directory sh07318': removed


At build time, the files src/scripts.* seem to be trying to guess if md5sum'ing is available. They appear to do this by calling md5sum, then
grepping against a strict string match for the -c parameter:

if echo \"${f}\" | grep 'c, --check.*check MD5 sums against' >/dev/null\n\


However, md5sum --help says:


  Usage: md5sum [OPTION] [FILE]...
Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.

  -b, --binary            read in binary mode
  -c, --check             read MD5 sums from the FILEs and check them
  -t, --text              read in text mode (default)

The following two options are useful only when verifying checksums:
      --status            don't output anything, status code shows success
  -w, --warn              warn about improperly formatted checksum lines

      --help     display this help and exit
      --version  output version information and exit

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.

Report bugs to <address@hidden>.



With a string that is different enough to fail the grep test. Earlier
versions of md5sum may have matched this, as the problem didn't occure
with sharutils & coreutils in the versions before the ones referenced
here.

Since the functionality is the same, prehaps checking for something in the version strings would work better, for all versions.

md5sum (GNU coreutils) 5.92
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Ulrich Drepper and Scott Miller.



In order for the test to work now, the string would need to be:

if echo "${f}" | grep 'c, --check.*read MD5 sums from the FILEs and check them' 
>/dev/null



[Possible Fix:]
This patch fixed it on my system, simply changing the lines looked for in
the src/scripts.* files. diff -N -u -p0



--- scripts.def.orig    2005-08-13 14:15:34.000000000 -0400
+++ scripts.def 2005-11-02 18:30:52.000000000 -0500
@@ -68 +68 @@ text = {
-           if echo "${f}" | grep 'c, --check.*check MD5 sums against' 
>/dev/null
+           if echo "${f}" | grep 'c, --check.*read MD5 sums from the FILEs and 
check them' >/dev/null
--- scripts.x.orig      2005-11-02 18:44:38.000000000 -0500
+++ scripts.x   2005-11-02 18:45:22.000000000 -0500
@@ -81 +81 @@ then\n\
-    if echo \"${f}\" | grep 'c, --check.*check MD5 sums against' >/dev/null\n\
+    if echo \"${f}\" | grep 'c, --check.*read MD5 sums from the FILEs and check 
them' >/dev/null\n\


Ex3:


zsh -C new-test.shar x - lock directory sh30043': created
x - extracting mailshar (binary)
x - extracting remsync (binary)
x - lock directory sh30043':  removed


Likely there is a better fix for this, as I'm not very sure about the use of the src/scripts.* files, or which one (if any) make the others.


jay

--
   / /     __  __  __  __  __ __  __ mail me for my *
  / /__   / / /  \/ / / /_/ / \ \/ /  *  email address.
 /_____/ /_/ /_/\__/ /_____/  /_/\_\ ::[ATr2 RG 2005]::
-------------------------------------------------------

Attachment: sharutils-4.6-md5sum-says-something-else.patch.gz
Description: sharutils-4.6-md5sum-says-something-else.patch.gz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]