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 1636002 - socket-activated services start as the sssd user and then are unable to read the confdb
Summary: socket-activated services start as the sssd user and then are unable to read ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Tomas Halman
QA Contact: Jakub Vavra
URL:
Whiteboard: sync-to-jira
Depends On: 2011216
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-04 08:28 UTC by Matt Dainty
Modified: 2022-05-10 16:46 UTC (History)
18 users (show)

Fixed In Version: sssd-2.6.1-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:26:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:2070 0 None None None 2022-05-10 15:27:09 UTC

Description Matt Dainty 2018-10-04 08:28:07 UTC
Description of problem:

Socket activation of certain SSSD services doesn't seem to work. Starting with an sssd.conf that is mostly generated by authconfig-tui it looks something like this:

[domain/default]

autofs_provider = ldap
cache_credentials = True
krb5_realm = #
ldap_search_base = o=Example Inc.
id_provider = ldap
auth_provider = ldap
chpass_provider = ldap
ldap_uri = ldap://[::1]/
ldap_id_use_start_tls = False
ldap_tls_cacertdir = /etc/openldap/cacerts
ldap_default_bind_dn = cn=SSSD,ou=System,o=Example Inc.
ldap_default_authtok = secret
ldap_tls_reqcert = never
[sssd]
services = nss, pam, autofs

domains = default
[nss]
homedir_substring = /home

[pam]

[sudo]

[autofs]

[ssh]

[pac]

[ifp]

[secrets]

[session_recording]

This seems to work fine, "getent passwd <user>" finds users in the LDAP directory, and I can log in over SSH. So basically the NSS and PAM services at least are functioning.

If I try and convert to using socket activation by unsetting the "services =" line and then enabling the sssd-nss.socket, sssd-pam.socket, & sssd-pam-priv.socket systemd units, then the NSS service continues to work, but PAM stops working, i.e. I can no longer SSH in.

Looking at the logs, I can see this:

[sssd[pam]] [ldb] (0x0020): Unable to open tdb '/var/lib/sss/db/config.ldb': Permission denied
[sssd[pam]] [ldb] (0x0020): Failed to connect to '/var/lib/sss/db/config.ldb' with backend 'tdb': Unable to ope
[sssd[pam]] [confdb_init] (0x0010): Unable to open config database [/var/lib/sss/db/config.ldb]
[sssd[pam]] [server_setup] (0x0010): The confdb initialization failed

Those files are all owned by root. Looking at the sssd-pam.service shows it's trying to run as sssd:sssd whereas NSS at least is running as root. If I comment out the User= & Group= settings in the unit file then PAM starts working again. In fact, it says in the sssd.conf man page not to try running SSSD as anything other than root otherwise socket activation.

There seems to be User= & Group= settings in the PAM, AutoFS, Sudo, SSH and PAC units but not in NSS.

So, is this supposed to work out of the box?

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

1.16.0-19.el7_5.8

How reproducible:

Always

Steps to Reproduce:
1. Configure SSSD with authconfig(-tui) as above
2. Test
3. Convert to socket activation and enable the various systemd socket units.
4. Test again

Actual results:

PAM stops working

Expected results:

PAM should keep working

Additional info:

Comment 2 Jakub Hrozek 2018-10-04 09:37:05 UTC
Ah, I think this is a side effect of how RHEL SSSD is compiled. In RHEL, we compile with sssd user set to "sssd", which causes the User and Group directives to be added to the unit files by default. But also, because for stability reasons, we didn't want to switch sssd from running as root to running as the sssd user in the middle of a RHEL cycle, unless the "user" is set in sssd.conf, then sssd still runs as root and all the files are owned by root as well.

So it's a bug. (Maybe even two bugs, because perhaps the files shouldn't be owned by root.root but by root.sssd and then the responders would work as non-root by default_

Comment 8 Tomas Halman 2021-09-09 08:49:42 UTC
Upstream ticket:
https://github.com/SSSD/sssd/issues/5781

Comment 10 Alexey Tikhonov 2021-10-21 20:31:24 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/5782

* `master`
    * 7db6cfd0674d45a4e769b0beeb551c89cc89f92f - CONFDB: Change ownership before dropping privileges
    * 92e1679943fd2a2a50c9e0e176a10a875cb3ac56 - CONFDB: Change ownership of config.ldb

Comment 20 errata-xmlrpc 2022-05-10 15:26:38 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 (sssd bug fix and enhancement update), 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-2022:2070


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