Description of problem: When I create corporate users they get a home directory of the form /home/<domain>/<username> (using gnome user manager, sssd and realmd) in this case the /home/<domain> gets selinux context as a home directory, and the users home directories as if they are content in a home directory. I discovered this since it kills icedtea-web because of wrong labeling of the .cache dir. Version-Release number of selected component (if applicable): selinux-policy-targeted-3.13.1-71.fc21.noarch How reproducible: always Steps to Reproduce: 1. create a corporate (Active Directory in my case) user 2. 3. Actual results: home directory with wrong context Expected results: home directopry and subdirectories with correct context Additional info: restorecon does nothing to fix this problem unless the rules are fixed.
Does semanage fcontext -a -e /home /home/<DOMAIN> restorecon -R -v /home/ Fix your problem?
That seems to help a lot. What component is responsible for creating the <DOMAIN> directory? I guess this bug should get reassigned there.
sssd?
Sounds more likely that the user doesn't have pam_oddjob_mkhomedir installed and is instead using pam_mkhomedir, which is known to be broken with SELinux.
I agree, we don't /create/ the directories, we just tell the system what the directory is. The creation of the directory is a job for mkhomedir or oddjob. birger, can you check your PAM stack for mkhomedir/oddjob and preferably use the latter?
[root@sch-lf-02899 pam.d]# grep -i oddjob * fingerprint-auth:session optional pam_oddjob_mkhomedir.so umask=0077 fingerprint-auth-ac:session optional pam_oddjob_mkhomedir.so umask=0077 password-auth:session optional pam_oddjob_mkhomedir.so umask=0077 password-auth-ac:session optional pam_oddjob_mkhomedir.so umask=0077 smartcard-auth:session optional pam_oddjob_mkhomedir.so umask=0077 smartcard-auth-ac:session optional pam_oddjob_mkhomedir.so umask=0077 system-auth:session optional pam_oddjob_mkhomedir.so umask=0077 system-auth-ac:session optional pam_oddjob_mkhomedir.so umask=0077 so it seems like I am already using oddjob?
Nalin, do you know how to best debug the problem further?
It looks like /home/<DOMAIN> is being created when the user's home directory is supposed to be under it, which is good. So on a clean system, run the first command from comment #1 before the /home/<DOMAIN> directory is created, then log in as such a user. If /home/<DOMAIN> is created with the correct label, then the problem appears to be that nothing's updating the local file contexts configuration automatically. If the directory isn't created, or is created with a label that's not consistent with the policy at the time it's created, then it's a bug in oddjob's mkhomedir helper.
Not a real good fix for this problem. oddjob_mkhomedircon could execute the equivalent of semanage fcontext -e /home /home/DOMAIN Before creating the directory, would probably be the best solution. Preventing a restorecon -R -v /home from screwing up the labeling.
(In reply to Daniel Walsh from comment #9) > Not a real good fix for this problem. oddjob_mkhomedircon could execute the > equivalent of > > semanage fcontext -e /home /home/DOMAIN should sssd do this when it knows it is going to admit a user that has such a home directory ? > Before creating the directory, would probably be the best solution. > Preventing a restorecon -R -v /home from screwing up the labeling. or should oddjob_mkhomedir automatically perform the above command every time it creates "middle" path components ?
Either way, we need a priv process to create this link to make sure the labeling stays consistent.
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. 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 21 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.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 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.