md5sum broken?

Chuck Kuecker ckuecker at ckent.org
Sat May 29 14:39:22 UTC 2010


Robert P. J. Day wrote:
> On Sat, 29 May 2010, Chuck Kuecker wrote:
>
>   
>> The file that md5sum produced looks correct - a string of hex, and
>> the path to the file.
>>
>> Perhaps an "AHA" - if I run md5sum on the file, and I am not in the
>> directory with the file, the whole path and filename gets put into
>> the md5 file. If the build script uses a shorter path, the file
>> won't match.
>>
>> Experiment time. Moved into the directory with the patch file and
>> made another md5 file - the filename is now stripped of the absolute
>> path.
>>
>> That might be the problem, solved. I'll report back after the build
>> runs.
>>     
>
>   um, yup, that would definitely be a problem but it goes back to what
> i mentioned earlier.  (i'm not bored and looking for something to do,
> i'm just waiting for coffee to brew.)
>
>   you reproduced a diagnostic from your build system that read "Error:
> corrupt md5 file" or something to that effect.  but that's not what
> the problem was.  i tested md5sum just now with an erroneous filename
> and got:
>
> $ md5sum -c passwd.md5
> md5sum: passwd: No such file or directory
> passwd: FAILED open or read
> md5sum: WARNING: 1 of 1 listed file could not be read
> $
>
> which is exactly what the problem was, of course -- the filename as it
> was stored in the file was, technically, incorrect.  but that doesn't
> equate to a "corrupt" md5 file, so that's kind of a misleading
> diagnostic you're printing.
>
>   normally (at which point i wax philosophical), i would get my build
> system to generate a diagnostic corresponding to *precisely* why the
> md5 check failed -- failed match, missing file, corrupt md5 file --
> and print a diagnostic to match the error.  and, normally, i would use
> the exit code from the command to tell me.  sadly, as i look at the
> md5sum.c source, it's not helpful in that respect -- 0 for success, 1
> for failure.  at least as i read it.
>
>   you can still do it by grabbing the command output and grepping,
> that's also an option.
>
> rday
>
>   

The build is running now, and it got past the error. The path 
information in the md5 file was the culprit.

The error message I posted was from the ltib perl build script, not 
Ubuntu. Freescale supplied the script, and I have had to hack it - with 
Freescale's aid - to make it run on Ubuntu. They tested it on other 
distros, and there is just enough difference in Ubuntu to blow things up.

The fact that I am not fluent in perl does not help...

Thanks for letting me bounce the problem around.

Chuck Kuecker





More information about the ubuntu-users mailing list