Skip to content

cache_req: use sysdb_search_user_by_upn_with_view_res()#7998

Merged
alexey-tikhonov merged 5 commits intoSSSD:masterfrom
sumit-bose:upn_view
Jan 2, 2026
Merged

cache_req: use sysdb_search_user_by_upn_with_view_res()#7998
alexey-tikhonov merged 5 commits intoSSSD:masterfrom
sumit-bose:upn_view

Conversation

@sumit-bose
Copy link
Contributor

To make sure any overrides are applied to the user even when searched by
UPN or email address sysdb_search_user_by_upn_with_view_res() is now used
in the cache request code.

@sumit-bose sumit-bose marked this pull request as draft June 13, 2025 07:46
@alexey-tikhonov
Copy link
Member

alexey-tikhonov commented Jun 13, 2025

Is this related to #7996?
UPD: looks like not.

@sumit-bose
Copy link
Contributor Author

Is this related to #7996? UPD: looks like not.

No, https://issues.redhat.com/browse/RHEL-72935

@alexey-tikhonov
Copy link
Member

Do you know if it's applicable to sssd-2-9-4?

@sumit-bose
Copy link
Contributor Author

Do you know if it's applicable to sssd-2-9-4?

Yes, looks like the issue is present since a long time.

@alexey-tikhonov
Copy link
Member

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors user lookup by UPN to use a new function sysdb_search_user_by_upn_with_view_res that correctly applies overrides from views. The changes involve removing the old sysdb_getpwupn function, implementing the new one, and updating the cache request plugin and tests. The overall change is good and includes a relevant system test. I found one potential logic bug in the new function where an ENOENT error code might be incorrectly overwritten, which I've commented on with a suggested fix.

Copy link
Member

@pbrezina pbrezina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise ack.

@alexey-tikhonov alexey-tikhonov added the coverity Trigger a coverity scan label Dec 19, 2025
@alexey-tikhonov
Copy link
Member

Note: Covscan is green.

@alexey-tikhonov alexey-tikhonov removed the coverity Trigger a coverity scan label Dec 19, 2025
@alexey-tikhonov
Copy link
Member

alexey-tikhonov commented Dec 20, 2025

f-44 system test fails aren't due to this PR.
At least some of them are related to https://bugzilla.redhat.com/show_bug.cgi?id=2423900

sumit-bose and others added 5 commits January 2, 2026 11:38
The new call will apply overrides to a user object which was searched by
UPN or email address before returning it.

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
To make sure any overrides are applied to the user even when searched by
UPN or email address sysdb_search_user_by_upn_with_view_res() is now
used in the cache request code.

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Add a system test to verify that IPA ID view overrides are correctly
applied when looking up a user by email address.

The test creates a user with an email, applies ID view overrides
(login, uid, gid, home), and verifies that the overridden values are
returned when looking up the user by:
- original name
- overridden name
- email address

Signed-off-by: Madhuri Upadhye <mupadhye@redhat.com>
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
@sssd-bot
Copy link
Contributor

sssd-bot commented Jan 2, 2026

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeFactor (success)
🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🔴 ci / system (fedora-44) (failure)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants