Fix for test_access_control_simple__permits_user_login_based_on_group samba failure#8263
Conversation
819a490 to
0da7d09
Compare
|
The changes from The reason it isn't failing for PRs against master is because only
Here you can see this test failing against master: https://github.com/SSSD/sssd/actions/runs/19898518551/job/57035518953 Regarding the actual failure, in However, what happens now after the This PR adds a check if the group name begins with a SID prefix, and resolves these groups if it does have a sid prefix instead of adding the group. it makes the test pass now but to me it feels like the wrong way to fix this issue. Can you provide some guidance on what would be the best way to update the simple access check code behavior for AD groups? |
|
Hi, your solution would work. As an alternative I would like to suggest to consider to revert two of the changes from the original patch: This would allow to have groups in the cache which have a non-zero GID but are (temporary) marked as non-POSIX. Then the test would pass without changes to the simple access provider code. Another alternative might be a new flag which indicates that the name is not resolved yet, but this would require more code to make sure it is removed. So I think using the Please let me know what you think. As said, I agree with your solution as well and would ACK it. bye, |
Thank you for your comments. Of those options I prefer to go with the current code in this PR, I will clean it up a bit first however. I find having groups in the cache with a non-zero GID temporarily marked as non-POSIX to be confusing behavior, and flipping non-POSIX to POSIX during SSSD operations seems undesirable IMO. I will ping you when this PR is ready for review. |
ffb69e0 to
028d641
Compare
|
@sumit-bose PR is updated now, just waiting for CI. I confirmed the test passes now with https://github.com/SSSD/sssd/actions/runs/19967886836/job/57264520857?pr=8263 CI run |
|
Regarding string helper If we keep it, I can plan to create a separate PR later to use this helper in other parts of SSSD code. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a fix for an access control issue where group-based login fails in certain Samba configurations. The core of the fix is to ensure that group names that are still in SID format are properly resolved before being used in access checks. This is achieved by adding a new utility function string_begins_with to detect SID-formatted names and updating the simple access provider logic to trigger resolution for such groups.
My review identified a critical null pointer dereference vulnerability in the new string_begins_with function, which could lead to a crash. I also found an incorrect test case for this function that should be corrected. I've provided suggestions for both issues.
aa38d6b to
03579c4
Compare
03579c4 to
1da3c1e
Compare
|
With these changes maybe |
sumit-bose
left a comment
There was a problem hiding this comment.
Hi,
thank you for the fix, I have no further comments to the code, ACK.
Since there is clear difference to the plain ldap version of the test wouldn't it make sense to enable the samab topology at least for this test in PR CI?
bye,
Sumit
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
After changes from 'Dont store GID for non-posix groups', the simple access provider was not identifying group with names in SID format as group that needs to be resolved because they are no longer stored temporarily as non-POSIX. Add code to check for, and resolve any group names which are SIDs returned from initgroups (AD provider). Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
1da3c1e to
5ad6e20
Compare
The changes from Dont store GID for non-posix groups commit 85b632d have resulted in the test test_access_control_simple__permits_user_login_based_on_group to fail, specifically when run against samba (ipa and ldap succeed). Drop the preferred LDAP topology, to ensure this test runs against all providers to catch potential issues like this.
Thank you, I added a commit to drop the |
This patch doesn't have 'reviwed-by' trailer now. But probably doesn't matter... |
No description provided.