Bug 5513: Fix OpenLDAP detection
Authored-by: Mike Lothian [email protected]
This fixes https://bugs.squid-cache.org/show_bug.cgi?id=5513
And if you're happy with it, get it backported to 7.x too
Cannot create a git commit message from PR title and description.
Error while parsing PR description body: the line is too long 79>72
Problematic parser input:
This was enough to fix https://bugs.squid-cache.org/show_bug.cgi?id=5513 for me
Please see PR title and description formatting requirements for more details.
This message was added by Anubis bot. Anubis will add a new message if the error text changes. Anubis will remove M-failed-description label when there are no corresponding failures to report.
@FireBurn, do you have an ldap package installed? AFAICT, since 2024 commit 2a849db2, our logic for LDAP detection[^1] is "If pkg-config fails, rely on the user to specify correct libraries/flags/etc. for the features they want to enable (instead of poorly duplicating pgk-config logic/job)".
Bug report: Building Squid 7.1 on RHEL7 and RHEL8 gives:
checking for ldapssl_client_init in -lldap... no
checking for library containing ldap_url_desc2str... no
checking for library containing ldap_url_parse... no
checking for library containing ldap_start_tls_s... no
Where as 6.14 gives:
checking for ldapssl_client_init in -lldap... no
checking for library containing ldap_url_desc2str... -lldap
checking for library containing ldap_url_parse... none required
checking for library containing ldap_start_tls_s... none required
@FireBurn, what output do you get with these changes? Same as for v6.14?
Besides SQUID_CHECK_LDAP_API quoted above, is there output related to the PKG_CHECK_MODULES() call that fails to find ldap? If there is, please include it as well.
[^1]: Windows-specific hacks aside.
@FireBurn as there is a solution to the issue you highlighted, are you okay with closing this PR?
Sorry, I'll build 7.2 on Monday. If I have issues I'll report back
So with 7.2 with my patch:
checking for LIBLDAP... no checking for ber_init in -llber... yes checking for ldap_init in -lldap... yes checking ldap.h usability... yes checking ldap.h presence... yes checking for ldap.h... yes checking lber.h usability... yes checking lber.h presence... yes checking for lber.h... yes checking mozldap/ldap.h usability... no checking mozldap/ldap.h presence... no checking for mozldap/ldap.h... no checking for LDAP... 1 checking for OpenLDAP... 1 checking for Sun LDAP SDK... 0 checking for Mozilla LDAP SDK... 0 checking for LDAP_OPT_DEBUG_LEVEL... 1 checking for LDAP_SCOPE_DEFAULT... 1 checking for LDAP_REBIND_PROC... 1 checking for LDAP_REBINDPROC_CALLBACK... 0 checking for LDAP_REBIND_FUNCTION... 0 checking for LDAP_URL_LUD_SCHEME... 0 checking for ldapssl_client_init in -lldap... no checking for library containing ldap_url_desc2str... -lldap checking for library containing ldap_url_parse... none required checking for library containing ldap_start_tls_s... none required configure: Library 'ldap' support: yes -lldap -llber
With 7.3 with passing "--with-ldap=/usr/lib64" I get:
checking for LIBLDAP... no checking ldap.h usability... yes checking ldap.h presence... yes checking for ldap.h... yes checking lber.h usability... yes checking lber.h presence... yes checking for lber.h... yes checking mozldap/ldap.h usability... no checking mozldap/ldap.h presence... no checking for mozldap/ldap.h... no checking for LDAP... 1 checking for OpenLDAP... 1 checking for Sun LDAP SDK... 0 checking for Mozilla LDAP SDK... 0 checking for LDAP_OPT_DEBUG_LEVEL... 1 checking for LDAP_SCOPE_DEFAULT... 1 checking for LDAP_REBIND_PROC... 1 checking for LDAP_REBINDPROC_CALLBACK... 0 checking for LDAP_REBIND_FUNCTION... 0 checking for LDAP_URL_LUD_SCHEME... 0 checking for ldapssl_client_init in -lldap... no checking for library containing ldap_url_desc2str... no checking for library containing ldap_url_parse... no checking for library containing ldap_start_tls_s... no configure: error: Required library 'ldap' not found
Here is a diff-like summary of the previous comment:
-So with 7.2 with my patch:
+With 7.3 with passing "--with-ldap=/usr/lib64" I get:
-checking for ber_init in -llber... yes
-checking for ldap_init in -lldap... yes
-checking for library containing ldap_url_desc2str... -lldap
+checking for library containing ldap_url_desc2str... no
-checking for library containing ldap_url_parse... none required
+checking for library containing ldap_url_parse... no
-checking for library containing ldap_start_tls_s... none required
+checking for library containing ldap_start_tls_s... no
-configure: Library 'ldap' support: yes -lldap -llber
+configure: error: Required library 'ldap' not found
I also tried --with-openldap=/usr/lib64
Francesco: @FireBurn as there is a solution to the issue you highlighted, are you okay with closing this PR?
AFAICT, @FireBurn comment is meant to imply that the alternative "solution" discussed earlier does not work and, hence, this PR should be merged instead.
My change request remains unaddressed, but I would like to clarify one aspect to avoid a possible misunderstanding:
Mike: With 7.3 with passing "--with-ldap=/usr/lib64" I get: ...
Required library 'ldap' not found
The question is not whether --with-ldap=/usr/lib64 works. The question is whether --with-ldap=/usr/lib64 or some command line options/variables work in the given environment. If the answer is "no, no combination of command line options/variables works in the given environment", then the correct solution is most likely not
- let's change configure.ac so that no command line options/variables_ are necessary in this environment
Most likely, the correct solution is
- let's fix configure.ac so that
--with-ldap=/usr/lib64or some command line options/variables work in this environment
Justification for the above reasoning has been provided in my earlier change request.
I hope the diff in the earlier comment shows what command line options/variables are missing or what needs to be fixed in configure.ac. I have not studied the issue enough to suggest what is missing or needs to be fixed.