Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[D-Bus] ListByName() and ListByDomainAndname() return an empty list when used on the "files" provider #6342

Closed
aplopez opened this issue Sep 8, 2022 · 2 comments
Assignees
Labels
Closed: Fixed Issue was closed as fixed.

Comments

@aplopez
Copy link
Contributor

aplopez commented Sep 8, 2022

Invoking infopipe's org.freedesktop.sssd.infopipe.Users.ListByName() or org.freedesktop.sssd.infopipe.Users.ListByDomainAndName() on the files provider return an empty list, even if matching entries do exist.

# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe/Users org.freedesktop.sssd.infopipe.Users.ListByName "string:al*" "uint32:0"
method return time=1662645620.656219 sender=:1.3569 -> destination=:1.3583 serial=17 reply_serial=2
   array [
   ]
@aplopez aplopez self-assigned this Sep 8, 2022
@aplopez
Copy link
Contributor Author

aplopez commented Sep 8, 2022

The first observation in the logs was that the filter used is:

(2022-09-06 15:31:00): [ifp] [sysdb_enumpwent_filter] (0x1000): Searching cache with [(&(objectCategory=user)(name=al*)(lastUpdate>=1662471060))]

meaning that we are only looking for entries added after the last update. Modifying the filter to make this condition always true, returns the expected entries in the list.

(2022-09-06 16:28:51): [ifp] [sysdb_enumpwent_filter] (0x1000): Searching cache with [(&(objectCategory=user)(name=al*)(lastUpdate>=0))]

@pbrezina noticed that:

Files provider works differently, it only updates the record /etc/passwd or /etc/group is touched, it does not perform any per-request update.
Therefore the last update flag is not updated and the user is not found.

So the solution is to avoid the optimization (requesting only the latest updates) when using the files provider.

@aplopez aplopez changed the title [D-Bus] ListByName() returns an empty list when used on the "files" provider [D-Bus] ListByName() and ListByDomainAndname() return an empty list when used on the "files" provider Sep 8, 2022
aplopez added a commit to aplopez/sssd that referenced this issue Sep 8, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Resolves: SSSD#6342
aplopez added a commit to aplopez/sssd that referenced this issue Sep 8, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Resolves: SSSD#6342
aplopez added a commit to aplopez/sssd that referenced this issue Sep 12, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Resolves: SSSD#6342
aplopez added a commit to aplopez/sssd that referenced this issue Sep 19, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Added a test for this situation.

Resolves: SSSD#6342
aplopez added a commit to aplopez/sssd that referenced this issue Sep 20, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Added a test for this situation.

Resolves: SSSD#6342
aplopez added a commit to aplopez/sssd that referenced this issue Sep 22, 2022
Avoid requesting only the latest updates when using the "files"
provider as it only updates the cache if /etc/files or /etc/group
is touched.

Added a test for this situation.

Resolves: SSSD#6342
@pbrezina
Copy link
Member

Pushed PR: #6343

  • master
    • f418e94 - D-Bus: Do not use timestamp optimization on "files" provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Fixed Issue was closed as fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants