Bug 145373 - RPM saves $file.rpmsave in incorrect mode
RPM saves $file.rpmsave in incorrect mode
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
: Security
: 160259 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-01-17 15:38 EST by Joshua Jensen
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

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

Attachments (Terms of Use)

  None (edit)
Description Joshua Jensen 2005-01-17 15:38:52 EST
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 12:02:28 EDT
Comment 6 Paul Nasrat 2005-07-14 14:06:56 EDT
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 14:38:46 EDT
*** 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.