Bug 1317180 - virt-sysprep fails with immutable files
virt-sysprep fails with immutable files
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-12 14:57 EST by Nicholas Westlake
Modified: 2016-09-20 03:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)

  None (edit)
Description Nicholas Westlake 2016-03-12 14:57:19 EST
Description of problem:
virt-systemprep fails with immutable files.

Version-Release number of selected component (if applicable):
virt-sysprep 1.24.5

How reproducible:
Calling virt-systemprep with an immutable file.

Steps to Reproduce:
1. Create a VM, e.g. Centos 6, with a raw disk image for /.
2. Make ~/.ssh/authorized_keys immutable for any user in the image using  chattr +i ~/.ssh/authorized_keys.
3. Shut down the vm. 
4. Call virt-systemprep on the hard drive image.

Actual results:
The step fails.

Expected results:
The process succeeds: with root access, the file could be removed, e.g. with chattr -i.

Additional info:
- I believe ssh-userdir was the one which causes it to fail.
- Note that rm -rf fails here too, even as root.
Comment 1 Richard W.M. Jones 2016-03-31 08:18:23 EDT
Link back to the upstream thread that discussed this:
https://www.redhat.com/archives/libguestfs/2016-March/thread.html#00104
Comment 2 Adam Ouadi 2016-09-19 04:48:41 EDT
Actually I've got the same problem with my VMWare exported ova files with an immutable resolv.conf

libguestfs error: command_lines: rename: /sysroot/etc/resolv.conf to /sysroot/etc/654d4atl: Operation not permitted
Comment 3 Richard W.M. Jones 2016-09-19 05:07:57 EDT
(In reply to Adam Ouadi from comment #2)
> Actually I've got the same problem with my VMWare exported ova files with an
> immutable resolv.conf
> 
> libguestfs error: command_lines: rename: /sysroot/etc/resolv.conf to
> /sysroot/etc/654d4atl: Operation not permitted

I have machines with immutable /etc/resolv.conf too -- the best way
to stop NetworkMangler etc etc from messing it up.

This is certainly a bug.
Comment 4 Adam Ouadi 2016-09-20 03:19:56 EDT
(In reply to Richard W.M. Jones from comment #3)

> This is certainly a bug.

Is there any workaround involving no change of my ova files ?
Comment 5 Richard W.M. Jones 2016-09-20 03:35:08 EDT
Not as far as I know.  It's a bug that needs to be fixed.

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