bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] md5sum: handle carriage returns at the eol in input sum file


From: Eric Blake
Subject: Re: [PATCH] md5sum: handle carriage returns at the eol in input sum files
Date: Tue, 02 Mar 2010 08:16:21 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

According to Ondřej Vašík on 3/2/2010 8:03 AM:
> Hello,
> as reported in rhbz#569550 , md5sum (and all others sum utilities) fails
> to work with DOS md5 files. 
> 
> This issue was previously reported on this list as
> http://lists.gnu.org/archive/html/bug-coreutils/2004-11/msg00037.html ,
> http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00073.html ,
> but I haven't found patch solving this issue in those reports. 

Correct - it's been on my TODO list for years, but very low priority.

> 
> Attached patch should solve it and I don't see any negative side effects from 
> it.

Your patch breaks if a file name actually ended in a carriage return.  A
better patch would be to teach the *sum utilities to output carriage
return in filenames as \r by default but keep a flag for generating output
compatible with older *sum versions; parse both \r and literal carriage
return on input; and, if no \r occurs in input but a carriage return is
present, to try two filenames (one with trailing carriage return, one
without) before giving up.

But, given the rarity of file names that actually end in a literal
carriage return, your patch is certainly a step in the right direction.
I'll let others decide whether to apply it, but you have my +1.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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