Bug 494640
Summary: | Symlinks are removed when listed as %_netsharedpath | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Olivier Fourdan <ofourdan> | ||||||||||||
Component: | rpm | Assignee: | Florian Festi <ffesti> | ||||||||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> | ||||||||||||
Severity: | medium | Docs Contact: | |||||||||||||
Priority: | medium | ||||||||||||||
Version: | 5.3 | CC: | cww, david.goldberg6, ffesti, jplans, kabbott, kem, pmatilai, syeghiay | ||||||||||||
Target Milestone: | rc | Keywords: | Reopened | ||||||||||||
Target Release: | --- | ||||||||||||||
Hardware: | All | ||||||||||||||
OS: | Linux | ||||||||||||||
Whiteboard: | |||||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||
Clone Of: | Environment: | ||||||||||||||
Last Closed: | 2011-08-23 12:10:51 UTC | Type: | --- | ||||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||||
Documentation: | --- | CRM: | |||||||||||||
Verified Versions: | Category: | --- | |||||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||
Embargoed: | |||||||||||||||
Bug Depends On: | |||||||||||||||
Bug Blocks: | 668957 | ||||||||||||||
Attachments: |
|
Created attachment 338537 [details]
Test package to reproduce the issue (release 1)
This is the first package to install, as described in the reproducer steps.
Created attachment 338538 [details]
Test package to reproduce the issue (release 2)
The test package to upgrade, after havong replaced one of the directories by a symlink, as described in the reproducer steps.
Created attachment 338539 [details]
Source rpm of the above reproducer help package
Created attachment 338540 [details]
Source of the updated version
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. This is an issue for us. /usr/local is a symbolic link to a network share (actually AFS but that's not relevant). I was told about this bug in response to a customer service ticket (#1923712) and sure enough, adding /usr/local:/var/spool/mail as %_netsharedpath allows the filesystem package to install but removes the link. We have a workaround as our cfengine configuration replaces the link but would prefer to allow rhnsd to handle updates rather than running yum update through cfengine to avoid a gap. If it is possible to fix, please do. Thanks. The issue is that %_netsharedpath as currently implemented doesn't work "after the fact". In order to function as expected, %_netsharedpath needs to be in effect when the package is first installed. This way the "skipnetshared" state gets recorded into rpmdb and erasure (on upgrade or otherwise) knows to leave it alone. Getting %_netsharedpath defined for initial install in anaconda might be tricky/impossible, I dont remember the exact details of what can be done in kickstart %pre. It should be possible to work around it later with something like # echo "%_netsharedpath /usr/local:/var/spool/mail" > /etc/rpm/macros.netshared # rpm -e --justdb --nodeps filesystem # rpm -Uvh /path/to/filesystem.rpm Right now filtering files in netsharedpath is done in skipFiles() (transaction.c) which is only run for to be installed packages as it also filters for other cases. Solution is to move the netsharedpath into an own function that is run for all packages.h This request was evaluated by Red Hat Product Management for inclusion, but this component is not scheduled to be updated in the current Red Hat Enterprise Linux release. If you would like this request to be reviewed for the next minor release, ask your support representative to set the next rhel-x.y flag to "?". This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. NAK. This has been fixed upstream but backporting the largish patch to the old and rather different rpm codebase in RHEL 5 is too risky at this point. The rpm version in RHEL 6 does include the fix for this issue though, closing NEXTRELEASE. |
Created attachment 338536 [details] Proposed patch Description of problem: Specifying a directory as %_netsharedpath in /etc/rpm/macros.nfs can avoid breaking the upgrade of a package that accesses that path, but if the path is replaced by a symlink, the symlink is removed during the upgrade which is not expected either. Version-Release number of selected component (if applicable): rpm-4.4.2.3 How reproducible: 100% reproducible Steps to Reproduce: 1. install the test package provided, that wil lcreate the following directories: /opt/myfs/dir{1,2,3,4,5} 2. replace one of the direcotries by a symlink to an NFS mounted directory mv /opt/myfs/dir1 /opt/myfs/dir1.orig && ln -s /test /opt/myfs/dir1 3. Add /opt/myfs/dir1 among to the list of netsharedpath in /etc/rpm/macros.nfs echo '%_netsharedpath /opt/myfs/dir1' > /etc/rpm/macros.nfs 4. Upgrade the test package myfs rpm -Uvh myfs-1.0.0-2.i386.rpm Actual results: The link /opt/myfs/dir1 has been removed Expected results: The link /opt/myfs/dir1 is left untouched Additional info: The link is removed in lib/fsm.c by fsmStage(). The proposed patch checks if the link is actually listed as netsharedpath and skip its removal if listed. Please note that even if this patch works, it may have other side effects that I might not have overseen :)