Bug 51611 - rpm silently ignores checking md5 sums on files
Summary: rpm silently ignores checking md5 sums on files
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-12 22:44 UTC by Bryce Nesbitt
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-02-03 19:39:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Bryce Nesbitt 2001-08-12 22:44:08 UTC
Description of Problem:
	rpm --verify does not seem to actually check file checksums

How Reproducible:
	100%

Steps to Reproduce:
1.  "rpm -q -l gcc" to get a list of files.
2.  Modify a few files.  Delete or rename a few.
3.  "rpm --verify gcc"

Actual Results:
	[root@headnet bryce]# rpm --verify gcc
	missing    /usr/share/doc/gcc-2.96/README.DWARF

Expected Results:
	Should have reported md5 checksum errors for the files I modified

Comment 1 Jeff Johnson 2001-08-12 23:30:37 UTC
Hmmm, rpm-4.0.3-0.90 verifies md5 sums for me.

What version of rpm?
What platform?
What package did you verify? Try the rpm package ...
What files did you modify? Try adding a line to /usr/lib/rpm/macros ...

Comment 2 Jeff Johnson 2002-02-02 16:40:44 UTC
Closed for lack of input.

Comment 3 Bryce Nesbitt 2002-02-03 15:43:13 UTC
RPM version 4.0.3
Linux HardHat 2.4.9-21

"rpm -q -l gcc" to find a file that's in the package.
Then, say, "vi /usr/share/doc/gcc-2.96/README.FRESCO".
And rpm --verify gcc

You've modified a file, asked rpm to verify the package, and rpm gives not a
whimper.
It's not actually verifying anything.

Please reopen.

Comment 4 Jeff Johnson 2002-02-03 15:52:19 UTC
If you do "rpm -Va", you will see that rpm is, indeed,
verifying md5 sums on files.

Specific example in a moment ...

Comment 5 Bryce Nesbitt 2002-02-03 16:00:52 UTC
Ok, but how do you get it to verify one package?  And why does rpm -V gcc
pretend
that gcc is ok?

Comment 6 Jeff Johnson 2002-02-03 16:02:10 UTC
bash$ rpm -qf /etc/ftphosts
wu-ftpd-2.6.1-18
bash$ rpm -V wu-ftpd
..?..... c /etc/ftpaccess
..?..... c /etc/ftpconversions
..?..... c /etc/ftpgroups
..?..... c /etc/ftphosts
..?..... c /etc/ftpusers
S.5....T c /etc/xinetd.d/wu-ftpd
#===> Note: I forgot to run a s root, the file is unreadable, so '?' is
displayed
bash$ sudo vi /etc/ftphosts
#===> single line added        
bash$ sudo rpm -V wu-ftpd
S.5....T c /etc/ftphosts
S.5....T c /etc/xinetd.d/wu-ftpd
#===> Note: this time I remembered to run as root, '5' indicates MD5 check
failed
bash$ sudo vi /etc/ftphosts
#===> line deleted
bash$ sudo rpm -V wu-ftpd
.......T c /etc/ftphosts
S.5....T c /etc/xinetd.d/wu-ftpd
#===> Note: the lack of '5' indicates that MD5 sums match, but 'T' indicates
mfile modified


Comment 7 Jeff Johnson 2002-02-03 16:04:56 UTC
Sorry, I clobbered your response.

Dunno your gcc package, but try the steps above
to figger what's up. FWIW, I'm running rpm-4.0.4-0.27,
dunno if that makes a difference.

There's also "rpm -Vf /etc/ftphosts", i.e. verify the package
that contains the file specified.

Comment 8 Bryce Nesbitt 2002-02-03 16:21:32 UTC
wu-fpt works for me.
Same steps on gcc (and other packages) fail.

Try gcc.

Comment 9 Jeff Johnson 2002-02-03 16:41:09 UTC
Works for me on a file in the gcc package:

yarmouth:/usr/bin 644 bash$ rpm -Vf /usr/bin/gcc
yarmouth:/usr/bin 645 bash$ rpm -V gcc
yarmouth:/usr/bin 646 bash$ rpm -qf gcc
gcc-3.1-0.18
yarmouth:/usr/bin 647 bash$ sudo mv gcc gcc-SAVE
yarmouth:/usr/bin 648 bash$ sudo cp /dev/null gcc
yarmouth:/usr/bin 649 bash$ rpm -Vf gcc
SM5....T   /usr/bin/gcc
yarmouth:/usr/bin 650 bash$ sudo mv gcc-SAVE gcc
yarmouth:/usr/bin 651 bash$ rpm -Vf gcc

Note: The file you have chosen may very well have
disabled file md5 verification in packaging using
a directive like
	%verify(not md5)

That's a whole different problem.


Comment 10 Jeff Johnson 2002-02-03 17:08:34 UTC
SInce I don't see a general problem with rpm, I'm gonna
close this bug. Feel free to reopen new bugs against
specific packages i.e. the package that's displayed
if/when you do
	rpm -qf /you/file/path/here
if you still think that there's an MD5 verification
problem.

Comment 11 Bryce Nesbitt 2002-02-03 19:07:34 UTC
New bug report angle then:
	rpm --verify leads to false sense of security.  If md5 sum has been
	disabled, it should so indicate.
If --verify is not actually checking anything, why should it be telling me
everything is fine?
As a user of rpm I need to understand what's been checked and verified OK, and
what's
not been checked at all.

I just checked with wu-ftp, changing a few characters in:
	/usr/share/doc/wu-ftpd-2.6.1/ERRATA
And again, rpm claims there is no md5 error.



Comment 12 Jeff Johnson 2002-02-03 19:13:58 UTC
Hmmm, you comment might just as easily read
	Believing that md5 sums provide security is fooling yourself.

rpm is just a tool, it does what it does, no more, no less. Yes, rpm-4.1,
will do mandatory signature checking on headers that contain MD5
sums, that's a slightly less foolish approach, but then one reaches the
problem of
	How does one know that a public key is valid?


Comment 13 Bryce Nesbitt 2002-02-03 19:39:31 UTC
Sure, there are two layers of analysis.

The first level is the tool, and clearly the tool needs fixing if it leads a
user
to think a MD5 sum has been checked, when it has not been.
Either get rid of the MD5 sum feature or make it work for all files all the time
(indicating, somehow, what was checked and what was not).  You could at
the very very least document that --verify might not actually even try to
check certain files.  The man page gives no hint of this issue.

The deeper level of analysis is not up to the tool - what's an MD5 sum worth?

Comment 14 Jeff Johnson 2002-02-03 19:50:31 UTC
Short term answer:
	Not gonna happen.

I've already indicated what the longer term answer is.


Comment 15 Bryce Nesbitt 2002-02-04 14:48:23 UTC
Oh well.  It sucks that a tool that lies to me about what it did.


Note You need to log in before you can comment on or make changes to this bug.