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 785902 - Errors with empty loginShell and proxy provider
Summary: Errors with empty loginShell and proxy provider
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sssd
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Stephen Gallagher
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-30 21:01 UTC by Stephen Gallagher
Modified: 2020-05-02 16:20 UTC (History)
5 users (show)

Fixed In Version: sssd-1.8.0-2.el6.beta2
Doc Type: Bug Fix
Doc Text:
Cause: The function which was storing user entities to SSSD cache didn't check for empty strings in loginShell attribute. Therefore if it encountered such attribute, the storing procedure would fail completely. Consequence: When using proxy provider and utilized nss module returned empty loginShell, updating user record in cache failed. Therefore invalid data could have been returned to client. Fix: Make sure that proxy provider doesn't pass empty string to the function. Result: when proxy provider gets result with empty loginShell attribute, it doesn't fail and user is stored correctly. Therefore valid entry is returned to the client.
Clone Of:
Environment:
Last Closed: 2012-06-20 11:54:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 1934 0 None None None 2020-05-02 16:20:21 UTC
Red Hat Product Errata RHBA-2012:0747 0 normal SHIPPED_LIVE sssd bug fix and enhancement update 2012-06-19 19:31:43 UTC

Description Stephen Gallagher 2012-01-30 21:01:04 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/892

This issue was found by Kaushik while testing the proxy provider.

The loginShell attribute is a MAY attribute according to rfc 2307 and 2307bis and neither rfc give a hint what to do if loginShell is missing.

If loginShell is missing or empty for a LDAP user the corresponding attribute is not written to the cache, because sysdb_add_basic_user() drops it in this case. When using the proxy provider in both cases (missing or empty) an empty string is returned by the external getpwnam_r() call and an update of the cached entry will fail. The reason is that sysdb_store_user() only checks if shell==NULL but not if shell is an empty string and now tries to update a non-existent attribute in the cache which is not allowed.

As a side effect it is also not possible to update other attributes, e.g, a change in the gecos field, because all updates and done in a single operation.

To fix this I would like to suggest to introduce a configurable default login shell with a default value of '/dev/null'.

To reproduce this issue configure a domain as

{{{
[domain/proxy]
id_provider = proxy
proxy_lib_name = ldap
proxy_pam_target = sss_ldap
}}}

start with an empty cache and call 'id ldap_user_with_missing_loginShell'. The following error messages can be found:

{{{
(Wed Jun 15 12:23:39 2011) [sssd[be[proxy]]] [sysdb_set_entry_attr] (6): Error: 14 (Bad address)
(Wed Jun 15 12:23:39 2011) [sssd[be[proxy]]] [ldb] (9): cancel ldb transaction (nesting: 1)
(Wed Jun 15 12:23:39 2011) [sssd[be[proxy]]] [sysdb_store_user] (6): Error: 14 (Bad address)
(Wed Jun 15 12:23:39 2011) [sssd[be[proxy]]] [ldb] (9): cancel ldb transaction (nesting: 0)
(Wed Jun 15 12:23:39 2011) [sssd[be[proxy]]] [acctinfo_callback] (4): Request processed. Returned 3,14,Internal Error (Cannot make/remove an entry for the specified session)
}}}

Comment 4 Jan Zeleny 2012-04-04 10:39:13 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: The function which was storing user entities to SSSD cache didn't check for empty strings in loginShell attribute. Therefore if it encountered such attribute, the storing procedure would fail completely.
Consequence: When using proxy provider and utilized nss module returned empty loginShell, updating user record in cache failed. Therefore invalid data could have been returned to client.
Fix: Make sure that proxy provider doesn't pass empty string to the function.
Result: when proxy provider gets result with empty loginShell attribute, it doesn't fail and user is stored correctly. Therefore valid entry is returned to the client.

Comment 5 Amith 2012-04-11 09:24:42 UTC
Verified on sssd-1.8.0-22.el6.x86_64. 

The beaker output for the associated automation script is given below:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Verify BZ release ticket #342 :- Errors with empty loginShell and proxy provider
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running '/usr/bin/ldapadd -x -D cn=Manager,dc=example,dc=com -w Secret123 -H ldap://hubcap.lab.eng.pnq.redhat.com -f /tmp/tempuser.ldif > /dev/null 2>&1'
:: [   PASS   ] :: Running '/sbin/service sssd stop'
:: [   PASS   ] :: Running 'rm -f /var/lib/sss/db/*'
:: [   PASS   ] :: Running '/sbin/service sssd start'
:: [   PASS   ] :: Running '/bin/sleep 5s'
:: [   PASS   ] :: Running '/usr/bin/id tempuser'
:: [   PASS   ] :: File '/var/log/sssd/sssd_PROXY.log' should not contain '\[sysdb_set_entry_attr\] (6): Error: 14 (Bad address)'
:: [   PASS   ] :: File '/var/log/sssd/sssd_PROXY.log' should not contain '\[sysdb_store_user\] (6): Error: 14 (Bad address)'
:: [   PASS   ] :: File '/var/log/sssd/sssd_PROXY.log' should not contain 'Internal Error (Cannot make/remove an entry for the specified session)'
:: [   PASS   ] :: Running '/usr/bin/ldapmodify -x -D cn=Manager,dc=example,dc=com -w Secret123 -H ldap://hubcap.lab.eng.pnq.redhat.com -f /tmp/deluser.ldif > /dev/null 2>&1'
:: [   PASS   ] :: Running 'rm -f /tmp/tempuser.ldif'
:: [   PASS   ] :: Running 'rm -f /tmp/deluser.ldif'
:: [   LOG    ] :: Duration: 34s
:: [   LOG    ] :: Assertions: 12 good, 0 bad
:: [   PASS   ] :: RESULT: Verify BZ release ticket #342 :- Errors with empty loginShell and proxy provider

Comment 7 errata-xmlrpc 2012-06-20 11:54:35 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.

http://rhn.redhat.com/errata/RHBA-2012-0747.html


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