svn commit: r1924557 - in /apr/apr-util/branches/1.7.x: CHANGES ldap/apr_ldap.c ldap/apr_ldap_option.c

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: minfrin
Date: Mon Mar 24 14:50:57 2025
New Revision: 1924557

URL: http://svn.apache.org/viewvc?rev=1924557&view=rev
Log:
apr_ldap: Fix the switching on and off of LDAP_OPT_SSL in the
Microsoft LDAP SDK.

Modified:
    apr/apr-util/branches/1.7.x/CHANGES
    apr/apr-util/branches/1.7.x/ldap/apr_ldap.c
    apr/apr-util/branches/1.7.x/ldap/apr_ldap_option.c

Modified: apr/apr-util/branches/1.7.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/CHANGES?rev=1924557&r1=1924556&r2=1924557&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.7.x/CHANGES [utf-8] Mon Mar 24 14:50:57 2025
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.7.0
 
+  *) apr_ldap: Fix the switching on and off of LDAP_OPT_SSL in the
+     Microsoft LDAP SDK. [Ivan Zhakov]
+
   *) apr_crypto_openssl: Add provider support on OpenSSL3+.
      [Graham Leggett]
 

Modified: apr/apr-util/branches/1.7.x/ldap/apr_ldap.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/ldap/apr_ldap.c?rev=1924557&r1=1924556&r2=1924557&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/ldap/apr_ldap.c (original)
+++ apr/apr-util/branches/1.7.x/ldap/apr_ldap.c Mon Mar 24 14:50:57 2025
@@ -591,8 +591,7 @@ static int option_set_tls(LDAP *ldap, co
     /* Microsoft SDK */
 #if APR_HAS_MICROSOFT_LDAPSDK
     if (tls == APR_LDAP_NONE) {
-        ULONG ul = (ULONG) LDAP_OPT_OFF;
-        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
+        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_OFF);
         if (result->rc != LDAP_SUCCESS) {
             result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off "
                              "failed.";
@@ -600,8 +599,7 @@ static int option_set_tls(LDAP *ldap, co
         }
     }
     else if (tls == APR_LDAP_SSL) {
-        ULONG ul = (ULONG) LDAP_OPT_ON;
-        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
+        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON);
         if (result->rc != LDAP_SUCCESS) {
             result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on "
                              "failed.";

Modified: apr/apr-util/branches/1.7.x/ldap/apr_ldap_option.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/ldap/apr_ldap_option.c?rev=1924557&r1=1924556&r2=1924557&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/ldap/apr_ldap_option.c (original)
+++ apr/apr-util/branches/1.7.x/ldap/apr_ldap_option.c Mon Mar 24 14:50:57 2025
@@ -333,8 +333,7 @@ static void option_set_tls(apr_pool_t *p
     /* Microsoft SDK */
 #if APR_HAS_MICROSOFT_LDAPSDK
     if (tls == APR_LDAP_NONE) {
-        ULONG ul = (ULONG) LDAP_OPT_OFF;
-        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
+        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_OFF);
         if (result->rc != LDAP_SUCCESS) {
             result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off "
                              "failed.";
@@ -342,8 +341,7 @@ static void option_set_tls(apr_pool_t *p
         }
     }
     else if (tls == APR_LDAP_SSL) {
-        ULONG ul = (ULONG) LDAP_OPT_ON;
-        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
+        result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON);
         if (result->rc != LDAP_SUCCESS) {
             result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on "
                              "failed.";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.