Skip to content

Fix compilation errors#8469

Merged
alexey-tikhonov merged 10 commits intoSSSD:masterfrom
alexey-tikhonov:fix-compilation-errors
Feb 23, 2026
Merged

Fix compilation errors#8469
alexey-tikhonov merged 10 commits intoSSSD:masterfrom
alexey-tikhonov:fix-compilation-errors

Conversation

@alexey-tikhonov
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

@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 primarily focuses on improving type safety and correctness across the codebase, particularly by changing char * declarations to const char * for variables that store the results of string searching functions like strchr and strrchr, as these functions return pointers to constant characters. This change is applied in src/lib/certmap/sss_certmap.c, src/providers/ad/ad_access.c, src/providers/krb5/krb5_common.c, src/providers/ldap/sdap.c, src/providers/ldap/sdap_async_groups.c, src/providers/ldap/sdap_range.c, and src/util/util.c. In src/providers/ldap/sdap_range.c, a new char *numendptr variable was introduced to correctly handle the char ** argument for strtouint32. Additionally, the pull request updates CMocka test macros and calls in src/tests/cmocka/common_mock.h, src/tests/cmocka/test_dyndns.c, src/tests/cmocka/test_nss_srv.c, src/tests/cmocka/test_responder_cache_req.c, and src/tests/cmocka/test_sdap.c to use will_return_uint_always or will_return_ptr_always and assert_uint_in_range for better type matching with unsigned int and pointer values. Finally, Makefile.am is updated to ensure pkglib libraries are installed before sssdlib libraries, resolving potential libtool relink failures during parallel installations due to inter-library dependencies.

Comment thread src/lib/certmap/sss_certmap.c
Comment thread src/lib/certmap/sss_certmap.c
Comment thread src/providers/ad/ad_access.c
Comment thread src/providers/ad/ad_access.c
Comment thread src/providers/krb5/krb5_common.c
Comment thread src/providers/ldap/sdap.c
Comment thread src/providers/ldap/sdap_async_groups.c
Comment thread src/providers/ldap/sdap_range.c
Comment thread src/tests/cmocka/test_dyndns.c Outdated
Comment thread src/util/util.c
@alexey-tikhonov
Copy link
Copy Markdown
Member Author

alexey-tikhonov commented Feb 19, 2026

Note: patch "BUILD: fix _POSIX_C_SOURCE redefinition with Python 3.14 and glibc 2.41+" shouldn't be required in 'sssd-2-9'

@alexey-tikhonov
Copy link
Copy Markdown
Member Author

will_return_uint_always (and friends) was introduced in cmocka 2.0.0, so can't be used on older Fedora versions.

@alexey-tikhonov
Copy link
Copy Markdown
Member Author

Updated one commit message and re-ordered some patches.

Copy link
Copy Markdown
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ack

@alexey-tikhonov alexey-tikhonov added coverity Trigger a coverity scan and removed Waiting for review coverity Trigger a coverity scan labels Feb 23, 2026
@alexey-tikhonov
Copy link
Copy Markdown
Member Author

Note: Covscan is green.

Use a separate `const char *dot` variable for the strchr() result
on the const input string, keeping the mutable `char *p` for the
later iteration over the output buffer.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make rid1 and rid2 `const char *` since they only hold strrchr()
results from const input strings and are used for pointer arithmetic.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make endptr and end_range `const char *` since they only hold
strchr()/strrchr() results from const input strings. Introduce a
separate `numendptr` variable for the strtouint32() output parameter.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make sep `const char *` since it only holds a strchr() result
from a const input string and is used for pointer arithmetic.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make specdelim and kwdelim `const char *` in parse_sub_filter() and
parse_filter() since they only hold strchr() results from const
input strings and are used for pointer arithmetic.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make delim in get_type_prefix() and sep in expand_sid() `const char *`
since they only hold strchr()/strrchr() results from const input
strings and are used for pointer arithmetic and reading.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Make at_sign `const char *` since it only holds a strchr() result
from a const input string and is used for reading.

Implementation-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Assisted-By: Claude Code (Opus 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Older Fedora versions still have cmocka < 2.0.0 making it
inconvinient to support two interfaces.

Reviewed-by: Tomáš Halman <thalman@redhat.com>
Python 3.14's pyconfig-64.h defines _POSIX_C_SOURCE=200809L and
_XOPEN_SOURCE=700, but glibc 2.41+ headers (pulled in earlier via
sss_nss_idmap.h) already define them to higher values (202405L and
800). This causes -Werror redefinition errors when building the Python
extension modules.

Assisted-By: Claude Code (Sonnet 4.6)
Reviewed-by: Tomáš Halman <thalman@redhat.com>
@sssd-bot
Copy link
Copy Markdown
Contributor

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


🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / intgcheck (fedora-45) (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🔴 ci / system (fedora-44) (failure)
🔴 ci / system (fedora-45) (failure)
➖ Coverity scan / coverity (skipped)
🟢 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.

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.

3 participants