ipa sidgen task with user UID >= 2^31, should fail with error 'ID value too large', as we don't support IDs over 32 bit, and range between 2^31 and 2^32 is reserved for subids.
If ID is bigger than UINT_MAX, int overflows, and ID is considered to be ID = original_ID % UINT_MAX
UINT_MAX
ID = original_ID % UINT_MAX
ipa-server-4.9.12
always
ldapmodify -D "cn=Directory Manager" -W << EOF dn: uid=username,cn=users,cn=accounts,$SUFFIX changetype: modify replace: uidNumber uidNumber: 4294967306 EOF
[16/Feb/2024:14:40:08.246024960 +0100] - ERR - find_sid_for_ldap_entry - [file ipa_sidgen_common.c, line 522]: Cannot convert Posix ID [10] into an unused SID.{code}
We should see error 'ID value too large'
We don't see correct error
We should log the faulty ID, too.
if (uid_number >= UINT32_MAX || gid_number >= UINT32_MAX) { LOG_FATAL("ID value too large.\n"); ret = LDAP_CONSTRAINT_VIOLATION; goto done; }
Check should be against INT_MAX, not UINT_MAX. In order to prevent overflow, we can check if it's a good idea to use long 64 bit value to read the ID from LDAP.
Cloned from https://issues.redhat.com/browse/RHEL-26070
This is fixed already with https://github.com/freeipa/freeipa/pull/7713 See explanation in https://freeipa.readthedocs.io/en/latest/designs/subordinate-ids.html#design-choices at the end of that section.
This should already work just fine in the master and ipa-4-12 branches. We also built packages for C9S and C10S.
master
ipa-4-12
Metadata Update from @abbra: - Issue close_status updated to: duplicate - Issue status updated to: Closed (was: Open)
Duplicate of https://pagure.io/freeipa/issue/9757