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

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: minfrin
Date: Mon Mar 24 21:12:39 2025
New Revision: 1924564

URL: http://svn.apache.org/viewvc?rev=1924564&view=rev
Log:
apr_ldap: Add support for z/OS.

Modified:
    apr/apr-util/branches/1.7.x/CHANGES
    apr/apr-util/branches/1.7.x/ldap/apr_ldap.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=1924564&r1=1924563&r2=1924564&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 21:12:39 2025
@@ -1,6 +1,8 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.7.0
 
+  *) apr_ldap: Add support for z/OS. [Eric Covener]
+
   *) apr_ldap: Fix the switching on and off of LDAP_OPT_SSL in the
      Microsoft LDAP SDK. [Ivan Zhakov]
 

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=1924564&r1=1924563&r2=1924564&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 21:12:39 2025
@@ -748,6 +748,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
 
     switch (option) {
     case APR_LDAP_OPT_API_INFO: {
+#if defined(LDAP_OPT_API_INFO)
         LDAPAPIInfo info = { 0 };
 
         info.ldapai_info_version = LDAP_API_INFO_VERSION;
@@ -761,9 +762,15 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
         outvalue->info.vendor_version = info.ldapai_vendor_version;
 
         break;
-
+#else
+        result->reason = "LDAP: API info not yet supported by APR on this "
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_API_FEATURE_INFO: {
+#if defined(LDAP_OPT_API_FEATURE_INFO)
         LDAPAPIFeatureInfo ldfi = { 0 };
 
         ldfi.ldapaif_info_version = LDAP_FEATURE_INFO_VERSION;
@@ -775,6 +782,12 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
 
         break;
 
+#else
+        result->reason = "LDAP: API feature info not yet supported by APR on this "
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_PROTOCOL_VERSION: {
 
@@ -789,6 +802,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
         return APR_SUCCESS;
     }
     case APR_LDAP_OPT_DESC: {
+#if defined(LDAP_OPT_DESC)
 
         apr_status_t status = APR_SUCCESS;
 
@@ -807,6 +821,12 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
         outvalue->socket = ldap->socket;
 
         return status;
+#else
+        result->reason = "LDAP: LDAP_OPT_DESC not yet supported by APR on this "
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_URI: {
 #if APR_HAS_OPENLDAP_LDAPSDK
@@ -1013,7 +1033,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
         break;
 
     case APR_LDAP_OPT_PROTOCOL_VERSION:
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_PROTOCOL_VERSION, &invalue->pv);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_PROTOCOL_VERSION, (void*)&invalue->pv);
         break;
 
     case APR_LDAP_OPT_HANDLE:
@@ -1032,11 +1052,11 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
 #endif
 
     case APR_LDAP_OPT_DEREF:
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_DEREF, &invalue->deref);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_DEREF, (void*)&invalue->deref);
         break;
 
     case APR_LDAP_OPT_REFERRALS: {
-        void *refs = invalue->refs ? LDAP_OPT_ON : LDAP_OPT_OFF;
+        void *refs = invalue->refs ? (void *)LDAP_OPT_ON : (void *)LDAP_OPT_OFF;
 
         /* Setting this option is supported on at least TIVOLI_SDK and OpenLDAP.
          */
@@ -1052,7 +1072,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
 #elif defined(LDAP_OPT_REFHOPLIMIT)
         /* Setting this option is supported on TIVOLI_SDK.
          */
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_REFHOPLIMIT, &invalue->refhoplimit);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_REFHOPLIMIT, (void*)&invalue->refhoplimit);
 #else
         /* If the LDAP_OPT_REFHOPLIMIT symbol is missing, assume that the
          * particular LDAP library has a reasonable default. So far certain
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.