Bug 1098706

Summary: livecd-creator uses wrong command line for setfiles
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: adam.stokes, bcl, bruno, dhuff, dwalsh, Jasper.Hartline, katzj, mgrepl, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: policycoreutils-2.3-4.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-20 10:13:11 UTC Type: Bug
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 Flags
p2v.ks none

Description Richard W.M. Jones 2014-05-17 13:51:23 UTC
Description of problem:

When you run livecd-creator in Rawhide, it now prints:

usage:  /sbin/setfiles [-dilnpqvFW] [-e excludedir] [-r alt_root_path] spec_file pathname...
usage:  /sbin/setfiles [-dilnpqvFW] [-e excludedir] [-r alt_root_path] spec_file -f filename
usage:  /sbin/setfiles -s [-dilnpqvFW] spec_file
usage:  /sbin/setfiles -c policyfile spec_file

(It appears otherwise unaffected, and runs to completion, but I
guess SELinux labelling will be broken in the final image)

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

livecd-tools-21.1-1.fc21.x86_64
policycoreutils-2.3-2.fc21.x86_64

How reproducible:

100%

Steps to Reproduce:
1. livecd-creator some-kickstart

Comment 1 Richard W.M. Jones 2014-05-17 13:53:26 UTC
Created attachment 896601 [details]
p2v.ks

The actual kickstart I'm using.  Note I used the same kickstart
with Fedora 20 livecd-creator and it didn't print the error message.

Comment 2 Brian Lane 2014-05-19 22:07:13 UTC
I don't see anything wrong, it is trying to label the installation's root directory like this:

/sbin/setfiles -F -r /var/tmp/imgcreate-onIL3V/install_root /etc/selinux/targeted/contexts/files/file_contexts /var/tmp/imgcreate-onIL3V/install_root/

which works fine on F20, and there is no change in the setfiles documentation or help output.

Comment 3 Miroslav Grepl 2014-05-20 10:07:23 UTC
I found a bug in rawhide setfiles.

You can use 
/sbin/setfiles -F -r /var/tmp/imgcreate-onIL3V/install_root /etc/selinux/targeted/contexts/files/file_contexts /var/tmp/imgcreate-onIL3V/install_root/ /var/tmp/imgcreate-onIL3V/install_root/


for now and it should work. I have a patch which fixes this issue back on

/sbin/setfiles -F -r /var/tmp/imgcreate-onIL3V/install_root /etc/selinux/targeted/contexts/files/file_contexts /var/tmp/imgcreate-onIL3V/install_root/
/var/tmp/imgcreate-onIL3V/install_root: No such file or directory

in my case.

Comment 4 Richard W.M. Jones 2014-05-20 10:30:48 UTC
Thanks.  No need to workarounds in livecd-creator, as I will
just update policycoreutils to the fixed version on my build host.