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 1645047 - sssd only sets the SELinux login context if it differs from the default [rhel-7.6.z]
Summary: sssd only sets the SELinux login context if it differs from the default [rhel...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: SSSD Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
: 1645044 (view as bug list)
Depends On: 1619706
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-01 10:10 UTC by Oneata Mircea Teodor
Modified: 2022-03-13 15:55 UTC (History)
21 users (show)

Fixed In Version: sssd-1.16.2-13.el7_6.1
Doc Type: Bug Fix
Doc Text:
Previously, if a user had a non-standard home directory and did not have explicit mapping to an SELinux user, the SSSD service skipped setting this user's login context due to a bad optimization in the code. This update removes the optimization. As a result, SSSD now sets the SELinux login context even for users with a non-standard home directory and no explicit mapping to an SELinux user.
Clone Of: 1619706
Environment:
Last Closed: 2019-01-29 17:22:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 4813 0 None None None 2020-05-04 11:07:34 UTC
Red Hat Knowledge Base (Solution) 3612271 0 None None None 2018-11-01 10:11:08 UTC
Red Hat Product Errata RHBA-2019:0169 0 None None None 2019-01-29 17:22:08 UTC

Description Oneata Mircea Teodor 2018-11-01 10:10:57 UTC
This bug has been copied from bug #1619706 and has been proposed to be backported to 7.6 z-stream (EUS).

Comment 2 Oneata Mircea Teodor 2018-11-01 10:12:42 UTC
*** Bug 1645044 has been marked as a duplicate of this bug. ***

Comment 4 Jakub Hrozek 2018-11-06 08:16:01 UTC
Hi Michal, this needs packaging.

Comment 10 Jakub Hrozek 2019-01-17 12:05:38 UTC
Can you show me some logs? (selinux_child and domain) ?

btw you don't have to add a selinux user or a role. Just with the default configuration, logging in as the user should add that user to the database

Comment 11 Mohammad Rizwan 2019-01-17 13:31:53 UTC
version:
ipa-server-4.6.4-10.el7_6.2.x86_64
sssd-1.16.2-13.el7_6.5.x86_64

Steps:
1. add ipa user and login with it
2. semanage login -l

Actual result:

[root@master ~]# ipa user-add testuser2 --first  test2 --last user --password
Password: 
Enter Password again to verify: 
----------------------
Added user "testuser2"
----------------------
  User login: testuser2
  First name: test2
  Last name: user
  Full name: test2 user
  Display name: test2 user
  Initials: tu
  Home directory: /home/testuser2
  GECOS: test2 user
  Login shell: /bin/sh
  Principal name: testuser2
  Principal alias: testuser2
  User password expiration: 20190117132244Z
  Email address: testuser2
  UID: 1181800004
  GID: 1181800004
  Password: True
  Member of groups: ipausers
  Kerberos keys available: True
[root@master ~]# 
[root@master ~]# 
[root@master ~]# ssh testuser2.test
Password: 
Password: 
Password expired. Change your password now.
Current Password: 
New password: 
Retype new password: 
Last failed login: Thu Jan 17 08:23:04 EST 2019 from master.testrelm.test on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Thu Jan 17 08:05:41 2019 from master.testrelm.test
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
         This System is part of the Red Hat Test System.              
                                                                      
      Please do not use this system for individual unit testing.      
                                                                      
      RHTS Test information:                                          
                         HOSTNAME=master.khw1.lab.eng.bos.redhat.com                           
                            JOBID=3291850                              
                         RECIPEID=6397532                           
                       LAB_SERVER=                         
                    RESULT_SERVER=[::1]:7096                      
                           DISTRO=RHEL-7.6-20190115.n.0                             
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
Could not chdir to home directory /home/testuser2: No such file or directory
/usr/bin/id: cannot find name for group ID 1181800003
-sh-4.2$ 
-sh-4.2$ semanage login -l
ValueError: SELinux policy is not managed or store cannot be accessed.
-sh-4.2$ exit
logout
Connection to master.testrelm.test closed.
[root@master ~]# 
[root@master ~]# 
[root@master ~]# semanage login -l

Login Name           SELinux User         MLS/MCS Range        Service

__default__          unconfined_u         s0-s0:c0.c1023       *
root                 unconfined_u         s0-s0:c0.c1023       *
system_u             system_u             s0-s0:c0.c1023       *
testuser2            unconfined_u         s0-s0:c0.c1023       *

SELinux login context set for user with default context. 

Based on above observation, marking the bug verified.

Comment 13 errata-xmlrpc 2019-01-29 17:22:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0169


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