Bug 1317180 - virt-sysprep fails with immutable files
Summary: virt-sysprep fails with immutable files
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-12 19:57 UTC by Nicholas Westlake
Modified: 2018-07-18 14:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Nicholas Westlake 2016-03-12 19:57:19 UTC
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 12:18:23 UTC
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 08:48:41 UTC
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 09:07:57 UTC
(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 07:19:56 UTC
(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 07:35:08 UTC
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.