Skip to content

Commit f6d5cf5

Browse files
committed
apr_ldap: Fix the switching on and off of LDAP_OPT_SSL in the
Microsoft LDAP SDK. git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1924557 13f79535-47bb-0310-9956-ffa450edef68
1 parent 33e1bcf commit f6d5cf5

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
-*- coding: utf-8 -*-
22
Changes with APR-util 1.7.0
33

4+
*) apr_ldap: Fix the switching on and off of LDAP_OPT_SSL in the
5+
Microsoft LDAP SDK. [Ivan Zhakov]
6+
47
*) apr_crypto_openssl: Add provider support on OpenSSL3+.
58
[Graham Leggett]
69

ldap/apr_ldap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,17 +591,15 @@ static int option_set_tls(LDAP *ldap, const void *invalue,
591591
/* Microsoft SDK */
592592
#if APR_HAS_MICROSOFT_LDAPSDK
593593
if (tls == APR_LDAP_NONE) {
594-
ULONG ul = (ULONG) LDAP_OPT_OFF;
595-
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
594+
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_OFF);
596595
if (result->rc != LDAP_SUCCESS) {
597596
result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off "
598597
"failed.";
599598
result->msg = ldap_err2string(result->rc);
600599
}
601600
}
602601
else if (tls == APR_LDAP_SSL) {
603-
ULONG ul = (ULONG) LDAP_OPT_ON;
604-
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
602+
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON);
605603
if (result->rc != LDAP_SUCCESS) {
606604
result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on "
607605
"failed.";

ldap/apr_ldap_option.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,15 @@ static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue,
333333
/* Microsoft SDK */
334334
#if APR_HAS_MICROSOFT_LDAPSDK
335335
if (tls == APR_LDAP_NONE) {
336-
ULONG ul = (ULONG) LDAP_OPT_OFF;
337-
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
336+
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_OFF);
338337
if (result->rc != LDAP_SUCCESS) {
339338
result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off "
340339
"failed.";
341340
result->msg = ldap_err2string(result->rc);
342341
}
343342
}
344343
else if (tls == APR_LDAP_SSL) {
345-
ULONG ul = (ULONG) LDAP_OPT_ON;
346-
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul);
344+
result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON);
347345
if (result->rc != LDAP_SUCCESS) {
348346
result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on "
349347
"failed.";

0 commit comments

Comments
 (0)