Bug 147926 - dhclient-script creates new conf files with wrong selinux label
dhclient-script creates new conf files with wrong selinux label
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
Depends On:
  Show dependency treegraph
Reported: 2005-02-12 20:26 EST by Ulrich Drepper
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-04 19:54:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
add chcon calls (1.40 KB, patch)
2005-02-12 20:26 EST, Ulrich Drepper
no flags Details | Diff

  None (edit)
Description Ulrich Drepper 2005-02-12 20:26:26 EST
Description of problem:
The dhclient-script creates a number of conf files from scratch after moving
exsting files aside.  This has the problem that the SELinux context is wrong for
the new files.  The result is that programs like ypbind cannot read the files.

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

How reproducible:

Steps to Reproduce:
1.define nis-domain and nis-servers in dhcp on server
2.start machine which uses that dhcp server
3.start ypbind on the client machine
Actual results:
ybind fails because it cannot read /etc/yp.conf

Expected results:
all works as expects

Additional info:
I'll attach a patch which works for me.
Comment 1 Ulrich Drepper 2005-02-12 20:26:26 EST
Created attachment 111032 [details]
add chcon calls
Comment 2 Jason Vas Dias 2005-02-13 14:20:31 EST
Thanks - I have SELinux enabled on my FC3 & RHEL-4
test systems, not on my FC4 test system - this will
now change. 
I'll make changes to restore the file contexts of 
configuration files changed by dhclient-script as you
suggest, but we can't assume that /usr has been mounted
when this script is run, so I'll use /sbin/restorecon
instead of /usr/bin/chcon . Also, we can't assume 
the *.predhclient files have the correct context to 
start with, nor that when dhclient is run, the selinux
policy has yet been configured, so after changing /etc/yp.conf, 
for example, I'll do: 
  [ -x /sbin/restorecon ] && /sbin/restorecon /etc/yp.conf >/dev/null

Comment 3 Jason Vas Dias 2005-02-25 15:02:40 EST
This bug is now fixed in dhcp-3.0.1-40_FC3 / dhcp-3.0.2-2 (FC4).

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