Re: apr-util v1.7: request for more testing

Eric Covener <[email protected]> Fri, 21 Mar 2025 18:09:16 -0400
Newsgroups gmane.comp.apache.apr.devel
Message-ID <CALK=YjO_p-_rupfbsJMc7Kvx9T=76j4NObzf-aQ4pk03UaDRaw@mail.gmail.com>
On Fri, Mar 21, 2025 at 10:28 AM Eric Covener <[email protected]> wrote:
>
> On Fri, Mar 21, 2025 at 9:37 AM Graham Leggett <[email protected]> wrote:
> >
> > On 21 Mar 2025, at 00:02, Eric Covener <[email protected]> wrote:
> >
> > >> Keen to get z/OS tested if anyone has access.
> > >
> > > I will try to  chip away at getting apr-trunk to building/running.
> > >
> > > We only use an old fork there with a very convoluted build.
> >
> > I applied for dev access to z/OS, I will need hand holding though.
> >
> > I've made sure that the Tivoli LDAP API is supportable in the new API, keen to make sure it works as one of the supported APIs.
>
> I put in a bunch of small workarounds to make progress, but currently
> blocked on getting LDAP stubs to build so nothing is executing yet. We
> never had DBD or anything else with stubs in our embedded APR/APU.This
> platform has shared library oddities and we use a substitute libtool
> (similar to build/jlibtool.c?).  I am trying to get it working for the
> apr_ldap stub now.
>
> From a pure ldap.h POV there were a few breaks:
>
> - Doesn't exist: LDAPAPIInfo (seems to be present on Tivoli though)
> and LDAP_OPT_DESC (not present on Tivoli AFAICT)
> - LDAP_OPT_ON/LDAP_OPT_OFF are ints, not already pointers to ints (I
> just disabled for now, tivoli appears the same)
> - Values for LDAP_OPT_REFHOPLIMIT/LDAP_OPT_PROTOCOL_VERSION needed a
> (void*) cast (tivoli unknown, seems to be more about the compiler and
> having the val be the address of an enum value so assumed n/a for
> tivoli)
>
> Unfortunately the people with real background in zOS related  to
> apr/httpd are no longer with IBM / no longer active.
>
> I will try to get my notes into better shape and share the quick
> workarounds as well as a copy of the libtool substitute.
>
> If you get access to a system, you probably want this package manager:
> https://github.com/zopencommunity with at least git, bash, gmake,
> autoconf, and m4.
>
> If you build apr-trunk from git with the native compiler, you have to
> avoid getting files tagged as UTF-8 (I switch to IBM-1047 rather than
> ISO8859-1 as this is how we handle our bundled APR in our HTTPD fork):
> https://github.com/zopencommunity/gitport?tab=readme-ov-file#encodings-and-zos-file-tags-ccsids

libtool port: https://github.com/covener/zlibtool
patch attached to get apr-trunk compiling and linking, but ran out of
time before getting the dlsym in th stub working.
(./configure --prefix=$PWD/built  --with-expat=$HOME/expat/
--with-ldap-include=/usr/include --with-ldap-lib=/usr/lib/GLDCLD64.x
--with-ldap)

-- 
Eric Covener
[email protected]
ldap.diff (application/octet-stream, 2.8 KB)
diff --git ldap/apr_ldap.c ldap/apr_ldap.c
index 25cf8f913..85efe7be6 100644
--- ldap/apr_ldap.c
+++ ldap/apr_ldap.c
@@ -769,6 +769,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get(apr_pool_t *pool, apr_ldap_t
     memset(result, 0, sizeof(*result));
 
     switch (option) {
+#if !APR_HAS_ZOS_LDAPSDK
     case APR_LDAP_OPT_API_INFO: {
         LDAPAPIInfo info = { 0 };
 
@@ -798,6 +799,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get(apr_pool_t *pool, apr_ldap_t
         break;
 
     }
+#endif
     case APR_LDAP_OPT_PROTOCOL_VERSION: {
 
         rc = ldap_get_option(ldap ? ldap->ld : NULL, LDAP_OPT_PROTOCOL_VERSION, &outvalue->pv);
@@ -810,6 +812,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get(apr_pool_t *pool, apr_ldap_t
 
         return APR_SUCCESS;
     }
+#if !APR_HAS_ZOS_LDAPSDK
     case APR_LDAP_OPT_DESC: {
 
         apr_status_t status = APR_SUCCESS;
@@ -830,6 +833,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get(apr_pool_t *pool, apr_ldap_t
 
         return status;
     }
+#endif
     case APR_LDAP_OPT_URI: {
 #if APR_HAS_OPENLDAP_LDAPSDK
         rc = ldap_get_option(ldap ? ldap->ld : NULL, option, &outvalue->opt);
@@ -1035,7 +1039,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set(apr_pool_t *pool, apr_ldap_t
         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:
@@ -1054,9 +1058,10 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set(apr_pool_t *pool, apr_ldap_t
 #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;
 
+#if !APR_HAS_ZOS_LDAPSDK
     case APR_LDAP_OPT_REFERRALS: {
         void *refs = invalue->refs ? LDAP_OPT_ON : LDAP_OPT_OFF;
 
@@ -1066,6 +1071,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set(apr_pool_t *pool, apr_ldap_t
         break;
 
     }
+#endif
     case APR_LDAP_OPT_REFHOPLIMIT:
 #if defined(LDAP_OPT_REFERRAL_HOP_LIMIT)
         /* Microsoft SDK defines LDAP_OPT_REFERRAL_HOP_LIMIT
@@ -1074,7 +1080,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set(apr_pool_t *pool, apr_ldap_t
 #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