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 2128840 - [RFE] provide dbus method to find users by attr
Summary: [RFE] provide dbus method to find users by attr
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: sssd
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Alejandro López
QA Contact: shridhar
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-21 15:52 UTC by Alexey Tikhonov
Modified: 2023-05-09 10:28 UTC (History)
4 users (show)

Fixed In Version: sssd-2.8.1-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 08:19:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 6020 0 None open [RFE] provide dbus method to find users by attr 2022-09-29 18:39:11 UTC
Github SSSD sssd issues 6360 0 None open [D-Bus] ListByName() returns twice the same entry 2022-10-07 21:11:51 UTC
Github SSSD sssd issues 6361 0 None open [D-Bus] ListByName() fails when not using wildcards 2022-10-07 21:11:51 UTC
Github SSSD sssd pull 6367 0 None open DBUS: Add ListByAttr(attr, filter, limit) 2022-09-29 18:39:12 UTC
Github SSSD sssd pull 6386 0 None Draft ListByName() returns several times the same entry 2022-10-11 11:38:15 UTC
Red Hat Issue Tracker RHELPLAN-134621 0 None None None 2022-09-21 15:58:38 UTC
Red Hat Issue Tracker SSSD-5054 0 None None None 2022-09-21 17:20:17 UTC
Red Hat Product Errata RHBA-2023:2514 0 None None None 2023-05-09 08:20:04 UTC

Description Alexey Tikhonov 2022-09-21 15:52:47 UTC
SSSD provides a D-Bus interface with the following methods:
- FindByName(name)
- FindByID(id)
- ListByName(filter, limit)
- ListByDomainAndName(domain, filter, limit)

It would be nice to also have a method allowing to find users that have a given attribute value: ListByAttr(ifp_attribute_name, filter, limit)

For instance, if sssd is configured with:
```
[domain/...]
ldap_user_extra_attrs = sn:sn

[ifp]
user_attributes = +sn
```
then the method ListByAttr('sn', 'alice', 0) would return all the users who have the extra attribute sn = "alice" and the method ListByAttr('sn', 'al*', 0) would return all the users who have a substring match sn="al*".

When there are multiple domains defined in sssd.conf, all the domains should be searched (note that each domain may have a different mapping). If one of the domains doesn't define the mapping, it should be skipped.

Comment 2 Alexey Tikhonov 2022-09-29 15:09:58 UTC
Upstream PR: https://github.com/SSSD/sssd/pull/6367

Comment 3 Alexey Tikhonov 2022-10-05 14:35:31 UTC
Pushed relevant PR: https://github.com/SSSD/sssd/pull/6368

* `master`
    * 3e5251bf22545ed13449e81fca64651d08f86ca4 - sssctl: Management of indexes on cache DBs.

(relevant to this BZ but doesn't resolve it)

Comment 4 Alexey Tikhonov 2022-10-07 10:46:59 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/6367

* `master`
    * acfe3b292ffd75aeb0c79cc706b024a657e1ffaa - DBUS: Add ListByAttr(attr, filter, limit)

Practically this patch resolves this BZ, but I keep it assigned due to relevant issues being worked on:
 - https://github.com/SSSD/sssd/issues/6361
 - https://github.com/SSSD/sssd/issues/6360

Comment 5 Alexey Tikhonov 2022-10-11 11:38:15 UTC
Additional PR: https://github.com/SSSD/sssd/pull/6386

Comment 7 Alexey Tikhonov 2022-11-03 11:32:09 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/6386

* `master`
    * c3453e4e82796c5ae578671f25568c74919cad13 - CACHE_REQ: Use a const struct in cache_req_data_create()
    * 09895561a34592de1d58af211db1725388d86d5e - TESTS: New test for D-Bus' ListByName()
    * 569dca5f24e2e92aa86c7a2800f772e29211fc31 - CACHE_REQ: Consider the domain when looking names in the cache
    * a97962826efdf5c51fed7553e761a803c48f6675 - TESTS: Correct ListByAttr()'s test
    * 8f7c35eae22aaa9649db1cf2d07d17d8c4b92e82 - CACHE_REQ: Do not return duplicated values.
    * 719c92533c52aad091c8b58e7a82b9e3b88f8e62 - CACHE_REQ: Initialize domain with NULL
    * 214540e72a6743e1112b35d562efc595594b1a82 - Cache: String has to be duplicated instead of copied
* `sssd-2-8`
    * 0f670188c3f18a63515e10ff56f03a4cbe47a845 - CACHE_REQ: Use a const struct in cache_req_data_create()
    * 7f583fad9d7604587ef1c0ff163dd9d7d337e9b2 - TESTS: New test for D-Bus' ListByName()
    * 13e841de7b31c4e341a5293acb9302beacad6015 - CACHE_REQ: Consider the domain when looking names in the cache
    * 82c69b7f601b92579c4ae0d34ea20df12cbedc11 - TESTS: Correct ListByAttr()'s test
    * 1562df030c266811b653f032131dc89a9381d81e - CACHE_REQ: Do not return duplicated values.
    * 1377bca9706179304577755b5b1e5c1dcbcd748f - CACHE_REQ: Initialize domain with NULL
    * 129979a38c38940c841134011ab866ebcf3417c7 - Cache: String has to be duplicated instead of copied

Comment 14 errata-xmlrpc 2023-05-09 08:19:51 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-2023:2514


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