Fix compilation errors#8469
Conversation
There was a problem hiding this comment.
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.
|
Note: patch "BUILD: fix _POSIX_C_SOURCE redefinition with Python 3.14 and glibc 2.41+" shouldn't be required in 'sssd-2-9' |
|
|
7b02fa4 to
44b6bb8
Compare
44b6bb8 to
97c4412
Compare
|
Updated one commit message and re-ordered some patches. |
|
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>
97c4412 to
cd9b18b
Compare
No description provided.