Bug 981083

Summary: kickstart option "auth --enablenis" creates /etc/yp.conf with wrong SELinux file context
Product: [Fedora] Fedora Reporter: Edgar Hoch <edgar.hoch>
Component: authconfigAssignee: Tomas Mraz <tmraz>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 19CC: anaconda-maint-list, dshea, g.kaviyarasu, jonathan, mkolman, sbueno, tmraz, vanmeeuwen+fedora
Target Milestone: ---Keywords: SELinux
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 15:50:02 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 Edgar Hoch 2013-07-04 01:33:13 UTC
Description of problem:
I use the following kickstart option:

auth --useshadow  --passalgo=sha512 --enablecache --enablenis --nisdomain mynisdomain --nisserver 192.0.2.100

This creates a file /etc/yp.conf with the wrong SELinux file context.

As a cause after a reboot the system could not start service ypbind because ypbind could not read /etc/yp.conf.


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

How reproducible:
Always.

Steps to Reproduce:
1. Create a kickstart file with a line that contains at least the following options (and others that are neccessary that kickstart works):

auth --enablenis --nisdomain mynisdomain --nisserver 192.0.2.100

2. It may be neccessary to install the package ypbind.
   I am not sure, but I did install package ypbind in the %post part of the kickstart file.
   (I am not sure why it is not installed from the %package part, I will check if it is not contained in a package group any more (I think in previous Fedora versions my package group list contains ypbind.))

3. Start a kickstart installation with that kickstart file.
4. After the installation check the file /etc/yp.conf.

Actual results:
-rw-r--r--. 1 root root  34 Jul  3 20:30 /etc/yp.conf
-rw-r--r--. 1 root root 585 May 10 12:26 /etc/yp.conf.rpmnew
-rw-r--r--. root root system_u:object_r:etc_runtime_t:s0 /etc/yp.conf
-rw-r--r--. root root system_u:object_r:net_conf_t:s0  /etc/yp.conf.rpmnew

Expected results:
-rw-r--r--. 1 root root  34 Jul  3 20:30 /etc/yp.conf
-rw-r--r--. 1 root root 585 May 10 12:26 /etc/yp.conf.rpmnew
-rw-r--r--. root root system_u:object_r:net_conf_t:s0  /etc/yp.conf
-rw-r--r--. root root system_u:object_r:net_conf_t:s0  /etc/yp.conf.rpmnew


Additional info:

Running "restorecon /etc/yp.conf" solves the problem.

I do this in my kickstart %post part as a workaround, until it is solved by new installation media.

Comment 1 David Shea 2013-08-01 20:28:44 UTC
Anaconda uses authconfig to execute the auth kickstart commands. It looks like the yp.conf from the ypbind package is being installed with the correct context, but as yp.conf.rpmnew since yp.conf has already been created, either by authconfig or from a previous install.

Reassigning to authconfig.

Comment 2 Edgar Hoch 2013-08-01 22:02:47 UTC
I have done a new (fresh, complete) installation with kickstart, no upgrade. The partitions (root, boot, var, swap) are formatted with a new filesystem (ext4). So yp.conf cannot come from a previous install.

Comment 3 Tomas Mraz 2013-08-05 13:43:30 UTC
I wonder what/if something recently changed so this incorrect context is set when authconfig creates files.

Do you see the problem only in Fedora 19 or did you see it in previous Fedora releases with the same/similar kickstart as well?

Comment 4 Edgar Hoch 2013-08-05 14:06:32 UTC
On previous Fedora releases we have used NetworkManager only on notebook, where it is ok for me that users can change the network configuration to get network connection in their hotel, conference, etc.

On our desktop pcs we had disabled NetworkManager and have used network scripts to start the network at boot time. We did this until Fedora 16. We didn't really use Fedora 17 and 18, and now with Fedora 19 I leave NetworkManager enabled und use it on the desktops and servers to, because so many other services depends on a running NetworkManager service (otherwise I got many errors, for example in ~/.xsession-errors and /var/log/messages), so I have decided to use NetworkManager and not "network".

With Fedora 19 NetworkManager has become more features so it can be used on desktops and servers and not only mobile hosts, and I saw that bonding and bridging is prepeared for Fedora 20.

As NetworkManager is running, the applet appears automatically on users desktop to see and manage network connections. In previous releases I did this only on notebooks.

On Fedora 16 I only started NetworkManager (e.g. I didn't disable it) and console users on the notebook could manage the network connection. I don't remember that I had set any special rights on notebooks for console users for NetworkManager. So - probalby the problem may have exist a longer time, but on notebooks this wasn't a problem. But on our desktops and servers normal users must not change the network configuration. (Servers are not really a problem as users normally get no access to the console).

I think it would be the best to disable the right to modify the network connection for normal users - also for console users! - and so enable the administrator to explicit allow that right for console users (by using a command or modifying a configuration file in /etc/...) - for example for use on notebooks.

Comment 5 Edgar Hoch 2013-08-05 14:09:31 UTC
(In reply to Edgar Hoch from comment #4)

Sorry, I was in thoughts of another bug (#969612), please ignore comment #4 .

Comment 6 Edgar Hoch 2013-08-05 14:13:24 UTC
(In reply to Tomas Mraz from comment #3)
> I wonder what/if something recently changed so this incorrect context is set
> when authconfig creates files.
> 
> Do you see the problem only in Fedora 19 or did you see it in previous
> Fedora releases with the same/similar kickstart as well?

I see the problem only in Fedora 19. I jumped over Fedora 17, but I configured nearly every other release with kickstart and nis.

Comment 7 Fedora End Of Life 2015-01-09 18:39:17 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2015-02-17 15:50:02 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.