ldap: improve detection of Apple LDAP

When detecting the Apple fork of "legacy" LDAP, replace the `__APPLE__`
macro (which can be present also when using an old mainline OpenLDAP
while building for an Apple platform) with `LDAP_OPT_X_TLS_PASSPHRASE`
which is an Apple-specific macro, merged by Apple in 2007, later adding
the comment 'Apple Specific code'. This macro hasn't been retrofitted
to OpenLDAP since then, and unlikely to happen in the future.

Refs:
c4d990a6cf (diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R145)
49ac28a486 (diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R166)

Follow-up to 859ce48de1 #19832
Closes #19849
This commit is contained in:
Viktor Szakats 2025-12-05 12:43:37 +01:00
parent 8d9aa6d6e1
commit 2d6ade19fc
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -1029,7 +1029,7 @@ void Curl_ldap_version(char *buf, size_t bufsz)
#ifdef USE_WIN32_LDAP
curl_msnprintf(buf, bufsz, "WinLDAP");
#else
#ifdef __APPLE__
#ifdef LDAP_OPT_X_TLS_PASSPHRASE
static const char *flavor = "/Apple";
#else
static const char *flavor = "";