]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#7585 - Windows doesn't support LDAPI OPENLDAP_REL_ENG_2_4_48
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 23 Jul 2019 14:45:16 +0000 (14:45 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 23 Jul 2019 14:46:22 +0000 (14:46 +0000)
Adjust patch for ITS#7585 as Windows does not have LDAPI support.

libraries/libldap/cyrus.c

index 0c6e9f9471bb01e9c3b6f84c9715deda4c679287..d44b1b4f9b3f15e679b9bb6dcee5bb3e41efcee1 100644 (file)
@@ -385,7 +385,9 @@ ldap_int_sasl_bind(
        struct berval   ccred = BER_BVNULL;
        int saslrc, rc;
        unsigned credlen;
+#if !defined(_WIN32)
        char my_hostname[HOST_NAME_MAX + 1];
+#endif
        int free_saslhost = 0;
 
        Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
@@ -448,7 +450,9 @@ ldap_int_sasl_bind(
                        /* If we don't need to canonicalize just use the host
                         * from the LDAP URI.
                         * Always use the result of gethostname() for LDAPI.
+                        * Skip for Windows which doesn't support LDAPI.
                         */
+#if !defined(_WIN32)
                        if (ld->ld_defconn->lconn_server->lud_scheme != NULL &&
                            strcmp("ldapi", ld->ld_defconn->lconn_server->lud_scheme) == 0) {
                                rc = gethostname(my_hostname, HOST_NAME_MAX + 1);
@@ -457,7 +461,9 @@ ldap_int_sasl_bind(
                                } else {
                                        saslhost = "localhost";
                                }
-                       } else if ( nocanon )
+                       } else
+#endif
+                       if ( nocanon )
                                saslhost = ld->ld_defconn->lconn_server->lud_host;
                        else {
                                saslhost = ldap_host_connected_to( ld->ld_defconn->lconn_sb,