From 6ff0fab2f2e25e365b67b35b1fc062f94ca845c0 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 13 Dec 2022 00:13:55 -0600 Subject: user/openldap: add time64 patches. fixes #845. This patch is not intended to be upstreamed as written. --- user/openldap/APKBUILD | 4 +- user/openldap/time64.patch | 198 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 user/openldap/time64.patch diff --git a/user/openldap/APKBUILD b/user/openldap/APKBUILD index e0bb932b0..18e8c6fbc 100644 --- a/user/openldap/APKBUILD +++ b/user/openldap/APKBUILD @@ -14,7 +14,7 @@ # pkgname=openldap pkgver=2.6.3 -pkgrel=0 +pkgrel=1 pkgdesc="LDAP Server" url="https://www.openldap.org/" arch="all" @@ -34,6 +34,7 @@ source="https://www.$pkgname.org/software/download/OpenLDAP/$pkgname-release/$pk configs.patch test063.patch test079.patch + time64.patch slapd.initd slapd.confd @@ -190,5 +191,6 @@ sha512sums="56efbbfc68779ad635d2c25228eb9c4f1553b107b96e8a438029b1c5d2f2647cf4d4 1a1f669db968061eb8c9fb5e42768d0f12075d4eb4d8ae7085533276775027c56760c2f7413494deebec4d78b053f674661236e6e1506ecffadf510985c393c0 configs.patch 26fbe3fa2182d80ee98e6885972f803d03ac45a72cb8478c31e76a6f07f45565e6fdcdbf528fcf61e77fd4f9e2068e4f82d9c9c178df7da103d4e9b714bf204e test063.patch c7f2b32f2643d6b7ea5dbee6c1baad7cae53ea9d511cfae6c976edb8f8f85ae14351f612f02e560d15c6b577676804fd7b0a6f45f79cc1cdbe11f117e61ad088 test079.patch +a3d2ce7cbfd8a24605efef47550833e0a2e0f7aa426a46342e5f7bf2ef082b1640c31cd33eb246c225cc4cdc011ed4a640763158111e62f9e76e3530c3fa786e time64.patch 0c3606e4dad1b32f1c4b62f2bc1990a4c9f7ccd10c7b50e623309ba9df98064e68fc42a7242450f32fb6e5fa2203609d3d069871b5ae994cd4b227a078c93532 slapd.initd 64dc4c0aa0abe3d9f7d2aef25fe4c8e23c53df2421067947ac4d096c9e942b26356cb8577ebc41b52d88d0b0a03b2a3e435fe86242671f9b36555a5f82ee0e3a slapd.confd" diff --git a/user/openldap/time64.patch b/user/openldap/time64.patch new file mode 100644 index 000000000..780d67069 --- /dev/null +++ b/user/openldap/time64.patch @@ -0,0 +1,198 @@ +diff -ur a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c +--- a/libraries/libldap/os-ip.c 2022-12-12 23:12:56.618567894 -0600 ++++ b/libraries/libldap/os-ip.c 2022-12-13 00:07:17.852129075 -0600 +@@ -287,7 +287,7 @@ + int rc; + + +- Debug2(LDAP_DEBUG_TRACE, "ldap_int_poll: fd: %d tm: %ld\n", ++ Debug2(LDAP_DEBUG_TRACE, "ldap_int_poll: fd: %d tm: %lld\n", + s, tvp ? tvp->tv_sec : -1L ); + + #ifdef HAVE_POLL +@@ -439,7 +439,7 @@ + } + + Debug3(LDAP_DEBUG_TRACE, +- "ldap_pvt_connect: fd: %d tm: %ld async: %d\n", ++ "ldap_pvt_connect: fd: %d tm: %lld async: %d\n", + s, opt_tv ? tv.tv_sec : -1L, async); + + if ( opt_tv && ldap_pvt_ndelay_on(ld, s) == -1 ) +diff -ur a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c +--- a/libraries/libldap/os-local.c 2022-12-12 23:12:56.618567894 -0600 ++++ b/libraries/libldap/os-local.c 2022-12-12 23:36:15.152936427 -0600 +@@ -164,7 +164,7 @@ + } + + Debug3(LDAP_DEBUG_TRACE, +- "ldap_connect_timeout: fd: %d tm: %ld async: %d\n", ++ "ldap_connect_timeout: fd: %d tm: %lld async: %d\n", + s, opt_tv ? tv.tv_sec : -1L, async); + + if ( ldap_pvt_ndelay_on(ld, s) == -1 ) return -1; +diff -ur a/libraries/libldap/result.c b/libraries/libldap/result.c +--- a/libraries/libldap/result.c 2022-12-12 23:12:56.618567894 -0600 ++++ b/libraries/libldap/result.c 2022-12-12 23:34:24.977768222 -0600 +@@ -264,8 +264,8 @@ + Debug2( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (infinite timeout)\n", + (void *)ld, msgid ); + } else { +- Debug3( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (timeout %ld usec)\n", +- (void *)ld, msgid, (long)timeout->tv_sec * 1000000 + timeout->tv_usec ); ++ Debug3( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (timeout %lld usec)\n", ++ (void *)ld, msgid, (time_t)timeout->tv_sec * 1000000 + timeout->tv_usec ); + } + #endif /* LDAP_DEBUG */ + +diff -ur a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c +--- a/servers/slapd/back-ldap/bind.c 2022-12-12 23:12:56.614567788 -0600 ++++ b/servers/slapd/back-ldap/bind.c 2022-12-12 23:43:22.086371097 -0600 +@@ -2999,14 +2999,14 @@ + } + + if ( lc->lcb_create_time != 0 ) { +- len = snprintf( tbuf, sizeof(tbuf), "%ld", lc->lcb_create_time ); ++ len = snprintf( tbuf, sizeof(tbuf), "%lld", lc->lcb_create_time ); + if ( ptr + sizeof(" created=") + len >= end ) return -1; + ptr = lutil_strcopy( ptr, " created=" ); + ptr = lutil_strcopy( ptr, tbuf ); + } + + if ( lc->lcb_time != 0 ) { +- len = snprintf( tbuf, sizeof(tbuf), "%ld", lc->lcb_time ); ++ len = snprintf( tbuf, sizeof(tbuf), "%lld", lc->lcb_time ); + if ( ptr + sizeof(" modified=") + len >= end ) return -1; + ptr = lutil_strcopy( ptr, " modified=" ); + ptr = lutil_strcopy( ptr, tbuf ); +@@ -3185,7 +3185,7 @@ + */ + slap_wake_listener(); + Debug( LDAP_DEBUG_TRACE, +- "ldap_back_conn_prune: scheduled connection expiry timer to %ld sec\n", ++ "ldap_back_conn_prune: scheduled connection expiry timer to %lld sec\n", + li->li_conn_expire_task->interval.tv_sec ); + } else if ( next_timeout == -1 && li->li_conn_expire_task != NULL ) { + if ( ldap_pvt_runqueue_isrunning( &slapd_rq, li->li_conn_expire_task ) ) { +@@ -3221,7 +3221,7 @@ + "ldap_back_conn_expire_timer" ); + slap_wake_listener(); + Debug( LDAP_DEBUG_TRACE, +- "ldap_back_conn_prune: scheduled connection expiry timer to %ld sec\n", ++ "ldap_back_conn_prune: scheduled connection expiry timer to %lld sec\n", + li->li_conn_expire_task->interval.tv_sec ); + } + ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex ); +diff -ur a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c +--- a/servers/slapd/overlays/dds.c 2022-12-12 23:12:56.614567788 -0600 ++++ b/servers/slapd/overlays/dds.c 2022-12-12 23:42:29.632772350 -0600 +@@ -418,7 +418,7 @@ + assert( ttl <= DDS_RF2589_MAX_TTL ); + + bv.bv_val = ttlbuf; +- bv.bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%ld", ttl ); ++ bv.bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%lld", ttl ); + assert( bv.bv_len < sizeof( ttlbuf ) ); + + /* FIXME: apparently, values in op->ora_e are malloc'ed +@@ -696,7 +696,7 @@ + goto done; + } + +- bv_entryTtl.bv_len = snprintf( textbuf, sizeof( textbuf ), "%ld", entryTtl ); ++ bv_entryTtl.bv_len = snprintf( textbuf, sizeof( textbuf ), "%lld", entryTtl ); + break; + + default: +@@ -918,7 +918,7 @@ + ttl = (ttl < 0) ? 0 : ttl; + assert( ttl <= DDS_RF2589_MAX_TTL ); + +- len = snprintf( ttlbuf, sizeof(ttlbuf), "%ld", ttl ); ++ len = snprintf( ttlbuf, sizeof(ttlbuf), "%lld", ttl ); + if ( len < 0 ) + { + goto done; +@@ -1178,7 +1178,7 @@ + ttlmod.sml_values = ttlvalues; + ttlmod.sml_numvals = 1; + ttlvalues[ 0 ].bv_val = ttlbuf; +- ttlvalues[ 0 ].bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%ld", ttl ); ++ ttlvalues[ 0 ].bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%lld", ttl ); + BER_BVZERO( &ttlvalues[ 1 ] ); + + /* the entryExpireTimestamp is added by modify */ +@@ -1206,7 +1206,7 @@ + rs->sr_rspoid = ch_strdup( slap_EXOP_REFRESH.bv_val ); + + Log( LDAP_DEBUG_TRACE, LDAP_LEVEL_INFO, +- "%s REFRESH dn=\"%s\" TTL=%ld\n", ++ "%s REFRESH dn=\"%s\" TTL=%lld\n", + op->o_log_prefix, op->o_req_ndn.bv_val, ttl ); + } + +diff -ur a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c +--- a/servers/slapd/overlays/pcache.c 2022-12-12 23:12:56.614567788 -0600 ++++ b/servers/slapd/overlays/pcache.c 2022-12-13 00:07:55.205195373 -0600 +@@ -375,12 +375,12 @@ + attrset_len = sprintf( attrset_buf, + "%lu", (unsigned long)q->qtemp->attr_set_index ); + expiry_len = sprintf( expiry_buf, +- "%lu", (unsigned long)q->expiry_time ); ++ "%llu", (unsigned long long)q->expiry_time ); + answerable_len = snprintf( answerable_buf, sizeof( answerable_buf ), + "%lu", q->answerable_cnt ); + if ( q->refresh_time ) + refresh_len = sprintf( refresh_buf, +- "%lu", (unsigned long)q->refresh_time ); ++ "%llu", (unsigned long long)q->refresh_time ); + else + refresh_len = 0; + +@@ -1601,8 +1601,8 @@ + + new_cached_query->lru_up = NULL; + new_cached_query->lru_down = NULL; +- Debug( pcache_debug, "Added query expires at %ld (%s)\n", +- (long) new_cached_query->expiry_time, ++ Debug( pcache_debug, "Added query expires at %lld (%s)\n", ++ (long long) new_cached_query->expiry_time, + pc_caching_reason_str[ why ] ); + + new_cached_query->scope = query->scope; +@@ -2729,7 +2729,7 @@ + pbi->bi_flags |= BI_HASHED; + } else { + Debug( pcache_debug, "pc_bind_search: cache is stale, " +- "reftime: %ld, current time: %ld\n", ++ "reftime: %lld, current time: %lld\n", + pbi->bi_cq->bindref_time, op->o_time ); + } + } else if ( pbi->bi_si ) { +@@ -3865,7 +3865,7 @@ + struct berval bv; + switch( c->type ) { + case PC_MAIN: +- bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %d %d %d %ld", ++ bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %d %d %d %lld", + cm->db.bd_info->bi_type, cm->max_entries, cm->numattrsets, + cm->num_entries_limit, cm->cc_period ); + bv.bv_val = c->cr_msg; +@@ -3909,7 +3909,7 @@ + /* HEADS-UP: always print all; + * if optional == 0, ignore */ + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), +- " %d %ld %ld %ld %ld", ++ " %d %lld %lld %lld %lld", + temp->attr_set_index, + temp->ttl, + temp->negttl, +@@ -3931,7 +3931,7 @@ + for (temp=qm->templates; temp; temp=temp->qmnext) { + if ( !temp->bindttr ) continue; + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), +- " %d %ld %s ", ++ " %d %lld %s ", + temp->attr_set_index, + temp->bindttr, + ldap_pvt_scope2str( temp->bindscope )); -- cgit v1.2.3-70-g09d2