Skip to content

[autobackport: sssd-2-13] sdap: defer libldap global options setup to first connection#8746

Merged
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8709-to-sssd-2-13
May 29, 2026
Merged

[autobackport: sssd-2-13] sdap: defer libldap global options setup to first connection#8746
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8709-to-sssd-2-13

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#8709 sdap: defer libldap global options setup to first connection to branch sssd-2-13, created by @alexey-tikhonov.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot [email protected]:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8709-to-sssd-2-13
git checkout SSSD-sssd-backport-pr8709-to-sssd-2-13
git push sssd-bot SSSD-sssd-backport-pr8709-to-sssd-2-13 --force

Original commits
b84e7fa - sdap: defer libldap global options setup to first connection

Backported commits

  • f9e87eb - sdap: defer libldap global options setup to first connection

Original Pull Request Body

During initialization LDAP/AD/IPA backends unconditionally call setup_tls_config() and setup_ldap_debug() that call ldap_set_option(). This triggers ldap_int_initialize() -> getaddrinfo(local_hostname). If DNS is unresponsive, this blocks and the backend doesn't complete initialization in time, so that 'monitor' terminates the entire SSSD.

Move these calls out of the module init path into a new sdap_setup_libldap_global_options() wrapper guarded by a static bool. Call it from sdap_connect_send() just before sss_ldap_init_send(), which is the single entry point for all LDAP connections.

:fixes:Fixed an issue where SSSD fails to start when DNS is unresponsive.

Assisted-By: Claude Code (Opus 4.6)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 refactors the initialization of global libldap options (debug level and TLS configuration) by consolidating the calls to setup_ldap_debug and setup_tls_config into a single, lazily-evaluated function sdap_setup_libldap_global_options. This new function uses a static guard to ensure global options are configured exactly once, and is invoked within sdap_connect_send instead of during individual provider initialization phases (AD, IPA, LDAP). There are no review comments, so no feedback is provided.

@alexey-tikhonov
alexey-tikhonov removed the request for review from danlavu May 29, 2026 09:58

@thalman thalman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well backported, CI failures are not caused by this change.

@alexey-tikhonov
alexey-tikhonov removed the request for review from sumit-bose May 29, 2026 10:57
@alexey-tikhonov alexey-tikhonov added no-backport This should go to target branch only. Accepted labels May 29, 2026
During initialization LDAP/AD/IPA backends unconditionally call
`setup_tls_config()` and `setup_ldap_debug()` that call
`ldap_set_option()`. This triggers `ldap_int_initialize()` ->
`getaddrinfo(local_hostname)`. If DNS is unresponsive, this blocks
and the backend doesn't complete initialization in time, so that
'monitor' terminates the entire SSSD.

Move these calls out of the module init path into a new
`sdap_setup_libldap_global_options()` wrapper guarded by a static bool.
Call it from `sdap_connect_send()` just before `sss_ldap_init_send()`,
which is the single entry point for all LDAP connections.

:fixes:Fixed an issue where SSSD fails to start when DNS is unresponsive.

Assisted-By: Claude Code (Opus 4.6)
Reviewed-by: Dan Lavu <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
Reviewed-by: Tomáš Halman <[email protected]>
(cherry picked from commit b84e7fa)
@sssd-bot

Copy link
Copy Markdown
Contributor Author

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


🟢 rpm-build:centos-stream-10-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)
🟢 testing-farm:fedora-43-x86_64:upstream (success)
🟢 testing-farm:fedora-44-x86_64:centos-stream-10 (success)
🟢 testing-farm:fedora-44-x86_64:upstream (success)
🔴 testing-farm:fedora-rawhide-x86_64:upstream (failure)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot
sssd-bot force-pushed the SSSD-sssd-backport-pr8709-to-sssd-2-13 branch from f9e87eb to 16149f5 Compare May 29, 2026 11:30
@alexey-tikhonov
alexey-tikhonov merged commit fa13812 into SSSD:sssd-2-13 May 29, 2026
3 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants