Skip to content

Conversation

@justin-stephenson
Copy link
Contributor

@justin-stephenson justin-stephenson commented Aug 15, 2025

No description provided.

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 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.

@justin-stephenson justin-stephenson force-pushed the dont_store_gid_0 branch 5 times, most recently from b8cfc5c to bb1f163 Compare August 18, 2025 17:23
@justin-stephenson justin-stephenson marked this pull request as ready for review August 28, 2025 12:16
@justin-stephenson
Copy link
Contributor Author

justin-stephenson commented Aug 29, 2025

This is now ready for review. Do we want to backport this behavior? I'm not sure.

@alexey-tikhonov
Copy link
Member

Word "testing" in commit message looks like a leftover. A more detailed description there would be beneficial.

@alexey-tikhonov
Copy link
Member

@justin-stephenson, could you please rebase?

@justin-stephenson
Copy link
Contributor Author

@justin-stephenson, could you please rebase?

Done. I updated the commit message.

@alexey-tikhonov
Copy link
Member

I updated the commit message.

Remove logic to store 'gidNumber: 0' in the cache for posix groups.

Did you mean 'for non-posix groups'?

this improves performance when a large amount of posix groups may be stored

I would rephrase this. Something like
"""
This avoids performance hit due to huge GID=0 index when a large number of non-posix groups are stored.
"""

@justin-stephenson
Copy link
Contributor Author

I updated the commit message.

Remove logic to store 'gidNumber: 0' in the cache for posix groups.

Did you mean 'for non-posix groups'?

this improves performance when a large amount of posix groups may be stored

I would rephrase this. Something like """ This avoids performance hit due to huge GID=0 index when a large number of non-posix groups are stored. """

Updated, and rebased.

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

Note: Covscan is green.

@justin-stephenson justin-stephenson force-pushed the dont_store_gid_0 branch 4 times, most recently from 7c6f653 to 08b7360 Compare September 19, 2025 19:19
@pbrezina pbrezina force-pushed the master branch 2 times, most recently from f5d64b3 to b854636 Compare November 4, 2025 14:27
Copy link
Contributor

@sumit-bose sumit-bose left a 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

@alexey-tikhonov
Copy link
Member

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?

@amore17, @flo-renaud, would this be possible?

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

Covscan is still green.

@alexey-tikhonov alexey-tikhonov removed the coverity Trigger a coverity scan label Nov 7, 2025
@flo-renaud
Copy link
Contributor

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?

@amore17, @flo-renaud, would this be possible?

Hi @alexey-tikhonov

yes it's possible. You can open a PR against https://github.com/freeipa/freeipa/:

  • edit ipatests/prci_definitions/nightly_latest_sssd.yaml and replace all occurrences of copr: '@sssd/nightly' with your own copr
  • call ln -sf ipatests/prci_definitions/nightly_latest_sssd.yaml .freeipa-pr-ci.yaml
  • git add ipatests/prci_definitions/nightly_latest_sssd.yaml .freeipa-pr-ci.yaml
  • git commit -m "Temp commit"
  • push to your fork and create the PR

@justin-stephenson
Copy link
Contributor Author

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?

@amore17, @flo-renaud, would this be possible?

Hi @alexey-tikhonov

yes it's possible. You can open a PR against https://github.com/freeipa/freeipa/:

* edit ipatests/prci_definitions/nightly_latest_sssd.yaml and replace all occurrences of `copr: '@sssd/nightly'` with your own copr

* call `ln -sf ipatests/prci_definitions/nightly_latest_sssd.yaml .freeipa-pr-ci.yaml`

* `git add ipatests/prci_definitions/nightly_latest_sssd.yaml .freeipa-pr-ci.yaml`

* `git commit -m "Temp commit"`

* push to your fork and create the PR

Thank you, I created freeipa/freeipa#8012

@alexey-tikhonov
Copy link
Member

Thank you, I created freeipa/freeipa#8012

sssd-fedora/test_replica_promotion_TestReplicaPromotionLevel1 and sssd-fedora/test_trust_autoprivate are red there but not sure how to figure if it's introduced in this PR...

@flo-renaud
Copy link
Contributor

Thank you, I created freeipa/freeipa#8012

sssd-fedora/test_replica_promotion_TestReplicaPromotionLevel1 and sssd-fedora/test_trust_autoprivate are red there but not sure how to figure if it's introduced in this PR...

The PR needs to replace all occurrences of @sssd/nightly with packit/SSSD-sssd-8075. Right now, only the build is using the right copr repo, all the test jobs are using SSSD nightly build.

#define SYSDB_GRENT_MPG_FILTER "("SYSDB_MPGC")"

#define SYSDB_INITGR_FILTER "(&("SYSDB_GC")("SYSDB_GIDNUM"=*))"
#define SYSDB_INITGR_FILTER "("SYSDB_GC")"
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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 :-/

Copy link
Contributor Author

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.

@justin-stephenson
Copy link
Contributor Author

Let's wait for green CI results from freeipa/freeipa#8012

@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 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.

@alexey-tikhonov
Copy link
Member

Let's wait for green CI results from freeipa/freeipa#8012

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>
@sssd-bot
Copy link

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


🟢 CodeFactor (success)
🟢 CodeQL (success)
NEUTRAL osh-diff-scan:fedora-rawhide-x86_64:upstream (neutral)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-41-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) / All tests are successful (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / All tests are successful (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-41) (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-41) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🟢 ci / system (fedora-44) (success)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / All tests are successful (success)
🟢 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.

@alexey-tikhonov alexey-tikhonov merged commit bedc216 into SSSD:master Nov 12, 2025
20 of 27 checks passed
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