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 1919942 - sss_override does not take precedence over override_homedir directive
Summary: sss_override does not take precedence over override_homedir directive
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.4
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: beta
: ---
Assignee: Sumit Bose
QA Contact: Anuj Borah
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-25 12:25 UTC by ttuffin
Modified: 2021-11-10 09:06 UTC (History)
11 users (show)

Fixed In Version: sssd-2.5.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:47:00 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd pull 5814 0 None open Tests: sss_override does not take precedence over override_homedir di… 2021-10-06 12:36:15 UTC
Red Hat Product Errata RHBA-2021:4435 0 None None None 2021-11-09 19:47:16 UTC

Description ttuffin 2021-01-25 12:25:20 UTC
Description of problem:
When using `sss_override` to override a user's home directory, it fails to take precedence over the `override_homedir` directive in /etc/sssd/sssd.conf. That is, if `override_homedir` is set in sssd.conf, this will always override the home directory specified by the `sss_override` command. Is this by design?


Version-Release number of selected component (if applicable):
sssd-client-1.16.5-10.el7_9.6.x86_64
sssd-tools-1.16.5-10.el7_9.6.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Install sssd and sssd-tools
2. Join to domain (I joined to AD with adcli, i.e. `realm join domain.local --membership-software=adcli -U <DOMAIN_ADMIN>`
3. Edit sssd.conf and set homedir, i.e. `override_homedir = /home/%u1`
4. Restart sssd and check homedir: # getent passwd joe
(home set to /home/joe1)
5. Use `sss_override` to set a different home directory: # sss_override user-add joe -h /home/joe2
6. Restart sssd and use getent command to check home directory, which is still set to /home/joe1.

Actual results:
In this example the home directory for user joe will be set to /home/joe1, which means the `override_homedir` directive takes precedence over over the home directory set by `sss_override`.


Expected results:
I would expect `sss_override` to take precedence over `override_homedir`. Since `override_homedir` is on a per-domain level and `sss_override` is per user/group on the local client, `sss_override` allows overriding down to a lower level and therefore should take precedence over `override_homedir`. So the order should be:
1. sss_override
2. override_homedir
3. fallback_homedir

That's just my opinion, but maybe I am missing something.


Additional info:
`sss_override` does successfully override the `fallback_homedir` directive.

Comment 2 ttuffin 2021-01-27 10:16:23 UTC
I have confirmed the same behaviour in RHEL 8.3 (4.18.0-240.el8.x86_64).

[root@test-vm-4 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.3 (Ootpa)
[root@test-vm-4 ~]# uname -r 
4.18.0-240.el8.x86_64
[root@test-vm-4 ~]# grep override /etc/sssd/sssd.conf 
[root@test-vm-4 ~]# 
[root@test-vm-4 ~]# sss_override user-show rick
[root@test-vm-4 ~]# getent passwd rick
rick:*:549001000:549000513:rick:/home/myhome1:/bin/bash
[root@test-vm-4 ~]# sss_override user-add rick -h /home/myhome3
[root@test-vm-4 ~]# sss_override user-show rick
rick:::::/home/myhome3::
[root@test-vm-4 ~]# systemctl restart sssd
[root@test-vm-4 ~]# getent passwd rick
rick:*:549001000:549000513:rick:/home/myhome3:/bin/bash
[root@test-vm-4 ~]# echo 'override_homedir = /home/myhome2' >> /etc/sssd/sssd.conf 
[root@test-vm-4 ~]# systemctl restart sssd
[root@test-vm-4 ~]# getent passwd rick
rick:*:549001000:549000513:rick:/home/myhome2:/bin/bash

Removing sss_override and re-applying does not help.

[root@test-vm-4 ~]# sss_override user-del rick
[root@test-vm-4 ~]# systemctl restart sssd
[root@test-vm-4 ~]# sss_override user-add rick -h /home/myhome3
[root@test-vm-4 ~]# systemctl restart sssd
[root@test-vm-4 ~]# getent passwd rick
rick:*:549001000:549000513:rick:/home/myhome2:/bin/bash

I have also confirmed the same behaviour occurs when trying to override the loginShell attribute.

Comment 4 Sumit Bose 2021-02-01 12:13:18 UTC
Hi,

the question is how the different ways to override the home directory should be ordered. We have the direct overrides, override_homedir and fallback_homedir options. At least the current order should be documented. So far override_homedir is treated as a general override to have a unified assignment of the home directories.

It would be good to know why the customer wants to use override_homedir instead of fallback_homedir?

bye,
Sumit

Comment 5 ttuffin 2021-02-08 10:09:45 UTC
Hi Sumit,

fallback_homedir will only work when the unixHomeDirectory attribute in Active Directory is undefined. In this particular case, all user accounts in AD have this attribute defined and therefore fallback_homedir will work. The customer did try removing this attribute which then allowed them to use fallback_homedir, but this workaround caused other issues with 3rd party authentication platforms.
Therefore, the customer (and I) expect it work as follows:

- unixHomeDirectory attribute in AD is defined.
- On a particular subset of RHEL servers, override_homedir will be used to set a new home directory.
- On a single server from that subset, the home directory for a single user account needs to be changed, and therefore sss_override is used for this purpose.

I agree the question is around how the overrides should be ordered. Since sss_override provides more granular overriding capabilities, I propose that it should be taking precedence over the override_homedir directive, which today, it does not.

Cheers,
Thomas

Comment 6 ttuffin 2021-02-09 09:09:46 UTC
Correction in typo in comment #5 (can't edit?) - "all user accounts in AD have this attribute defined and therefore fallback_homedir will NOT work"

Comment 7 Sumit Bose 2021-02-12 11:33:24 UTC
Hi,

thanks for the explanation, makes sense. So we should make sure individual overrides are preferred over override_homedir and document the new order in the man page.

bye,
Sumit

Comment 8 Sumit Bose 2021-02-12 13:01:23 UTC
Hi,

I've push an initial version of patch to https://github.com/sumit-bose/sssd/commit/65c301b78ebd8f96f34d20e23750b4ded5587d60, tests, man page update etc are still missing.

bye,
Sumit

Comment 13 Sumit Bose 2021-04-15 11:14:20 UTC
Upstream ticket:
https://github.com/SSSD/sssd/issues/5589

Comment 14 Pavel Březina 2021-04-21 10:01:55 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/5590

* `master`
    * 691fe4944a606e1d56d2f6bb77f5a6045317d4e9 - nss: prefer homedir overrides over override_homedir option

Comment 25 errata-xmlrpc 2021-11-09 19:47:00 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-2021:4435


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