Bug 192153
| Summary: | rpm escapes --root if it disappears | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Mike McLean <mikem> | ||||
| Component: | rpm | Assignee: | Panu Matilainen <pmatilai> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 4.0 | CC: | dgregor, mikeb, praiskup, wtogami | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-06-20 13:21:16 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: | |||||||
| Attachments: |
|
||||||
|
Description
Mike McLean
2006-05-17 22:05:04 UTC
Created attachment 129369 [details]
strace of rpm showing this issue
It looks like rpm may simply be ignoring the error code from a failed chroot:
chdir("/") = 0
chroot("/var/lib/mock//test/") = -1 ENOENT (No such file or directory)
time(NULL) = 1147903876
open("/var/tmp/rpm-tmp.61061", O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0666) = 8
in psm.c, chroot is called three times: in runScript, the return code is not checked in rpmpsmStage (two instances), the return code of the chroot is returned from the function, but I'm not sure how it is handled further up the line in transaction.c, chroot is called twice in the function rpmtsRun. The return code is not checked. jkeating mentioned that brew is using a patched rpm that avoids this problem. Is this true? No, brew is not using a patched rpm. Once we understood the nature of the problem, we were able to avoid triggering the bug. In most cases, there's little risk, as chroot is root-only, the build tree is owned by root.root and so cannot be removed, and the outer file system is owned root.root, etc. But yes, the chroot return code needs to be checked. Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. Please See https://access.redhat.com/support/policy/updates/errata/ If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue. |