Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1101139

Summary: pam_mkhomedir.so creating home dir with wrong selinux context type
Product: Red Hat Enterprise Linux 6 Reporter: Joaquin <narebeestjes>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CANTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5CC: dwalsh, mmalik, su_js1, trondham
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 903880 Environment:
Last Closed: 2014-05-26 11:14:55 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 Joaquin 2014-05-26 09:04:57 UTC
Using oddjob is not a viable solution since it requires dbus (not installed as a depencency by the way) and with that come 62 other dependencies in my case.

So for a minimal installation with local home directories pam_mkhomedir is the preferred solution. 


+++ This bug was initially created as a clone of Bug #903880 +++

Description of problem:
pam_mkhomedir.so creating home dir with wrong selinux context type

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-155.el6_3.13.noarch

How reproducible:
Configure pam to use pam_mkhomedir.so. Have user login, then do:  ls -alZ /home

Steps to Reproduce:
1. Configure pam to use pam_mkhomedir.so.
2. Have user login
3. ls -alZ /home
  
Actual results:
$ ls -alZ /home/
drwxr-xr-x. user2    user2 unconfined_u:object_r:home_root_t:s0 jsu2


Expected results:
drwx------. user1    user1      unconfined_u:object_r:user_home_dir_t:s0 jms


Additional info:
Same bug reported and fixed in FC17: https://bugzilla.redhat.com/show_bug.cgi?id=863132

--- Additional comment from Daniel Walsh on 2013-01-25 09:27:11 EST ---

Please use oddjob_mkhomedir

--- Additional comment from RHEL Product and Program Management on 2013-01-29 01:49:37 EST ---

This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 Daniel Walsh 2014-05-26 11:14:55 UTC
Please use pam_oddjob_mkhomedir

/usr/lib64/security/pam_oddjob_mkhomedir.so