]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ldap: improve detection of Apple LDAP
authorViktor Szakats <commit@vsz.me>
Fri, 5 Dec 2025 11:43:37 +0000 (12:43 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 5 Dec 2025 12:16:07 +0000 (13:16 +0100)
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:
https://github.com/apple-oss-distributions/OpenLDAP/commit/c4d990a6cfa0cb71d6dffe6f6aeeb722fd7c627b#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R145
https://github.com/apple-oss-distributions/OpenLDAP/commit/49ac28a486d72f36cd9713b41180b41d34f18ef6#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R166

Follow-up to 859ce48de12986f5bf846c2800dacab893ff12c1 #19832
Closes #19849

lib/ldap.c

index 92cfa3967fcfdbb2c775782af6c6fbb2c948d1f4..3dfbb330dc94b46740c66c818a3c62f4954226cb 100644 (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 = "";