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

NAS-131178 / 24.10.0 / Fix recursion in getting SID info (by anodos325) #14517

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

bugclerk
Copy link
Contributor

Early in electric eel development, the SID values associated with local users and groups were changed to be deterministic based on their respective datastore table primary keys. A subsequent commit changed how this SID information was retrieved in user.get_user_obj and group.get_group_obj to ensure that we stopped relying on a winbind client connection (to robustize against edge case of user not having winbindd running). This SID information was obtained via user.query and group.query.

Unfortunately, the developer neglected to set an additional ['local', '=', True] filter for the query request (which limits to local users only), which resulted in call to directoryservices.cache.query when AD or LDAP is enabled. If the account is a local account then the cache lookup failure results in call back into user.get_user_obj or group.get_group_obj resulting in loop.

This commit correctly limits the lookup to local users and groups.

Original PR: #14514
Jira URL: https://ixsystems.atlassian.net/browse/NAS-131178

Early in electric eel development, the SID values associated with
local users and groups were changed to be deterministic based on
their respective datastore table primary keys. A subsequent commit
changed how this SID information was retrieved in user.get_user_obj
and group.get_group_obj to ensure that we stopped relying on
a winbind client connection (to robustize against edge case of
user not having winbindd running). This SID information was obtained
via user.query and group.query.

Unfortunately, the developer neglected to set an additional
['local', '=', True] filter for the query request (which limits to
local users only), which resulted in call to
directoryservices.cache.query when AD or LDAP is enabled. If the
account is a local account then the cache lookup failure results in call
back into user.get_user_obj or group.get_group_obj resulting in loop.

This commit correctly limits the lookup to local users and groups.

(cherry picked from commit 932615e)
@anodos325 anodos325 merged commit eb23af9 into stable/electriceel Sep 13, 2024
1 of 2 checks passed
@anodos325 anodos325 deleted the NAS-131178-24.10.0 branch September 13, 2024 19:43
@bugclerk
Copy link
Contributor Author

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants