Bug 1477196 - rpm removes files from newly installed/updated packages
rpm removes files from newly installed/updated packages
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm (Show other bugs)
6.9
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: packaging-team-maint
BaseOS QE Security Team
:
Depends On:
Blocks: 1499211 1477214
  Show dependency treegraph
 
Reported: 2017-08-01 08:53 EDT by pstodulk
Modified: 2017-10-10 10:10 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1477214 (view as bug list)
Environment:
Last Closed: 2017-10-10 10:10:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
dummy-1.0-1.fc26.noarch.rpm (6.56 KB, application/x-rpm)
2017-08-01 08:54 EDT, pstodulk
no flags Details
dummy-1.0-2.fc26.noarch.rpm (6.74 KB, application/x-rpm)
2017-08-01 08:55 EDT, pstodulk
no flags Details
log (6.53 KB, text/plain)
2017-08-01 08:56 EDT, pstodulk
no flags Details

  None (edit)
Description pstodulk 2017-08-01 08:53:01 EDT
Description of problem:
During transaction can be removed files from new packages, when new package contains symlink to directory, which contains files that corespond to files inside packages removed during transaction. Example:

old rpm:
/usr/share/dummy
/usr/share/dummy/subdir
/usr/share/dummy/subdir/dummy_file

new rpm:
/usr/share/dummy
/usr/share/dummy/dummy_file
/usr/share/dummy/subdir

Where the last one is symlink:
/usr/share/dummy/subdir -> .

In that case the /usr/share/dummy/dummy_file file will be removed during removing of the old_rpm.

How reproducible:
always

Steps to Reproduce:
1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 
2  # rpm --upgrade dummy-1.0-2.fc26.noarch.rpm
3. # rpm -V dummy

- attached dummy rpms


Actual results:
1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 
2  # rpm --upgrade dummy-1.0-2.fc26.noarch.rpm
3. # rpm -V dummy
missing     /usr/share/dummy/dummy_file


Expected results:
1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 
2  # rpm --upgrade dummy-1.0-2.fc26.noarch.rpm
3. # rpm -V dummy

(all files are installed correctly)

Additional info:
The new_rpm rpm contains %pre section, which removes the
/usr/share/dummy/subdir directory in case that exists, so symlink can be
created correctly.
Comment 1 pstodulk 2017-08-01 08:54 EDT
Created attachment 1307554 [details]
dummy-1.0-1.fc26.noarch.rpm
Comment 2 pstodulk 2017-08-01 08:55 EDT
Created attachment 1307555 [details]
dummy-1.0-2.fc26.noarch.rpm
Comment 3 pstodulk 2017-08-01 08:56 EDT
Created attachment 1307556 [details]
log

debug log from upgrade transaction.
Comment 4 Panu Matilainen 2017-08-22 10:06:32 EDT
> Additional info:
> The new_rpm rpm contains %pre section, which removes the
> /usr/share/dummy/subdir directory in case that exists, so symlink can be
> created correctly.

You need to you %pretrans for such a thing. %pre happens long long after rpm has calculated what it needs to do in the transaction and cannot change its mind if scripts (re)move things behind its back.
Comment 5 Panu Matilainen 2017-08-23 07:02:48 EDT
This differs from bug 1477214 in that rpm in rhel-6 doesn't yet detect the directory <-> symlink conflicts so you don't get an early warning, but the need to use %pretrans instead of %pre is just the same regardless.

I dont think we want to try backporting the conflict stuff to rhel-6 at this point of its life cycle, but leaving this open for a bit just in case.
Comment 6 Red Hat Bugzilla Rules Engine 2017-10-10 10:10:08 EDT
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

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