Bug 814116 - /etc/dhcp/dhclient.d/nis.sh: /etc/yp.conf: Permission denied
Summary: /etc/dhcp/dhclient.d/nis.sh: /etc/yp.conf: Permission denied
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ypbind
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Honza Horak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-19 09:31 UTC by Dennis Schridde
Modified: 2012-04-27 15:21 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-27 15:21:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 488865 0 low CLOSED selinux is preventing ntpd access to /etc/ntp.conf 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 593278 0 low CLOSED /etc/yp.conf is being created with the wrong context. 2021-02-22 00:41:40 UTC

Internal Links: 488865 593278

Description Dennis Schridde 2012-04-19 09:31:59 UTC
Description of problem:
/etc/network-scripts/ifcfg-eth0:
NM_CONTROLLED="no"
BOOTPROTO="dhcp"

# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0...mv: cannot move `/etc/yp.conf' to `/var/lib/dhclient/yp.conf.predhclient.eth0': Permission denied
/etc/dhcp/dhclient.d/nis.sh: line 55: /etc/yp.conf: Permission denied
/etc/dhcp/dhclient.d/nis.sh: line 63: /etc/yp.conf: Permission denied
 done.
                                                           [  OK  ]

Version-Release number of selected component (if applicable):
ypbind-1.20.4-29.el6.x86_64

Comment 2 Dennis Schridde 2012-04-19 09:37:08 UTC
See also: 593278 (I cannot update the bug form field - please add it there if you have the permission)

Comment 3 Dennis Schridde 2012-04-19 09:47:46 UTC
This seems to be a workaround:
# fixfiles onboot

Comment 4 Honza Horak 2012-04-19 11:24:58 UTC
Can you tell me what SELinux context /etc/yp.conf has when you're encountering the error?
$ ls -Z /etc/yp.conf

There are probably some SELinux messages in /var/log/messages related to this error. Can you provide them, please?

Comment 5 Dennis Schridde 2012-04-26 13:39:56 UTC
# ls -Z /etc/yp.conf
-rw-r--r--. root root system_u:object_r:etc_runtime_t:s0 /etc/yp.conf

# tail /var/log/messages

Apr 26 15:34:10 dumas NET[2892]: /sbin/dhclient-script : updated /etc/resolv.conf
Apr 26 15:34:10 dumas kernel: type=1400 audit(1335447250.324:5): avc:  denied  { rename } for  pid=2900 comm="mv" name="yp.conf" dev=sda2 ino=391693 scontext=unconfined_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file
Apr 26 15:34:10 dumas kernel: type=1400 audit(1335447250.400:6): avc:  denied  { write } for  pid=2858 comm="dhclient-script" name="yp.conf" dev=sda2 ino=391693 scontext=unconfined_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file
Apr 26 15:34:10 dumas kernel: type=1400 audit(1335447250.400:7): avc:  denied  { write } for  pid=2858 comm="dhclient-script" name="yp.conf" dev=sda2 ino=391693 scontext=unconfined_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file
Apr 26 15:34:10 dumas kernel: type=1400 audit(1335447250.401:8): avc:  denied  { append } for  pid=2858 comm="dhclient-script" name="yp.conf" dev=sda2 ino=391693 scontext=unconfined_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file
Apr 26 15:34:10 dumas kernel: type=1400 audit(1335447250.401:9): avc:  denied  { append } for  pid=2858 comm="dhclient-script" name="yp.conf" dev=sda2 ino=391693 scontext=unconfined_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file

Comment 6 Honza Horak 2012-04-27 10:59:00 UTC
(In reply to comment #5)
> # ls -Z /etc/yp.conf
> -rw-r--r--. root root system_u:object_r:etc_runtime_t:s0 /etc/yp.conf

This is not correct SELinux content, the correct one is:
# ls -Z /etc/yp.conf 
-rw-r--r--. root root system_u:object_r:net_conf_t:s0  /etc/yp.conf

Please, try to fix it by running:
# restorecon /etc/yp.conf

Or if you suspect other files in /etc can have a wrong context as well, fix the whole directory:
# restorecon -r /etc

Did this help?

Comment 7 Dennis Schridde 2012-04-27 14:07:58 UTC
(In reply to comment #6)
> Or if you suspect other files in /etc can have a wrong context as well, fix the
> whole directory:
> # restorecon -r /etc
I ran "fixfiles onboot" on one machine - does that do the same thing?

> Did this help?
Yes, but I do not understand how this happened in the first place, since the system was freshly installed. Since I used the Scientific Linux installer, I assume this does not matter to you and the bugreport can be closed.

Comment 8 Honza Horak 2012-04-27 15:21:10 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Or if you suspect other files in /etc can have a wrong context as well, fix the
> > whole directory:
> > # restorecon -r /etc
> I ran "fixfiles onboot" on one machine - does that do the same thing?

Yes.

> > Did this help?
> Yes, but I do not understand how this happened in the first place, since the
> system was freshly installed. Since I used the Scientific Linux installer, I
> assume this does not matter to you and the bugreport can be closed.

OK, closing.


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