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

Bug#371856: Additional info on: "Check the CD-ROM(s) integrity" on a pre-beta3 CD



reassign 371856 cdrom-checker
retitle 371856 cdrom-checker: fails even though md5sums are correct
clone 371856 -1
reassign -1 busybox-udeb 1:1.1.3-2
retitle -1 md5sum: does not ignore empty lines in an md5sum "file"
severity -1 minor
tags 371856 + pending
thanks

On Saturday 05 August 2006 14:16, Holger Wansing wrote:
> I then noticed that this was already mentioned in this bugreport,
> so some more info here:

Well, it is only really mentioned in passing, but as there is no other 
report open about it (which surprises me) and as the other issues 
mentioned in the report seem already resolved, let's just use it...

> it seems that not the mentioned file 
> (dists/etch/main/binary-i386/Packages) is the problem, but the
> check routine itself.

Hmmm. If I change the C program the installer uses to not suppress error 
messages, I get:
./dists/etch/main/binary-i386/Packages OK
md5sum: WARNING: 1 of 2 computed checksums did NOT match
                     ^^^

So, I suspect that the C program is not cleanly passing the lines it reads 
from the md5sum.txt file.

Bingo! the variable read in from the file already contains a newline, so 
this patch fixes the problem:

-    asprintf(&cmd, "echo '%s' | md5sum -c 1>/dev/null 2>&1", line);
+    asprintf(&cmd, "echo -n '%s' | md5sum -c 1>/dev/null 2>&1", line);

Finally nailed this stupidest of bugs :-)

I wonder if this is a bug in md5sum, especially as this used to work with 
earlier versions (no idea when the regression was though)...
The bug can be reproduced using the following command for any md5sum file:
cat md5sum.txt | while read line; do echo -e "$line\n" | md5sum -c; done

Attachment: pgp4wXSYtLFv2.pgp
Description: PGP signature


Reply to: