Bug 788641
| Summary: | virt-edit doesn't preserve file permissions | |||
|---|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Richard W.M. Jones <rjones> | |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> | |
| Status: | CLOSED UPSTREAM | QA Contact: | ||
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | unspecified | CC: | mbooth, virt-maint | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 788642 (view as bug list) | Environment: | ||
| Last Closed: | 2012-02-09 18:34:41 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: | 788642 | |||
Are there other tools which don't and should preserve permissions? The answer to comment 1 appears to be 'no'. Patch posted upstream which preserves file mode, UID, GID and SELinux context: https://www.redhat.com/archives/libguestfs/2012-February/msg00033.html This will be fixed upstream in 1.17.6. |
Description of problem: virt-edit creates a new file when it is used. Unfortunately this means that the old file's permissions, SELinux context etc are lost. virt-edit should preserve all of this by copying it from the old file to the new file. Version-Release number of selected component (if applicable): 1.17.5 How reproducible: 100% Steps to Reproduce: This reproducer uses the phony Fedora test image from libguestfs, but any Linux guest image would do. $ cd libguestfs $ cp tests/guests/fedora.img /tmp $ ./run ./fish/guestfish -a /tmp/fedora.img -i \ write /test "hello" : chmod 0600 /test : ll /test $ ./run ./edit/virt-edit -a /tmp/fedora.img /test -e 's/hello/goodbye/' $ ./run ./fish/guestfish -a /tmp/fedora.img -i \ ll /test : cat /test : rm /test Actual results: The commands above print: -rw------- 1 root root 5 Feb 8 17:14 /sysroot/test -rw-r--r-- 1 root root 7 Feb 8 17:15 /sysroot/test goodbye which shows that the permissions have changed. Expected results: Permissions, SELinux context etc should be preserved. Additional info: