i386/67773: 5.x series - md5 on dev no longer works e.g. md5
/dev/ad2
Bruce Evans
bde at zeta.org.au
Thu Jun 10 10:20:18 GMT 2004
The following reply was made to PR i386/67773; it has been noted by GNATS.
From: Bruce Evans <bde at zeta.org.au>
To: Dan Fletcher <drfmail at swbell.net>
Cc: freebsd-gnats-submit at freebsd.org, freebsd-i386 at freebsd.org
Subject: Re: i386/67773: 5.x series - md5 on dev no longer works e.g. md5
/dev/ad2
Date: Thu, 10 Jun 2004 20:17:54 +1000 (EST)
On Thu, 10 Jun 2004, Dan Fletcher wrote:
> >Description:
> I work computer forensics for a law enforcement agency. I use FreeBSD extensively. Tried to upgrade to 5.x series for the SATA support. However the md5 checksum no longer works on raw devices. I have tried it with 5.0 and 5.2.1, neither work.
>
> Worked fine with 4.x series.
>
> cksum of a raw device works fine, e.g.
> cksum /dev/ad2
> >How-To-Repeat:
> Try to md5 checksum any raw device:
>
> md5 /dev/fd0
> md5 /dev/ad2, etc.
This seems to have been broken in at least rev.1.14 of libmd/mdXhl.c
by using fstat() to determine a wrong size for the file. fstat() only
gives the file size for regular files that don't change while being
read. Pipes are handled differently, so the breakage doesn't affect
them. Regular files that change while being read aren't handled very
well anyway.
As a workaround, pipe the file to md5 (e.g., cat /dev/ad2 | md5).
Bruce
More information about the freebsd-i386
mailing list