-
Notifications
You must be signed in to change notification settings - Fork 270
Dont store gid 0 for non-posix groups #8075
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
Dont store gid 0 for non-posix groups #8075
Conversation
c443226 to
f341e9b
Compare
There was a problem hiding this 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 aims to prevent storing a GID of 0 for non-POSIX groups. However, the implementation is too broad and affects all groups, including POSIX groups. This can lead to creating invalid POSIX group entries without a gidNumber when called from sysdb_add_incomplete_group, which is a critical issue. My review includes a comment explaining the problem and suggests reverting the change in favor of a safer approach in the calling functions.
b8cfc5c to
bb1f163
Compare
|
This is now ready for review. Do we want to backport this behavior? I'm not sure. |
|
Word "testing" in commit message looks like a leftover. A more detailed description there would be beneficial. |
|
@justin-stephenson, could you please rebase? |
bb1f163 to
4138146
Compare
Done. I updated the commit message. |
Did you mean 'for non-posix groups'? I would rephrase this. Something like |
4138146 to
90c690f
Compare
Updated, and rebased. |
|
Note: Covscan is green. |
7c6f653 to
08b7360
Compare
d1f3fd8 to
de2f870
Compare
f5d64b3 to
b854636
Compare
sumit-bose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I have no further comments to the code, so ACK.
@alexey-tikhonov, do you agree with the latest changes?
I think it might be worth to ask the FreeIPA if they can run their test-suite against a copr build with the patch to see if they detect some unexpected failures before mergin the patches?
bye,
Sumit
@amore17, @flo-renaud, would this be possible? |
|
Covscan is still green. |
yes it's possible. You can open a PR against https://github.com/freeipa/freeipa/:
|
Thank you, I created freeipa/freeipa#8012 |
|
The PR needs to replace all occurrences of |
| #define SYSDB_GRENT_MPG_FILTER "("SYSDB_MPGC")" | ||
|
|
||
| #define SYSDB_INITGR_FILTER "(&("SYSDB_GC")("SYSDB_GIDNUM"=*))" | ||
| #define SYSDB_INITGR_FILTER "("SYSDB_GC")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to be able to return non-posix groups via IFP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the PR non-posix groups were stored with gidNumber: 0 so this filter made sense. Now we need to remove the gidNumber part of the search filter constraint to find the relevant nonPosix groups.
Is this to be able to return non-posix groups via IFP?
Only no if these groups are stored with gidNumber: 0 based on previous behavior of the PR. What about systems updated to this SSSD version and still have groups stored in the old format? Do we need to handle this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we need to remove the gidNumber part of the search filter constraint to find the relevant nonPosix groups.
That's what I'm asking: who consumes non-posix groups in INITGR list?
Is it only IFP?
What about systems updated to this SSSD version and still have groups stored in the old format?
Your patch looks backward compatible, no?
If "no" then new cache-upgrade proc is needed :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I'm asking: who consumes non-posix groups in INITGR list?
Is it only IFP?
As far as I know, yes. I hope infopipe system tests would provide coverage for this, but I could test it manually with ipa-tuura if needed.
de2f870 to
cb942b4
Compare
|
Let's wait for green CI results from freeipa/freeipa#8012 |
|
/gemini review |
There was a problem hiding this 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 aims to prevent storing the gidNumber attribute for non-POSIX groups. The core of the change is in sysdb_add_basic_group, which now conditionally adds gidNumber based on an is_posix flag. Most of the changes correctly update callers to use this new logic. However, I've identified a critical issue in the group update path where a gidNumber could still be stored for a non-POSIX group, which would defeat the purpose of this change. My review includes a comment and a suggested fix for this issue.
No regression found. |
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Remove logic to store 'gidNumber: 0' in the cache for non-posix groups. Instead do not add a gidNumber at all, this avoids performance hit due to huge GID=0 index when a large number of non-posix groups are stored. Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
It is no longer needed as we no longer want to store 'gid: 0' for non-POSIX groups. Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
cb942b4 to
d953045
Compare
No description provided.