Bug 1122907

Summary: SELinux relabel is not working properly and preventing NetworkManager from writing /etc/resolv.conf
Product: [Fedora] Fedora Reporter: Renich Bon Ciric <renich>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: mbooth, ptoscano, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-24 11:35:58 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:

Description Renich Bon Ciric 2014-07-24 11:24:41 UTC
Description of problem:
I am using virt-builder to build a CentOS Guest. I enabled selinux relabel but it's not working properly. /etc/resolv.conf ends up with an etc_t label; while it should have a net_conf_t label.

Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.26.5-1.fc20.x86_64

How reproducible:
First remove lines 34-36 on https://github.com/renich/gce-images-centos/blob/master/virt-builder/setup

Then, build with (until line 80):
https://github.com/renich/gce-images-centos/blob/master/virt-builder/build

Actual results:
My /etc/resolv.conf has the wrong label.

Comment 1 Pino Toscano 2014-07-24 11:35:58 UTC
This is the same as bug #1089100, and it is now being marked as duplicated of it.

As a workaround, you should be able to get proper SELinux labels by using virt-customize with no network, i.e.:
  $ virt-customize --selinux-relabel --no-network -a yourimage

*** This bug has been marked as a duplicate of bug 1089100 ***