Bug 145373 - RPM saves $file.rpmsave in incorrect mode
Summary: RPM saves $file.rpmsave in incorrect mode
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
(Show other bugs)
Version: 3.0
Hardware: All Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Whiteboard: impact=low,public=20050117,reported=2...
Keywords: Security
: 160259 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-01-17 20:38 UTC by Joshua Jensen
Modified: 2007-11-30 22:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-14 18:06:56 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Joshua Jensen 2005-01-17 20:38:52 UTC
Description of problem:

I removed the netdump-server package, but since I had changed the 
/var/crash/.ssh/authorized_keys2 file, it saved it as a .rpmsave file.
 This is good... but it saved it of mode 0644... not of the same mode
that the config file was from.  This seems to be a minor security hole:

[root@jjensen-lnx root]# cd /var/crash/.ssh/

[root@jjensen-lnx .ssh]# ls -l
total 8
-rw-------    1 netdump  netdump       616 Jan 17 15:32 authorized_keys2
-rw-------    1 root     root          616 Jan 17 15:28
authorized_keys2.premade-rw-r--r--    1 root     root            0 

Version-Release number of selected component (if applicable):

FC3, all updates

Comment 1 Joshua Jensen 2005-06-06 16:02:28 UTC

Comment 6 Paul Nasrat 2005-07-14 18:06:56 UTC
I checked the code we do rename() for this so I can't see how you can possibly
get this. Can't reproduce using below test on RHEL 3, RHEL 4 or rawhide.  Please
reopen if you come up with a clear reproducer:

1) Install netdump
ls -l
-rw-------  1 netdump netdump 0 Apr  6 11:51 authorized_k

2) cat /root/.ssh/id_dsa.pub >> /var/crash/.ssh/authorized_keys

ls -l
-rw-------  1 netdump netdump 606 Jul 14 13:54 authorized_key

3) Verify and then erase 

rpm -V netdump-server
S.5....T  c /var/crash/.ssh/authorized_keys2
rpm -e netdump-server
warning: /var/crash/.ssh/authorized_keys2 saved as

4) Check rpmsave
ls -l /var/crash/.ssh/authorized_keys2.rpmsave
-rw-------  1 netdump netdump 606 Jul 14 13:54

Comment 7 Paul Nasrat 2005-07-14 18:38:46 UTC
*** Bug 160259 has been marked as a duplicate of this bug. ***

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