Merge ~sergiodj/ubuntu/+source/openldap:MRE-2.5.15-jammy into ubuntu/+source/openldap:ubuntu/jammy-devel

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: cd0f88b119a818e3746edf9cdf8740354d63c09f
Proposed branch: ~sergiodj/ubuntu/+source/openldap:MRE-2.5.15-jammy
Merge into: ubuntu/+source/openldap:ubuntu/jammy-devel
Diff against target: 3560 lines (+794/-804)
69 files modified
CHANGES (+38/-0)
Makefile.in (+1/-1)
aclocal.m4 (+10/-10)
build/lib.mk (+1/-1)
build/openldap.m4 (+13/-3)
build/version.var (+4/-4)
clients/tools/ldapdelete.c (+7/-5)
configure (+239/-36)
configure.ac (+24/-11)
contrib/ldaptcl/tclAppInit.c (+1/-3)
contrib/ldaptcl/tkAppInit.c (+0/-13)
contrib/slapd-modules/datamorph/tests/run (+1/-213)
contrib/slapd-modules/emptyds/tests/run (+1/-202)
contrib/slapd-modules/variant/slapo-variant.5 (+2/-2)
contrib/slapd-modules/variant/tests/data/test001-04a-same-regex.ldif (+4/-0)
contrib/slapd-modules/variant/tests/data/test001-04b-same-regex.ldif (+4/-0)
contrib/slapd-modules/variant/tests/run (+1/-213)
contrib/slapd-modules/variant/variant.c (+30/-11)
debian/changelog (+8/-0)
doc/guide/admin/aspell.en.pws (+0/-1)
doc/guide/admin/guide.html (+3/-3)
doc/guide/admin/overlays.sdf (+2/-2)
doc/man/man5/lloadd.conf.5 (+1/-1)
doc/man/man5/slapd-ldap.5 (+1/-0)
doc/man/man5/slapo-pcache.5 (+1/-1)
libraries/libldap/init.c (+3/-3)
libraries/libldap/open.c (+6/-1)
libraries/libldap/tls_o.c (+16/-2)
libraries/liblmdb/CHANGES (+3/-0)
libraries/liblmdb/lmdb.h (+2/-2)
libraries/liblmdb/mdb.c (+3/-0)
libraries/librewrite/ldapmap.c (+7/-4)
servers/slapd/at.c (+4/-0)
servers/slapd/bconfig.c (+36/-3)
servers/slapd/overlays/constraint.c (+2/-2)
servers/slapd/overlays/dynlist.c (+110/-14)
servers/slapd/overlays/pcache.c (+2/-2)
servers/slapd/overlays/ppolicy.c (+4/-3)
servers/slapd/overlays/syncprov.c (+36/-6)
servers/slapd/overlays/translucent.c (+2/-2)
servers/slapd/overlays/unique.c (+3/-3)
servers/slapd/passwd.c (+2/-0)
servers/slapd/pwmods/README.argon2 (+6/-18)
servers/slapd/syncrepl.c (+3/-1)
servers/slapd/syslog.c (+1/-1)
tests/progs/slapd-mtread.c (+2/-0)
tests/progs/slapd-search.c (+2/-0)
tests/progs/slapd-watcher.c (+1/-1)
tests/scripts/lloadd/test001-backend-issues (+1/-0)
tests/scripts/lloadd/test002-load (+1/-0)
tests/scripts/lloadd/test003-cnconfig (+1/-0)
tests/scripts/lloadd/test004-monitor (+1/-0)
tests/scripts/test049-sync-config (+13/-0)
tests/scripts/test050-syncrepl-multiprovider (+5/-0)
tests/scripts/test053-syncprov-glue (+15/-0)
tests/scripts/test058-syncrepl-asymmetric (+12/-0)
tests/scripts/test059-consumer-config (+13/-0)
tests/scripts/test061-syncreplication-initiation (+6/-0)
tests/scripts/test062-config-delete (+6/-0)
tests/scripts/test063-delta-multiprovider (+6/-0)
tests/scripts/test064-constraint (+5/-0)
tests/scripts/test066-autoca (+6/-0)
tests/scripts/test069-delta-multiprovider-starttls (+7/-0)
tests/scripts/test070-delta-multiprovider-ldaps (+6/-0)
tests/scripts/test071-dirsync (+7/-0)
tests/scripts/test076-authid-rewrite (+6/-0)
tests/scripts/test078-persistent-sessionlog (+6/-0)
tests/scripts/test083-argon2 (+5/-0)
tests/scripts/test086-delta-consumer-config (+13/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Lena Voytek (community) Approve
Canonical Server Reporter Pending
Review via email: mp+446555@code.launchpad.net

Description of the change

This is the MRE of OpenLDAP 2.5.15 for Jammy.

As usual, this MRE introduces several bugfixes to the OpenLDAP package. There is one change which adds support for OpenSSL 3.0 to libldap, but it's a small commit and I don't believe it can be characterized as a new feature:

https://git.openldap.org/openldap/openldap/-/commit/7fba0f7ee568bdf04c608c0e66aefb2012e3fc33

PPA: https://launchpad.net/~sergiodj/+archive/ubuntu/openldap/+packages

I'll wait for the builds to be published before I trigger the dep8 tests for the reverse deps.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

FWIW, in theory this MRE should target Kinetic as well, but I don't think it's worth the effort so I will wait until Kinetic is EOL before I upload it to Jammy.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Analysis of the dep8 failures:

- libaws @ amd64:
- libaws @ arm64:
- libaws @ armhf:
- libaws @ ppc64el:
- libaws @ s390x:
- nss-pam-ldapd @ amd64:
- nss-pam-ldapd @ arm64:
- nss-pam-ldapd @ armhf:
- nss-pam-ldapd @ ppc64el:
- nss-pam-ldapd @ s390x:
- sudo @ armhf:
- volatildap @ armhf:
- cyrus-imapd @ ppc64el:
- pdns @ amd64:
- pdns @ arm64:
- pdns @ armhf:
- pdns @ ppc64el:
- pdns @ s390x:
- kopanocore @ s390x:
- squid @ armhf:

Already failing in Jammy.

- exim4 @ ppc64el:

Retriggered, and it failed again. However, the failure is well known (*** TLS startup failed (connect(): error:0A000438:SSL routines::tlsv1 alert internal error) and flaky.

The libreoffice tests are still running, but I don't foresee any problems with them. Everything else passed.

Revision history for this message
Lena Voytek (lvoytek) wrote :

LGTM, I looked through the list of changes and they all seem fine to me. A lot of them seem pretty helpful and otherwise the rest are mostly code style updates. The OpenSSL 3.0 support update looks fine on its own too. The bug report looks good too, although it may be worth mentioning the update for OpenSSL 3 support since its available in Jammy and could cause varied behavior with other packages.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: sergiodj, lvoytek
Uploaders: sergiodj, lvoytek
MP auto-approved

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I don't think we link with openssl, at least in mantic (also checked in focal):

$ grep tls debian/configure.options
# --with-tls with TLS/SSL support auto|openssl|gnutls [auto]
--with-tls=gnutls

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Wednesday, July 12 2023, Andreas Hasenack wrote:

> I don't think we link with openssl, at least in mantic (also checked in focal):
>
> $ grep tls debian/configure.options
> # --with-tls with TLS/SSL support auto|openssl|gnutls [auto]
> --with-tls=gnutls

Thanks Lena and Andreas.

Indeed, OpenLDAP isn't linked against OpenSSL in Jammy, so the change is
moot.

I'll go ahead and upload it.

$ dput openldap_2.5.15+dfsg-0ubuntu0.22.04.1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/openldap/openldap_2.5.15+dfsg-0ubuntu0.22.04.1_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/openldap/openldap_2.5.15+dfsg-0ubuntu0.22.04.1.dsc: Valid signature from 106DA1C8C3CBBF14
Package includes an .orig.tar.gz file although the debian revision suggests
that it might not be required. Multiple uploads of the .orig.tar.gz may be
rejected by the upload queue management software.
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading openldap_2.5.15+dfsg-0ubuntu0.22.04.1.dsc: done.
  Uploading openldap_2.5.15+dfsg.orig.tar.gz: done.
  Uploading openldap_2.5.15+dfsg-0ubuntu0.22.04.1.debian.tar.xz: done.
  Uploading openldap_2.5.15+dfsg-0ubuntu0.22.04.1_source.buildinfo: done.
  Uploading openldap_2.5.15+dfsg-0ubuntu0.22.04.1_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/CHANGES b/CHANGES
2index fe6949b..6256ae7 100644
3--- a/CHANGES
4+++ b/CHANGES
5@@ -1,5 +1,43 @@
6 OpenLDAP 2.5 Change Log
7
8+OpenLDAP 2.5.15 Release (2023/07/10)
9+ Added libldap openssl3 support (ITS#9436, ITS#10030)
10+ Fixed libldap handling of TCP KEEPALIVE options (ITS#10015)
11+ Fixed libldap with async connections (ITS#10023)
12+ Fixed libldap openssl TLSv1.3 cipher suite handling (ITS#10035)
13+ Fixed slapd callback handling with overlays that do extended operations (ITS#9990)
14+ Fixed slapd conversion of pcache configurations (ITS#10031)
15+ Fixed slapd cn=config modification handling with abandon (ITS#10045)
16+ Fixed slapo-constraint handling of push replication (ITS#9953)
17+ Fixed slapo-dynlist filter evaluation efficiency (ITS#10041)
18+ Fixed slapo-pcache handling of invalid schema (ITS#10032)
19+ Fixed slapo-ppolicy handling of push replication (ITS#9953)
20+ Fixed slapo-ppolicy handling of pwdMinDelay (ITS#10028)
21+ Fixed slapo-syncprov abandon handling (ITS#10016)
22+ Fixed slapo-translucent handling of invalid schema (ITS#10032)
23+ Fixed slapo-unique handling of push replication (ITS#9953)
24+ Fixed slapo-variant to improve regex handling (ITS#10048)
25+ Build Environment
26+ Fixed compatibility with stricter C99 compilers (ITS#10011)
27+ Keep .pc files during make clean (ITS#9989)
28+ Contrib
29+ Fixed slapo-variant handling of push replication (ITS#9953)
30+ Minor Cleanup
31+ ITS#9855
32+ ITS#9995
33+ ITS#9996
34+ ITS#9997
35+ ITS#9998
36+ ITS#9999
37+ ITS#10000
38+ ITS#10003
39+ ITS#10004
40+ ITS#10033
41+ ITS#10037
42+ ITS#10039
43+ ITS#10046
44+ ITS#10063
45+
46 OpenLDAP 2.5.14 Release (2023/02/08)
47 Fixed client tools to remove 'h' and 'p' options (ITS#9917,ITS#8618)
48 Fixed ldapsearch memory leak with paged results (ITS#9860)
49diff --git a/Makefile.in b/Makefile.in
50index 5c6bec0..2b87aa6 100644
51--- a/Makefile.in
52+++ b/Makefile.in
53@@ -29,7 +29,7 @@ clean-local: FORCE
54 $(RM) -r autom4te.cache
55
56 veryclean-local: FORCE
57- $(RM) config.status libtool stamp-h stamp-h.in
58+ $(RM) config.status libtool stamp-h stamp-h.in libraries/libldap/ldap.pc libraries/liblber/lber.pc
59
60 distclean: veryclean FORCE
61
62diff --git a/aclocal.m4 b/aclocal.m4
63index daf32af..8ccd66a 100644
64--- a/aclocal.m4
65+++ b/aclocal.m4
66@@ -1,6 +1,6 @@
67-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
68+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
69
70-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
71+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
72
73 # This file is free software; the Free Software Foundation
74 # gives unlimited permission to copy and/or distribute it,
75@@ -12,9 +12,9 @@
76 # PARTICULAR PURPOSE.
77
78 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
79-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
80-dnl serial 11 (pkg-config-0.29.1)
81-dnl
82+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
83+# serial 12 (pkg-config-0.29.2)
84+
85 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
86 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
87 dnl
88@@ -55,7 +55,7 @@ dnl
89 dnl See the "Since" comment for each macro you use to see what version
90 dnl of the macros you require.
91 m4_defun([PKG_PREREQ],
92-[m4_define([PKG_MACROS_VERSION], [0.29.1])
93+[m4_define([PKG_MACROS_VERSION], [0.29.2])
94 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
95 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
96 ])dnl PKG_PREREQ
97@@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
98 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
99
100 pkg_failed=no
101-AC_MSG_CHECKING([for $1])
102+AC_MSG_CHECKING([for $2])
103
104 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
105 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
106@@ -166,11 +166,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
107 See the pkg-config man page for more details.])
108
109 if test $pkg_failed = yes; then
110- AC_MSG_RESULT([no])
111+ AC_MSG_RESULT([no])
112 _PKG_SHORT_ERRORS_SUPPORTED
113 if test $_pkg_short_errors_supported = yes; then
114 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
115- else
116+ else
117 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
118 fi
119 # Put the nasty error message in config.log where it belongs
120@@ -187,7 +187,7 @@ installed software in a non-standard prefix.
121 _PKG_TEXT])[]dnl
122 ])
123 elif test $pkg_failed = untried; then
124- AC_MSG_RESULT([no])
125+ AC_MSG_RESULT([no])
126 m4_default([$4], [AC_MSG_FAILURE(
127 [The pkg-config script could not be found or is too old. Make sure it
128 is in your PATH or set the PKG_CONFIG environment variable to the full
129diff --git a/build/lib.mk b/build/lib.mk
130index 442c0d3..c50ef52 100644
131--- a/build/lib.mk
132+++ b/build/lib.mk
133@@ -40,7 +40,7 @@ lint5: lint5-local FORCE
134 clean-common: FORCE
135 $(RM) $(LIBRARY) ../$(LIBRARY) $(XLIBRARY) \
136 $(PROGRAMS) $(XPROGRAMS) $(XSRCS) $(XXSRCS) \
137- *.o *.lo a.out *.exe *.pc core version.c .libs/*
138+ *.o *.lo a.out *.exe core version.c .libs/*
139
140 depend-common: FORCE
141 $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $(XXSRCS)
142diff --git a/build/openldap.m4 b/build/openldap.m4
143index c7fa19e..9419aaf 100644
144--- a/build/openldap.m4
145+++ b/build/openldap.m4
146@@ -154,6 +154,7 @@ fi
147 if test $ol_cv_header_stdc = yes; then
148 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
149 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
150+#include <stdlib.h>
151 #ifndef HAVE_EBCDIC
152 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
153 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
154@@ -303,8 +304,12 @@ AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
155 #define NULL (void*)0
156 #endif
157
158+#ifdef __STDC__
159+static void *task(void *p)
160+#else
161 static void *task(p)
162 void *p;
163+#endif
164 {
165 return (void *) (p == NULL);
166 }
167@@ -360,9 +365,13 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
168 AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
169 [AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
170
171+#ifdef __STDC__
172+int main(int argc, char **argv)
173+#else
174 int main(argc, argv)
175 int argc;
176 char **argv;
177+#endif
178 {
179 OL_PTHREAD_TEST_FUNCTION
180 }
181@@ -484,7 +493,7 @@ AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
182 #include <sys/types.h>
183 #include <regex.h>
184 static char *pattern, *string;
185-main()
186+int main(void)
187 {
188 int rc;
189 regex_t re;
190@@ -511,7 +520,8 @@ AC_DEFUN([OL_C_UPPER_LOWER],
191 [AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
192 AC_RUN_IFELSE([AC_LANG_SOURCE([[
193 #include <ctype.h>
194-main()
195+#include <stdlib.h>
196+int main(void)
197 {
198 if ('C' == toupper('C'))
199 exit(0);
200@@ -569,7 +579,7 @@ AC_DEFUN([OL_NONPOSIX_STRERROR_R],
201 ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
202 else
203 AC_RUN_IFELSE([AC_LANG_SOURCE([[
204- main() {
205+ int main(void) {
206 char buf[100];
207 buf[0] = 0;
208 strerror_r( 1, buf, sizeof buf );
209diff --git a/build/version.var b/build/version.var
210index 19cfaea..5bcd71b 100644
211--- a/build/version.var
212+++ b/build/version.var
213@@ -15,9 +15,9 @@
214 ol_package=OpenLDAP
215 ol_major=2
216 ol_minor=5
217-ol_patch=14
218-ol_api_inc=20514
219+ol_patch=15
220+ol_api_inc=20515
221 ol_api_current=1
222-ol_api_revision=9
223+ol_api_revision=10
224 ol_api_age=1
225-ol_release_date="2023/02/08"
226+ol_release_date="2023/07/10"
227diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c
228index 6024a33..e572e43 100644
229--- a/clients/tools/ldapdelete.c
230+++ b/clients/tools/ldapdelete.c
231@@ -386,7 +386,9 @@ more:;
232 break;
233 default:
234 tool_perror( "ldap_search", srch_rc, NULL, NULL, NULL, NULL );
235- return( srch_rc );
236+ rc = srch_rc;
237+ srch_rc = 0;
238+ goto leave;
239 }
240
241 entries = ldap_count_entries( ld, res );
242@@ -402,15 +404,14 @@ more:;
243 if( dn == NULL ) {
244 ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
245 tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
246- ber_memfree( dn );
247- return rc;
248+ goto leave;
249 }
250
251 rc = deletechildren( ld, dn, 0 );
252 if ( rc != LDAP_SUCCESS ) {
253 tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
254 ber_memfree( dn );
255- return rc;
256+ goto leave;
257 }
258
259 if ( verbose ) {
260@@ -421,7 +422,7 @@ more:;
261 if ( rc != LDAP_SUCCESS ) {
262 tool_perror( "ldap_delete", rc, NULL, NULL, NULL, NULL );
263 ber_memfree( dn );
264- return rc;
265+ goto leave;
266
267 }
268
269@@ -433,6 +434,7 @@ more:;
270 }
271 }
272
273+leave:
274 ldap_msgfree( res );
275
276 if ( srch_rc == LDAP_SIZELIMIT_EXCEEDED ) {
277diff --git a/configure b/configure
278index b718883..ae23534 100755
279--- a/configure
280+++ b/configure
281@@ -1,5 +1,5 @@
282 #! /bin/sh
283-# From configure.ac Id: 3943f6265060065483db582e5c7bef14fe934d80 .
284+# From configure.ac Id: a4836a8a0218326643db20d8131fc717d1fc3edf .
285 # Guess values for system-dependent variables and create Makefiles.
286 # Generated by GNU Autoconf 2.69.
287 #
288@@ -812,7 +812,6 @@ infodir
289 docdir
290 oldincludedir
291 includedir
292-runstatedir
293 localstatedir
294 sharedstatedir
295 sysconfdir
296@@ -973,7 +972,6 @@ datadir='${datarootdir}'
297 sysconfdir='${prefix}/etc'
298 sharedstatedir='${prefix}/com'
299 localstatedir='${prefix}/var'
300-runstatedir='${localstatedir}/run'
301 includedir='${prefix}/include'
302 oldincludedir='/usr/include'
303 docdir='${datarootdir}/doc/${PACKAGE}'
304@@ -1226,15 +1224,6 @@ do
305 | -silent | --silent | --silen | --sile | --sil)
306 silent=yes ;;
307
308- -runstatedir | --runstatedir | --runstatedi | --runstated \
309- | --runstate | --runstat | --runsta | --runst | --runs \
310- | --run | --ru | --r)
311- ac_prev=runstatedir ;;
312- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
313- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
314- | --run=* | --ru=* | --r=*)
315- runstatedir=$ac_optarg ;;
316-
317 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
318 ac_prev=sbindir ;;
319 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
320@@ -1372,7 +1361,7 @@ fi
321 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
322 datadir sysconfdir sharedstatedir localstatedir includedir \
323 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
324- libdir localedir mandir runstatedir
325+ libdir localedir mandir
326 do
327 eval ac_val=\$$ac_var
328 # Remove trailing slashes.
329@@ -1525,7 +1514,6 @@ Fine tuning of the installation directories:
330 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
331 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
332 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
333- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
334 --libdir=DIR object code libraries [EPREFIX/lib]
335 --includedir=DIR C header files [PREFIX/include]
336 --oldincludedir=DIR C header files for non-gcc [/usr/include]
337@@ -15303,6 +15291,7 @@ else
338 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
339 /* end confdefs.h. */
340 #include <ctype.h>
341+#include <stdlib.h>
342 #ifndef HAVE_EBCDIC
343 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
344 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
345@@ -16271,6 +16260,10 @@ $as_echo "no" >&6; }
346 else
347 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
348 /* end confdefs.h. */
349+#include <stdlib.h>
350+#ifdef HAVE_SYS_POLL_H
351+#include <sys/epoll.h>
352+#endif
353 int main(int argc, char **argv)
354 {
355 int epfd = epoll_create(256);
356@@ -16451,7 +16444,7 @@ else
357 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
358 /* end confdefs.h. */
359
360- main() {
361+ int main(void) {
362 char buf[100];
363 buf[0] = 0;
364 strerror_r( 1, buf, sizeof buf );
365@@ -16651,7 +16644,7 @@ else
366 #include <sys/types.h>
367 #include <regex.h>
368 static char *pattern, *string;
369-main()
370+int main(void)
371 {
372 int rc;
373 regex_t re;
374@@ -17447,9 +17440,9 @@ See \`config.log' for more details" "$LINENO" 5; }
375 fi
376 rm -f conftest.err conftest.i conftest.$ac_ext
377
378- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_export_keying_material_early in -lssl" >&5
379-$as_echo_n "checking for SSL_export_keying_material_early in -lssl... " >&6; }
380-if ${ac_cv_lib_ssl_SSL_export_keying_material_early+:} false; then :
381+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_set_ciphersuites in -lssl" >&5
382+$as_echo_n "checking for SSL_CTX_set_ciphersuites in -lssl... " >&6; }
383+if ${ac_cv_lib_ssl_SSL_CTX_set_ciphersuites+:} false; then :
384 $as_echo_n "(cached) " >&6
385 else
386 ac_check_lib_save_LIBS=$LIBS
387@@ -17463,27 +17456,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
388 #ifdef __cplusplus
389 extern "C"
390 #endif
391-char SSL_export_keying_material_early ();
392+char SSL_CTX_set_ciphersuites ();
393 int
394 main ()
395 {
396-return SSL_export_keying_material_early ();
397+return SSL_CTX_set_ciphersuites ();
398 ;
399 return 0;
400 }
401 _ACEOF
402 if ac_fn_c_try_link "$LINENO"; then :
403- ac_cv_lib_ssl_SSL_export_keying_material_early=yes
404+ ac_cv_lib_ssl_SSL_CTX_set_ciphersuites=yes
405 else
406- ac_cv_lib_ssl_SSL_export_keying_material_early=no
407+ ac_cv_lib_ssl_SSL_CTX_set_ciphersuites=no
408 fi
409 rm -f core conftest.err conftest.$ac_objext \
410 conftest$ac_exeext conftest.$ac_ext
411 LIBS=$ac_check_lib_save_LIBS
412 fi
413-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_export_keying_material_early" >&5
414-$as_echo "$ac_cv_lib_ssl_SSL_export_keying_material_early" >&6; }
415-if test "x$ac_cv_lib_ssl_SSL_export_keying_material_early" = xyes; then :
416+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_set_ciphersuites" >&5
417+$as_echo "$ac_cv_lib_ssl_SSL_CTX_set_ciphersuites" >&6; }
418+if test "x$ac_cv_lib_ssl_SSL_CTX_set_ciphersuites" = xyes; then :
419 have_openssl=yes
420 else
421 have_openssl=no
422@@ -17865,8 +17858,12 @@ else
423 #define NULL (void*)0
424 #endif
425
426+#ifdef __STDC__
427+static void *task(void *p)
428+#else
429 static void *task(p)
430 void *p;
431+#endif
432 {
433 return (void *) (p == NULL);
434 }
435@@ -17945,16 +17942,24 @@ else
436 #define NULL (void*)0
437 #endif
438
439+#ifdef __STDC__
440+static void *task(void *p)
441+#else
442 static void *task(p)
443 void *p;
444+#endif
445 {
446 return (void *) (p == NULL);
447 }
448
449
450+#ifdef __STDC__
451+int main(int argc, char **argv)
452+#else
453 int main(argc, argv)
454 int argc;
455 char **argv;
456+#endif
457 {
458
459 /* pthread test function */
460@@ -18050,8 +18055,12 @@ else
461 #define NULL (void*)0
462 #endif
463
464+#ifdef __STDC__
465+static void *task(void *p)
466+#else
467 static void *task(p)
468 void *p;
469+#endif
470 {
471 return (void *) (p == NULL);
472 }
473@@ -18130,16 +18139,24 @@ else
474 #define NULL (void*)0
475 #endif
476
477+#ifdef __STDC__
478+static void *task(void *p)
479+#else
480 static void *task(p)
481 void *p;
482+#endif
483 {
484 return (void *) (p == NULL);
485 }
486
487
488+#ifdef __STDC__
489+int main(int argc, char **argv)
490+#else
491 int main(argc, argv)
492 int argc;
493 char **argv;
494+#endif
495 {
496
497 /* pthread test function */
498@@ -18240,8 +18257,12 @@ else
499 #define NULL (void*)0
500 #endif
501
502+#ifdef __STDC__
503+static void *task(void *p)
504+#else
505 static void *task(p)
506 void *p;
507+#endif
508 {
509 return (void *) (p == NULL);
510 }
511@@ -18320,16 +18341,24 @@ else
512 #define NULL (void*)0
513 #endif
514
515+#ifdef __STDC__
516+static void *task(void *p)
517+#else
518 static void *task(p)
519 void *p;
520+#endif
521 {
522 return (void *) (p == NULL);
523 }
524
525
526+#ifdef __STDC__
527+int main(int argc, char **argv)
528+#else
529 int main(argc, argv)
530 int argc;
531 char **argv;
532+#endif
533 {
534
535 /* pthread test function */
536@@ -18430,8 +18459,12 @@ else
537 #define NULL (void*)0
538 #endif
539
540+#ifdef __STDC__
541+static void *task(void *p)
542+#else
543 static void *task(p)
544 void *p;
545+#endif
546 {
547 return (void *) (p == NULL);
548 }
549@@ -18510,16 +18543,24 @@ else
550 #define NULL (void*)0
551 #endif
552
553+#ifdef __STDC__
554+static void *task(void *p)
555+#else
556 static void *task(p)
557 void *p;
558+#endif
559 {
560 return (void *) (p == NULL);
561 }
562
563
564+#ifdef __STDC__
565+int main(int argc, char **argv)
566+#else
567 int main(argc, argv)
568 int argc;
569 char **argv;
570+#endif
571 {
572
573 /* pthread test function */
574@@ -18620,8 +18661,12 @@ else
575 #define NULL (void*)0
576 #endif
577
578+#ifdef __STDC__
579+static void *task(void *p)
580+#else
581 static void *task(p)
582 void *p;
583+#endif
584 {
585 return (void *) (p == NULL);
586 }
587@@ -18700,16 +18745,24 @@ else
588 #define NULL (void*)0
589 #endif
590
591+#ifdef __STDC__
592+static void *task(void *p)
593+#else
594 static void *task(p)
595 void *p;
596+#endif
597 {
598 return (void *) (p == NULL);
599 }
600
601
602+#ifdef __STDC__
603+int main(int argc, char **argv)
604+#else
605 int main(argc, argv)
606 int argc;
607 char **argv;
608+#endif
609 {
610
611 /* pthread test function */
612@@ -18810,8 +18863,12 @@ else
613 #define NULL (void*)0
614 #endif
615
616+#ifdef __STDC__
617+static void *task(void *p)
618+#else
619 static void *task(p)
620 void *p;
621+#endif
622 {
623 return (void *) (p == NULL);
624 }
625@@ -18890,16 +18947,24 @@ else
626 #define NULL (void*)0
627 #endif
628
629+#ifdef __STDC__
630+static void *task(void *p)
631+#else
632 static void *task(p)
633 void *p;
634+#endif
635 {
636 return (void *) (p == NULL);
637 }
638
639
640+#ifdef __STDC__
641+int main(int argc, char **argv)
642+#else
643 int main(argc, argv)
644 int argc;
645 char **argv;
646+#endif
647 {
648
649 /* pthread test function */
650@@ -19001,8 +19066,12 @@ else
651 #define NULL (void*)0
652 #endif
653
654+#ifdef __STDC__
655+static void *task(void *p)
656+#else
657 static void *task(p)
658 void *p;
659+#endif
660 {
661 return (void *) (p == NULL);
662 }
663@@ -19081,16 +19150,24 @@ else
664 #define NULL (void*)0
665 #endif
666
667+#ifdef __STDC__
668+static void *task(void *p)
669+#else
670 static void *task(p)
671 void *p;
672+#endif
673 {
674 return (void *) (p == NULL);
675 }
676
677
678+#ifdef __STDC__
679+int main(int argc, char **argv)
680+#else
681 int main(argc, argv)
682 int argc;
683 char **argv;
684+#endif
685 {
686
687 /* pthread test function */
688@@ -19191,8 +19268,12 @@ else
689 #define NULL (void*)0
690 #endif
691
692+#ifdef __STDC__
693+static void *task(void *p)
694+#else
695 static void *task(p)
696 void *p;
697+#endif
698 {
699 return (void *) (p == NULL);
700 }
701@@ -19271,16 +19352,24 @@ else
702 #define NULL (void*)0
703 #endif
704
705+#ifdef __STDC__
706+static void *task(void *p)
707+#else
708 static void *task(p)
709 void *p;
710+#endif
711 {
712 return (void *) (p == NULL);
713 }
714
715
716+#ifdef __STDC__
717+int main(int argc, char **argv)
718+#else
719 int main(argc, argv)
720 int argc;
721 char **argv;
722+#endif
723 {
724
725 /* pthread test function */
726@@ -19382,8 +19471,12 @@ else
727 #define NULL (void*)0
728 #endif
729
730+#ifdef __STDC__
731+static void *task(void *p)
732+#else
733 static void *task(p)
734 void *p;
735+#endif
736 {
737 return (void *) (p == NULL);
738 }
739@@ -19462,16 +19555,24 @@ else
740 #define NULL (void*)0
741 #endif
742
743+#ifdef __STDC__
744+static void *task(void *p)
745+#else
746 static void *task(p)
747 void *p;
748+#endif
749 {
750 return (void *) (p == NULL);
751 }
752
753
754+#ifdef __STDC__
755+int main(int argc, char **argv)
756+#else
757 int main(argc, argv)
758 int argc;
759 char **argv;
760+#endif
761 {
762
763 /* pthread test function */
764@@ -19573,8 +19674,12 @@ else
765 #define NULL (void*)0
766 #endif
767
768+#ifdef __STDC__
769+static void *task(void *p)
770+#else
771 static void *task(p)
772 void *p;
773+#endif
774 {
775 return (void *) (p == NULL);
776 }
777@@ -19653,16 +19758,24 @@ else
778 #define NULL (void*)0
779 #endif
780
781+#ifdef __STDC__
782+static void *task(void *p)
783+#else
784 static void *task(p)
785 void *p;
786+#endif
787 {
788 return (void *) (p == NULL);
789 }
790
791
792+#ifdef __STDC__
793+int main(int argc, char **argv)
794+#else
795 int main(argc, argv)
796 int argc;
797 char **argv;
798+#endif
799 {
800
801 /* pthread test function */
802@@ -19763,8 +19876,12 @@ else
803 #define NULL (void*)0
804 #endif
805
806+#ifdef __STDC__
807+static void *task(void *p)
808+#else
809 static void *task(p)
810 void *p;
811+#endif
812 {
813 return (void *) (p == NULL);
814 }
815@@ -19843,16 +19960,24 @@ else
816 #define NULL (void*)0
817 #endif
818
819+#ifdef __STDC__
820+static void *task(void *p)
821+#else
822 static void *task(p)
823 void *p;
824+#endif
825 {
826 return (void *) (p == NULL);
827 }
828
829
830+#ifdef __STDC__
831+int main(int argc, char **argv)
832+#else
833 int main(argc, argv)
834 int argc;
835 char **argv;
836+#endif
837 {
838
839 /* pthread test function */
840@@ -19954,8 +20079,12 @@ else
841 #define NULL (void*)0
842 #endif
843
844+#ifdef __STDC__
845+static void *task(void *p)
846+#else
847 static void *task(p)
848 void *p;
849+#endif
850 {
851 return (void *) (p == NULL);
852 }
853@@ -20034,16 +20163,24 @@ else
854 #define NULL (void*)0
855 #endif
856
857+#ifdef __STDC__
858+static void *task(void *p)
859+#else
860 static void *task(p)
861 void *p;
862+#endif
863 {
864 return (void *) (p == NULL);
865 }
866
867
868+#ifdef __STDC__
869+int main(int argc, char **argv)
870+#else
871 int main(argc, argv)
872 int argc;
873 char **argv;
874+#endif
875 {
876
877 /* pthread test function */
878@@ -20145,8 +20282,12 @@ else
879 #define NULL (void*)0
880 #endif
881
882+#ifdef __STDC__
883+static void *task(void *p)
884+#else
885 static void *task(p)
886 void *p;
887+#endif
888 {
889 return (void *) (p == NULL);
890 }
891@@ -20225,16 +20366,24 @@ else
892 #define NULL (void*)0
893 #endif
894
895+#ifdef __STDC__
896+static void *task(void *p)
897+#else
898 static void *task(p)
899 void *p;
900+#endif
901 {
902 return (void *) (p == NULL);
903 }
904
905
906+#ifdef __STDC__
907+int main(int argc, char **argv)
908+#else
909 int main(argc, argv)
910 int argc;
911 char **argv;
912+#endif
913 {
914
915 /* pthread test function */
916@@ -20335,8 +20484,12 @@ else
917 #define NULL (void*)0
918 #endif
919
920+#ifdef __STDC__
921+static void *task(void *p)
922+#else
923 static void *task(p)
924 void *p;
925+#endif
926 {
927 return (void *) (p == NULL);
928 }
929@@ -20415,16 +20568,24 @@ else
930 #define NULL (void*)0
931 #endif
932
933+#ifdef __STDC__
934+static void *task(void *p)
935+#else
936 static void *task(p)
937 void *p;
938+#endif
939 {
940 return (void *) (p == NULL);
941 }
942
943
944+#ifdef __STDC__
945+int main(int argc, char **argv)
946+#else
947 int main(argc, argv)
948 int argc;
949 char **argv;
950+#endif
951 {
952
953 /* pthread test function */
954@@ -20525,8 +20686,12 @@ else
955 #define NULL (void*)0
956 #endif
957
958+#ifdef __STDC__
959+static void *task(void *p)
960+#else
961 static void *task(p)
962 void *p;
963+#endif
964 {
965 return (void *) (p == NULL);
966 }
967@@ -20605,16 +20770,24 @@ else
968 #define NULL (void*)0
969 #endif
970
971+#ifdef __STDC__
972+static void *task(void *p)
973+#else
974 static void *task(p)
975 void *p;
976+#endif
977 {
978 return (void *) (p == NULL);
979 }
980
981
982+#ifdef __STDC__
983+int main(int argc, char **argv)
984+#else
985 int main(argc, argv)
986 int argc;
987 char **argv;
988+#endif
989 {
990
991 /* pthread test function */
992@@ -20716,8 +20889,12 @@ else
993 #define NULL (void*)0
994 #endif
995
996+#ifdef __STDC__
997+static void *task(void *p)
998+#else
999 static void *task(p)
1000 void *p;
1001+#endif
1002 {
1003 return (void *) (p == NULL);
1004 }
1005@@ -20796,16 +20973,24 @@ else
1006 #define NULL (void*)0
1007 #endif
1008
1009+#ifdef __STDC__
1010+static void *task(void *p)
1011+#else
1012 static void *task(p)
1013 void *p;
1014+#endif
1015 {
1016 return (void *) (p == NULL);
1017 }
1018
1019
1020+#ifdef __STDC__
1021+int main(int argc, char **argv)
1022+#else
1023 int main(argc, argv)
1024 int argc;
1025 char **argv;
1026+#endif
1027 {
1028
1029 /* pthread test function */
1030@@ -21017,14 +21202,12 @@ else
1031 /* end confdefs.h. */
1032
1033 #include <pthread.h>
1034-#ifndef NULL
1035-#define NULL (void*)0
1036-#endif
1037+pthread_t thread;
1038
1039 int
1040 main ()
1041 {
1042-pthread_detach(NULL);
1043+pthread_detach(thread);
1044 ;
1045 return 0;
1046 }
1047@@ -21138,16 +21321,24 @@ else
1048 #define NULL (void*)0
1049 #endif
1050
1051+#ifdef __STDC__
1052+static void *task(void *p)
1053+#else
1054 static void *task(p)
1055 void *p;
1056+#endif
1057 {
1058 return (void *) (p == NULL);
1059 }
1060
1061
1062+#ifdef __STDC__
1063+int main(int argc, char **argv)
1064+#else
1065 int main(argc, argv)
1066 int argc;
1067 char **argv;
1068+#endif
1069 {
1070
1071 /* pthread test function */
1072@@ -21237,6 +21428,9 @@ else
1073 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1074 /* end confdefs.h. */
1075
1076+#define _XOPEN_SOURCE 500 /* For pthread_setconcurrency() on glibc */
1077+#include <stdlib.h>
1078+#include <stdio.h>
1079 #include <sys/types.h>
1080 #include <sys/time.h>
1081 #include <unistd.h>
1082@@ -21247,8 +21441,12 @@ else
1083
1084 static int fildes[2];
1085
1086+#ifdef __STDC__
1087+static void *task(void *p)
1088+#else
1089 static void *task(p)
1090 void *p;
1091+#endif
1092 {
1093 int i;
1094 struct timeval tv;
1095@@ -21272,9 +21470,13 @@ static void *task(p)
1096 exit(0); /* if we exit here, the select blocked the whole process */
1097 }
1098
1099+#ifdef __STDC__
1100+int main(int argc, char **argv)
1101+#else
1102 int main(argc, argv)
1103 int argc;
1104 char **argv;
1105+#endif
1106 {
1107 pthread_t t;
1108
1109@@ -22566,8 +22768,8 @@ $as_echo "no" >&6; }
1110 fi
1111
1112 pkg_failed=no
1113-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WT" >&5
1114-$as_echo_n "checking for WT... " >&6; }
1115+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wiredtiger" >&5
1116+$as_echo_n "checking for wiredtiger... " >&6; }
1117
1118 if test -n "$WT_CFLAGS"; then
1119 pkg_cv_WT_CFLAGS="$WT_CFLAGS"
1120@@ -22607,7 +22809,7 @@ fi
1121
1122
1123 if test $pkg_failed = yes; then
1124- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1125+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1126 $as_echo "no" >&6; }
1127
1128 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1129@@ -22634,7 +22836,7 @@ Alternatively, you may set the environment variables WT_CFLAGS
1130 and WT_LIBS to avoid the need to call pkg-config.
1131 See the pkg-config man page for more details." "$LINENO" 5
1132 elif test $pkg_failed = untried; then
1133- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1134+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1135 $as_echo "no" >&6; }
1136 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1137 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1138@@ -23734,7 +23936,8 @@ else
1139 /* end confdefs.h. */
1140
1141 #include <ctype.h>
1142-main()
1143+#include <stdlib.h>
1144+int main(void)
1145 {
1146 if ('C' == toupper('C'))
1147 exit(0);
1148@@ -25785,7 +25988,7 @@ $as_echo "#define HAVE_LIBSODIUM 1" >>confdefs.h
1149
1150 BUILD_PW_ARGON2=$ol_enable_argon2
1151 if test "$ol_enable_argon2" = "yes" ; then
1152- SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWDMODS argon2.la"
1153+ SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWMODS argon2.la"
1154 fi
1155
1156 cat >>confdefs.h <<_ACEOF
1157diff --git a/configure.ac b/configure.ac
1158index c8dfa2a..6ddfee5 100644
1159--- a/configure.ac
1160+++ b/configure.ac
1161@@ -25,7 +25,7 @@ dnl ================================================================
1162 dnl Configure.in for OpenLDAP
1163 AC_COPYRIGHT([[Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.
1164 Restrictions apply, see COPYRIGHT and LICENSE files.]])
1165-AC_REVISION([$Id: 3943f6265060065483db582e5c7bef14fe934d80 $])
1166+AC_REVISION([$Id: a4836a8a0218326643db20d8131fc717d1fc3edf $])
1167 AC_INIT([OpenLDAP],,[https://bugs.openldap.org],,[https://www.openldap.org])
1168 AC_CONFIG_SRCDIR(build/version.sh)dnl
1169 dnl ----------------------------------------------------------------
1170@@ -1009,7 +1009,11 @@ dnl ----------------------------------------------------------------
1171 AC_CHECK_HEADERS( sys/epoll.h )
1172 if test "${ac_cv_header_sys_epoll_h}" = yes; then
1173 AC_MSG_CHECKING(for epoll system call)
1174- AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
1175+ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
1176+#ifdef HAVE_SYS_POLL_H
1177+#include <sys/epoll.h>
1178+#endif
1179+int main(int argc, char **argv)
1180 {
1181 int epfd = epoll_create(256);
1182 exit (epfd == -1 ? 1 : 0);
1183@@ -1232,7 +1236,7 @@ if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
1184 [#endif]])],
1185 , [AC_MSG_FAILURE([OpenSSL 1.1.1 or newer required])])
1186
1187- AC_CHECK_LIB(ssl, SSL_export_keying_material_early,
1188+ AC_CHECK_LIB(ssl, SSL_CTX_set_ciphersuites,
1189 [have_openssl=yes], [have_openssl=no],
1190 [-lcrypto])
1191
1192@@ -1362,10 +1366,10 @@ case $ol_with_threads in auto | yes | posix)
1193 dnl pthread_create() in -lpthread (many)
1194 dnl pthread_create() in -lc_r (FreeBSD)
1195 dnl
1196- dnl Check pthread (draft4) flags (depreciated)
1197+ dnl Check pthread (draft4) flags (deprecated)
1198 dnl pthread_create() with -threads (OSF/1)
1199 dnl
1200- dnl Check pthread (draft4) libraries (depreciated)
1201+ dnl Check pthread (draft4) libraries (deprecated)
1202 dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
1203 dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
1204 dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
1205@@ -1386,7 +1390,7 @@ case $ol_with_threads in auto | yes | posix)
1206 ol_link_threads=posix
1207 ol_link_pthreads=""
1208 fi
1209-
1210+
1211 dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
1212 OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
1213 OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
1214@@ -1473,10 +1477,8 @@ pthread_rwlock_t rwlock;
1215 dnl save the flags
1216 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1217 #include <pthread.h>
1218-#ifndef NULL
1219-#define NULL (void*)0
1220-#endif
1221-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
1222+pthread_t thread;
1223+]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
1224 ])
1225
1226 if test $ol_cv_func_pthread_detach = no ; then
1227@@ -1531,6 +1533,9 @@ dnl esac
1228 AC_CACHE_CHECK([if select yields when using pthreads],
1229 ol_cv_pthread_select_yields,[
1230 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1231+#define _XOPEN_SOURCE 500 /* For pthread_setconcurrency() on glibc */
1232+#include <stdlib.h>
1233+#include <stdio.h>
1234 #include <sys/types.h>
1235 #include <sys/time.h>
1236 #include <unistd.h>
1237@@ -1541,8 +1546,12 @@ dnl esac
1238
1239 static int fildes[2];
1240
1241+#ifdef __STDC__
1242+static void *task(void *p)
1243+#else
1244 static void *task(p)
1245 void *p;
1246+#endif
1247 {
1248 int i;
1249 struct timeval tv;
1250@@ -1566,9 +1575,13 @@ static void *task(p)
1251 exit(0); /* if we exit here, the select blocked the whole process */
1252 }
1253
1254+#ifdef __STDC__
1255+int main(int argc, char **argv)
1256+#else
1257 int main(argc, argv)
1258 int argc;
1259 char **argv;
1260+#endif
1261 {
1262 pthread_t t;
1263
1264@@ -3093,7 +3106,7 @@ if test "$ol_enable_argon2" = "yes" ; then
1265
1266 BUILD_PW_ARGON2=$ol_enable_argon2
1267 if test "$ol_enable_argon2" = "yes" ; then
1268- SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWDMODS argon2.la"
1269+ SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWMODS argon2.la"
1270 fi
1271 AC_DEFINE_UNQUOTED(SLAPD_PWMOD_PW_ARGON2,$SLAPD_MOD_DYNAMIC,[define for Argon2 Password hashing module])
1272 fi
1273diff --git a/contrib/ldaptcl/tclAppInit.c b/contrib/ldaptcl/tclAppInit.c
1274index f84e182..d50a724 100644
1275--- a/contrib/ldaptcl/tclAppInit.c
1276+++ b/contrib/ldaptcl/tclAppInit.c
1277@@ -45,9 +45,7 @@ EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
1278 */
1279
1280 int
1281-main(argc, argv)
1282- int argc; /* Number of command-line arguments. */
1283- char **argv; /* Values of command-line arguments. */
1284+main(int argc, char **argv)
1285 {
1286 #ifdef USE_TCLX
1287 TclX_Main(argc, argv, Tcl_AppInit);
1288diff --git a/contrib/ldaptcl/tkAppInit.c b/contrib/ldaptcl/tkAppInit.c
1289index 68fd956..6934523 100644
1290--- a/contrib/ldaptcl/tkAppInit.c
1291+++ b/contrib/ldaptcl/tkAppInit.c
1292@@ -37,16 +37,9 @@ int (*tclDummyMathPtr)() = matherr;
1293 * This is the main program for the application.
1294 *-----------------------------------------------------------------------------
1295 */
1296-#ifdef __cplusplus
1297 int
1298 main (int argc,
1299 char **argv)
1300-#else
1301-int
1302-main (argc, argv)
1303- int argc;
1304- char **argv;
1305-#endif
1306 {
1307 #ifdef USE_TCLX
1308 TkX_Main(argc, argv, Tcl_AppInit);
1309@@ -68,14 +61,8 @@ main (argc, argv)
1310 * interp->result if an error occurs.
1311 *-----------------------------------------------------------------------------
1312 */
1313-#ifdef __cplusplus
1314 int
1315 Tcl_AppInit (Tcl_Interp *interp)
1316-#else
1317-int
1318-Tcl_AppInit (interp)
1319- Tcl_Interp *interp;
1320-#endif
1321 {
1322 if (Tcl_Init (interp) == TCL_ERROR) {
1323 return TCL_ERROR;
1324diff --git a/contrib/slapd-modules/datamorph/tests/run b/contrib/slapd-modules/datamorph/tests/run
1325index 6a38431..239bff7 100755
1326--- a/contrib/slapd-modules/datamorph/tests/run
1327+++ b/contrib/slapd-modules/datamorph/tests/run
1328@@ -12,218 +12,6 @@
1329 ## A copy of this license is available in the file LICENSE in the
1330 ## top-level directory of the distribution or, alternatively, at
1331 ## <http://www.OpenLDAP.org/license.html>.
1332-##
1333-## ACKNOWLEDGEMENTS:
1334-## This module was written in 2016 by Ondřej Kuzník for Symas Corp.
1335-
1336-USAGE="$0 [-b <backend>] [-c] [-k] [-l #] [-p] [-s {ro|rp}] [-u] [-w] <script>"
1337-
1338-TOPSRCDIR="${SRCDIR-$LDAP_SRC}"
1339-SRCDIR="${TOPSRCDIR}/tests"
1340-eval `grep EGREP_CMD= ${LDAP_BUILD}/tests/run`
1341-eval `$EGREP_CMD -e '^LN_S=' ${LDAP_BUILD}/tests/run`
1342-
1343-export SRCDIR TOPSRCDIR LN_S EGREP_CMD
1344-
1345-. "${SRCDIR}/scripts/defines.sh"
1346-
1347-BACKEND=
1348-CLEAN=no
1349-WAIT=0
1350-KILLSERVERS=yes
1351-PRESERVE=${PRESERVE-no}
1352-SYNCMODE=${SYNCMODE-rp}
1353-USERDATA=no
1354-LOOP=1
1355-COUNTER=1
1356-
1357-while test $# -gt 0 ; do
1358- case "$1" in
1359- -b | -backend)
1360- BACKEND="$2"
1361- shift; shift ;;
1362-
1363- -c | -clean)
1364- CLEAN=yes
1365- shift ;;
1366-
1367- -k | -kill)
1368- KILLSERVERS=no
1369- shift ;;
1370- -l | -loop)
1371- NUM="`echo $2 | sed 's/[0-9]//g'`"
1372- if [ -z "$NUM" ]; then
1373- LOOP=$2
1374- else
1375- echo "Loop variable not an int: $2"
1376- echo "$USAGE"; exit 1
1377- fi
1378- shift ;
1379- shift ;;
1380-
1381- -p | -preserve)
1382- PRESERVE=yes
1383- shift ;;
1384-
1385- -s | -syncmode)
1386- case "$2" in
1387- ro | rp)
1388- SYNCMODE="$2"
1389- ;;
1390- *)
1391- echo "unknown sync mode $2"
1392- echo "$USAGE"; exit 1
1393- ;;
1394- esac
1395- shift; shift ;;
1396-
1397- -u | -userdata)
1398- USERDATA=yes
1399- shift ;;
1400-
1401- -w | -wait)
1402- WAIT=1
1403- shift ;;
1404-
1405- -)
1406- shift
1407- break ;;
1408-
1409- -*)
1410- echo "$USAGE"; exit 1
1411- ;;
1412-
1413- *)
1414- break ;;
1415- esac
1416-done
1417-
1418-eval `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run`
1419-export `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run | sed 's/=.*//'`
1420-
1421-if test -z "$BACKEND" ; then
1422- for b in mdb ; do
1423- if eval "test \"\$AC_$b\" != no" ; then
1424- BACKEND=$b
1425- break
1426- fi
1427- done
1428- if test -z "$BACKEND" ; then
1429- echo "No suitable default database backend configured" >&2
1430- exit 1
1431- fi
1432-fi
1433-
1434-BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
1435-if test "x$BACKENDTYPE" = "x" ; then
1436- BACKENDTYPE="unknown"
1437-fi
1438-
1439-# Backend features. indexdb: indexing and unchecked limit.
1440-# maindb: main storage backend. Currently index,limits,mode,paged results.
1441-INDEXDB=noindexdb MAINDB=nomaindb
1442-case $BACKEND in
1443- mdb) INDEXDB=indexdb MAINDB=maindb ;;
1444- ndb) INDEXDB=indexdb ;;
1445-esac
1446-
1447-export BACKEND BACKENDTYPE INDEXDB MAINDB \
1448- WAIT KILLSERVERS PRESERVE SYNCMODE USERDATA \
1449- SRCDIR
1450-
1451-if test $# = 0 ; then
1452- echo "$USAGE"; exit 1
1453-fi
1454-
1455-# need defines.sh for the definitions of the directories
1456-. $SRCDIR/scripts/defines.sh
1457-
1458-SCRIPTDIR="${TOPDIR}/tests/scripts"
1459-
1460-export SCRIPTDIR
1461-
1462-SCRIPTNAME="$1"
1463-shift
1464-
1465-if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
1466- SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
1467-elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
1468- SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
1469-elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
1470- SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
1471-else
1472- echo "run: ${SCRIPTNAME} not found (or not executable)"
1473- exit 1;
1474-fi
1475-
1476-if test ! -r ${DATADIR}/test.ldif ; then
1477- ${LN_S} ${SRCDIR}/data ${DATADIR}
1478-fi
1479-if test ! -r ${SCHEMADIR}/core.schema ; then
1480- ${LN_S} ${TOPSRCDIR}/servers/slapd/schema ${SCHEMADIR}
1481-fi
1482-if test ! -r ./data; then
1483- ${LN_S} ${TOPDIR}/tests/data ./
1484-fi
1485-
1486-if test -d ${TESTDIR} ; then
1487- if test $PRESERVE = no ; then
1488- echo "Cleaning up test run directory leftover from previous run."
1489- /bin/rm -rf ${TESTDIR}
1490- elif test $PRESERVE = yes ; then
1491- echo "Cleaning up only database directories leftover from previous run."
1492- /bin/rm -rf ${TESTDIR}/db.*
1493- fi
1494-fi
1495-if test $BACKEND = ndb ; then
1496- mysql --user root <<EOF
1497- drop database if exists db_1;
1498- drop database if exists db_2;
1499- drop database if exists db_3;
1500- drop database if exists db_4;
1501- drop database if exists db_5;
1502- drop database if exists db_6;
1503-EOF
1504-fi
1505-mkdir -p ${TESTDIR}
1506-
1507-if test $USERDATA = yes ; then
1508- if test ! -d userdata ; then
1509- echo "User data directory (userdata) does not exist."
1510- exit 1
1511- fi
1512- cp -R userdata/* ${TESTDIR}
1513-fi
1514-
1515-# disable LDAP initialization
1516-LDAPNOINIT=true; export LDAPNOINIT
1517-
1518-echo "Running ${SCRIPT} for ${BACKEND}..."
1519-while [ $COUNTER -le $LOOP ]; do
1520- if [ $LOOP -gt 1 ]; then
1521- echo "Running $COUNTER of $LOOP iterations"
1522- fi
1523- $SCRIPT $*
1524- RC=$?
1525
1526- if test $CLEAN = yes ; then
1527- echo "Cleaning up test run directory from this run."
1528- /bin/rm -rf ${TESTDIR}
1529- echo "Cleaning up symlinks."
1530- /bin/rm -f ${DATADIR} ${SCHEMADIR}
1531- fi
1532+TOPSRCDIR="$SRCDIR" OBJDIR="${LDAP_BUILD}" SRCDIR="${SRCDIR}/tests" DEFSDIR="${SRCDIR}/scripts" SCRIPTDIR="${TOPDIR}/tests/scripts" "${LDAP_BUILD}/tests/run" $*
1533
1534- if [ $RC -ne 0 ]; then
1535- if [ $LOOP -gt 1 ]; then
1536- echo "Failed after $COUNTER of $LOOP iterations"
1537- fi
1538- exit $RC
1539- else
1540- COUNTER=`expr $COUNTER + 1`
1541- if [ $COUNTER -le $LOOP ]; then
1542- echo "Cleaning up test run directory from this run."
1543- /bin/rm -rf ${TESTDIR}
1544- fi
1545- fi
1546-done
1547-exit $RC
1548diff --git a/contrib/slapd-modules/emptyds/tests/run b/contrib/slapd-modules/emptyds/tests/run
1549index e28820c..239bff7 100755
1550--- a/contrib/slapd-modules/emptyds/tests/run
1551+++ b/contrib/slapd-modules/emptyds/tests/run
1552@@ -12,207 +12,6 @@
1553 ## A copy of this license is available in the file LICENSE in the
1554 ## top-level directory of the distribution or, alternatively, at
1555 ## <http://www.OpenLDAP.org/license.html>.
1556-##
1557-## ACKNOWLEDGEMENTS:
1558-## This module was written in 2016 by Ondřej Kuzník for Symas Corp.
1559-
1560-USAGE="$0 [-b <backend>] [-c] [-k] [-l #] [-p] [-s {ro|rp}] [-u] [-w] <script>"
1561-
1562-TOPSRCDIR="${SRCDIR-$LDAP_SRC}"
1563-SRCDIR="${TOPSRCDIR}/tests"
1564-eval `grep EGREP_CMD= ${LDAP_BUILD}/tests/run`
1565-eval `$EGREP_CMD -e '^LN_S=' ${LDAP_BUILD}/tests/run`
1566-
1567-export SRCDIR TOPSRCDIR LN_S EGREP_CMD
1568-
1569-. "${SRCDIR}/scripts/defines.sh"
1570-
1571-BACKEND=
1572-CLEAN=no
1573-WAIT=0
1574-KILLSERVERS=yes
1575-PRESERVE=${PRESERVE-no}
1576-SYNCMODE=${SYNCMODE-rp}
1577-USERDATA=no
1578-LOOP=1
1579-COUNTER=1
1580-
1581-while test $# -gt 0 ; do
1582- case "$1" in
1583- -b | -backend)
1584- BACKEND="$2"
1585- shift; shift ;;
1586-
1587- -c | -clean)
1588- CLEAN=yes
1589- shift ;;
1590-
1591- -k | -kill)
1592- KILLSERVERS=no
1593- shift ;;
1594- -l | -loop)
1595- NUM="`echo $2 | sed 's/[0-9]//g'`"
1596- if [ -z "$NUM" ]; then
1597- LOOP=$2
1598- else
1599- echo "Loop variable not an int: $2"
1600- echo "$USAGE"; exit 1
1601- fi
1602- shift ;
1603- shift ;;
1604-
1605- -p | -preserve)
1606- PRESERVE=yes
1607- shift ;;
1608-
1609- -s | -syncmode)
1610- case "$2" in
1611- ro | rp)
1612- SYNCMODE="$2"
1613- ;;
1614- *)
1615- echo "unknown sync mode $2"
1616- echo "$USAGE"; exit 1
1617- ;;
1618- esac
1619- shift; shift ;;
1620-
1621- -u | -userdata)
1622- USERDATA=yes
1623- shift ;;
1624-
1625- -w | -wait)
1626- WAIT=1
1627- shift ;;
1628-
1629- -)
1630- shift
1631- break ;;
1632-
1633- -*)
1634- echo "$USAGE"; exit 1
1635- ;;
1636-
1637- *)
1638- break ;;
1639- esac
1640-done
1641-
1642-eval `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run`
1643-export `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run | sed 's/=.*//'`
1644-
1645-if test -z "$BACKEND" ; then
1646- for b in mdb ; do
1647- if eval "test \"\$AC_$b\" != no" ; then
1648- BACKEND=$b
1649- break
1650- fi
1651- done
1652- if test -z "$BACKEND" ; then
1653- echo "No suitable default database backend configured" >&2
1654- exit 1
1655- fi
1656-fi
1657-
1658-BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
1659-if test "x$BACKENDTYPE" = "x" ; then
1660- BACKENDTYPE="unknown"
1661-fi
1662-
1663-# Backend features. indexdb: indexing and unchecked limit.
1664-# maindb: main storage backend. Currently index,limits,mode,paged results.
1665-INDEXDB=noindexdb MAINDB=nomaindb
1666-case $BACKEND in
1667- mdb) INDEXDB=indexdb MAINDB=maindb ;;
1668-esac
1669-
1670-export BACKEND BACKENDTYPE INDEXDB MAINDB \
1671- WAIT KILLSERVERS PRESERVE SYNCMODE USERDATA \
1672- SRCDIR
1673-
1674-if test $# = 0 ; then
1675- echo "$USAGE"; exit 1
1676-fi
1677-
1678-# need defines.sh for the definitions of the directories
1679-. $SRCDIR/scripts/defines.sh
1680-
1681-SCRIPTDIR="${TOPDIR}/tests/scripts"
1682-
1683-export SCRIPTDIR
1684-
1685-SCRIPTNAME="$1"
1686-shift
1687-
1688-if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
1689- SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
1690-elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
1691- SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
1692-elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
1693- SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
1694-else
1695- echo "run: ${SCRIPTNAME} not found (or not executable)"
1696- exit 1;
1697-fi
1698-
1699-if test ! -r ${DATADIR}/test.ldif ; then
1700- ${LN_S} ${SRCDIR}/data ${DATADIR}
1701-fi
1702-if test ! -r ${SCHEMADIR}/core.schema ; then
1703- ${LN_S} ${TOPSRCDIR}/servers/slapd/schema ${SCHEMADIR}
1704-fi
1705-if test ! -r ./data; then
1706- ${LN_S} ${TOPDIR}/tests/data ./
1707-fi
1708-
1709-if test -d ${TESTDIR} ; then
1710- if test $PRESERVE = no ; then
1711- echo "Cleaning up test run directory leftover from previous run."
1712- /bin/rm -rf ${TESTDIR}
1713- elif test $PRESERVE = yes ; then
1714- echo "Cleaning up only database directories leftover from previous run."
1715- /bin/rm -rf ${TESTDIR}/db.*
1716- fi
1717-fi
1718-mkdir -p ${TESTDIR}
1719-
1720-if test $USERDATA = yes ; then
1721- if test ! -d userdata ; then
1722- echo "User data directory (userdata) does not exist."
1723- exit 1
1724- fi
1725- cp -R userdata/* ${TESTDIR}
1726-fi
1727-
1728-# disable LDAP initialization
1729-LDAPNOINIT=true; export LDAPNOINIT
1730-
1731-echo "Running ${SCRIPT} for ${BACKEND}..."
1732-while [ $COUNTER -le $LOOP ]; do
1733- if [ $LOOP -gt 1 ]; then
1734- echo "Running $COUNTER of $LOOP iterations"
1735- fi
1736- $SCRIPT $*
1737- RC=$?
1738
1739- if test $CLEAN = yes ; then
1740- echo "Cleaning up test run directory from this run."
1741- /bin/rm -rf ${TESTDIR}
1742- echo "Cleaning up symlinks."
1743- /bin/rm -f ${DATADIR} ${SCHEMADIR}
1744- fi
1745+TOPSRCDIR="$SRCDIR" OBJDIR="${LDAP_BUILD}" SRCDIR="${SRCDIR}/tests" DEFSDIR="${SRCDIR}/scripts" SCRIPTDIR="${TOPDIR}/tests/scripts" "${LDAP_BUILD}/tests/run" $*
1746
1747- if [ $RC -ne 0 ]; then
1748- if [ $LOOP -gt 1 ]; then
1749- echo "Failed after $COUNTER of $LOOP iterations"
1750- fi
1751- exit $RC
1752- else
1753- COUNTER=`expr $COUNTER + 1`
1754- if [ $COUNTER -le $LOOP ]; then
1755- echo "Cleaning up test run directory from this run."
1756- /bin/rm -rf ${TESTDIR}
1757- fi
1758- fi
1759-done
1760-exit $RC
1761diff --git a/contrib/slapd-modules/variant/slapo-variant.5 b/contrib/slapd-modules/variant/slapo-variant.5
1762index a480744..f46eb69 100644
1763--- a/contrib/slapd-modules/variant/slapo-variant.5
1764+++ b/contrib/slapd-modules/variant/slapo-variant.5
1765@@ -341,14 +341,14 @@ olcVariantEntry: dc=example,dc=com
1766
1767 # share the Headquarters' address as the company address
1768 dn: olcVariantVariantAttribute=postaladdress,name={0}example,olcOverlay={x}variant,$DATABASE
1769-objectClass: olcVariantVariantAttribute
1770+objectClass: olcVariantAttribute
1771 olcVariantVariantAttribute: postaladdress
1772 olcVariantAlternativeAttribute: postaladdress
1773 olcVariantAlternativeEntry: ou=Headquarters,dc=example,dc=com
1774
1775 # populate telephonenumber from CEO's home phone
1776 dn: name=Take phone from CEO entry,name={0}example,olcOverlay={x}variant,$DATABASE
1777-objectClass: olcVariantVariantAttribute
1778+objectClass: olcVariantAttribute
1779 olcVariantVariantAttribute: telephonenumber
1780 olcVariantAlternativeAttribute: homephone
1781 olcVariantAlternativeEntry: cn=John Doe,ou=People,dc=example,dc=com
1782diff --git a/contrib/slapd-modules/variant/tests/data/test001-04a-same-regex.ldif b/contrib/slapd-modules/variant/tests/data/test001-04a-same-regex.ldif
1783new file mode 100644
1784index 0000000..071df0f
1785--- /dev/null
1786+++ b/contrib/slapd-modules/variant/tests/data/test001-04a-same-regex.ldif
1787@@ -0,0 +1,4 @@
1788+dn: name={3}regex,olcOverlay={0}variant,olcDatabase={1}mdb,cn=config
1789+changetype: modify
1790+replace: olcVariantEntryRegex
1791+olcVariantEntryRegex: (.*),(ou=.*technology.*)(,)dc=example,dc=com
1792diff --git a/contrib/slapd-modules/variant/tests/data/test001-04b-same-regex.ldif b/contrib/slapd-modules/variant/tests/data/test001-04b-same-regex.ldif
1793new file mode 100644
1794index 0000000..5fa1d3b
1795--- /dev/null
1796+++ b/contrib/slapd-modules/variant/tests/data/test001-04b-same-regex.ldif
1797@@ -0,0 +1,4 @@
1798+dn: name=regex,olcOverlay={0}variant,olcDatabase={1}@BACKEND@,cn=config
1799+changetype: add
1800+objectclass: olcVariantRegex
1801+olcVariantEntryRegex: .*
1802diff --git a/contrib/slapd-modules/variant/tests/run b/contrib/slapd-modules/variant/tests/run
1803index 6a38431..239bff7 100755
1804--- a/contrib/slapd-modules/variant/tests/run
1805+++ b/contrib/slapd-modules/variant/tests/run
1806@@ -12,218 +12,6 @@
1807 ## A copy of this license is available in the file LICENSE in the
1808 ## top-level directory of the distribution or, alternatively, at
1809 ## <http://www.OpenLDAP.org/license.html>.
1810-##
1811-## ACKNOWLEDGEMENTS:
1812-## This module was written in 2016 by Ondřej Kuzník for Symas Corp.
1813-
1814-USAGE="$0 [-b <backend>] [-c] [-k] [-l #] [-p] [-s {ro|rp}] [-u] [-w] <script>"
1815-
1816-TOPSRCDIR="${SRCDIR-$LDAP_SRC}"
1817-SRCDIR="${TOPSRCDIR}/tests"
1818-eval `grep EGREP_CMD= ${LDAP_BUILD}/tests/run`
1819-eval `$EGREP_CMD -e '^LN_S=' ${LDAP_BUILD}/tests/run`
1820-
1821-export SRCDIR TOPSRCDIR LN_S EGREP_CMD
1822-
1823-. "${SRCDIR}/scripts/defines.sh"
1824-
1825-BACKEND=
1826-CLEAN=no
1827-WAIT=0
1828-KILLSERVERS=yes
1829-PRESERVE=${PRESERVE-no}
1830-SYNCMODE=${SYNCMODE-rp}
1831-USERDATA=no
1832-LOOP=1
1833-COUNTER=1
1834-
1835-while test $# -gt 0 ; do
1836- case "$1" in
1837- -b | -backend)
1838- BACKEND="$2"
1839- shift; shift ;;
1840-
1841- -c | -clean)
1842- CLEAN=yes
1843- shift ;;
1844-
1845- -k | -kill)
1846- KILLSERVERS=no
1847- shift ;;
1848- -l | -loop)
1849- NUM="`echo $2 | sed 's/[0-9]//g'`"
1850- if [ -z "$NUM" ]; then
1851- LOOP=$2
1852- else
1853- echo "Loop variable not an int: $2"
1854- echo "$USAGE"; exit 1
1855- fi
1856- shift ;
1857- shift ;;
1858-
1859- -p | -preserve)
1860- PRESERVE=yes
1861- shift ;;
1862-
1863- -s | -syncmode)
1864- case "$2" in
1865- ro | rp)
1866- SYNCMODE="$2"
1867- ;;
1868- *)
1869- echo "unknown sync mode $2"
1870- echo "$USAGE"; exit 1
1871- ;;
1872- esac
1873- shift; shift ;;
1874-
1875- -u | -userdata)
1876- USERDATA=yes
1877- shift ;;
1878-
1879- -w | -wait)
1880- WAIT=1
1881- shift ;;
1882-
1883- -)
1884- shift
1885- break ;;
1886-
1887- -*)
1888- echo "$USAGE"; exit 1
1889- ;;
1890-
1891- *)
1892- break ;;
1893- esac
1894-done
1895-
1896-eval `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run`
1897-export `$EGREP_CMD -e '^AC' ${LDAP_BUILD}/tests/run | sed 's/=.*//'`
1898-
1899-if test -z "$BACKEND" ; then
1900- for b in mdb ; do
1901- if eval "test \"\$AC_$b\" != no" ; then
1902- BACKEND=$b
1903- break
1904- fi
1905- done
1906- if test -z "$BACKEND" ; then
1907- echo "No suitable default database backend configured" >&2
1908- exit 1
1909- fi
1910-fi
1911-
1912-BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
1913-if test "x$BACKENDTYPE" = "x" ; then
1914- BACKENDTYPE="unknown"
1915-fi
1916-
1917-# Backend features. indexdb: indexing and unchecked limit.
1918-# maindb: main storage backend. Currently index,limits,mode,paged results.
1919-INDEXDB=noindexdb MAINDB=nomaindb
1920-case $BACKEND in
1921- mdb) INDEXDB=indexdb MAINDB=maindb ;;
1922- ndb) INDEXDB=indexdb ;;
1923-esac
1924-
1925-export BACKEND BACKENDTYPE INDEXDB MAINDB \
1926- WAIT KILLSERVERS PRESERVE SYNCMODE USERDATA \
1927- SRCDIR
1928-
1929-if test $# = 0 ; then
1930- echo "$USAGE"; exit 1
1931-fi
1932-
1933-# need defines.sh for the definitions of the directories
1934-. $SRCDIR/scripts/defines.sh
1935-
1936-SCRIPTDIR="${TOPDIR}/tests/scripts"
1937-
1938-export SCRIPTDIR
1939-
1940-SCRIPTNAME="$1"
1941-shift
1942-
1943-if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
1944- SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
1945-elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
1946- SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
1947-elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
1948- SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
1949-else
1950- echo "run: ${SCRIPTNAME} not found (or not executable)"
1951- exit 1;
1952-fi
1953-
1954-if test ! -r ${DATADIR}/test.ldif ; then
1955- ${LN_S} ${SRCDIR}/data ${DATADIR}
1956-fi
1957-if test ! -r ${SCHEMADIR}/core.schema ; then
1958- ${LN_S} ${TOPSRCDIR}/servers/slapd/schema ${SCHEMADIR}
1959-fi
1960-if test ! -r ./data; then
1961- ${LN_S} ${TOPDIR}/tests/data ./
1962-fi
1963-
1964-if test -d ${TESTDIR} ; then
1965- if test $PRESERVE = no ; then
1966- echo "Cleaning up test run directory leftover from previous run."
1967- /bin/rm -rf ${TESTDIR}
1968- elif test $PRESERVE = yes ; then
1969- echo "Cleaning up only database directories leftover from previous run."
1970- /bin/rm -rf ${TESTDIR}/db.*
1971- fi
1972-fi
1973-if test $BACKEND = ndb ; then
1974- mysql --user root <<EOF
1975- drop database if exists db_1;
1976- drop database if exists db_2;
1977- drop database if exists db_3;
1978- drop database if exists db_4;
1979- drop database if exists db_5;
1980- drop database if exists db_6;
1981-EOF
1982-fi
1983-mkdir -p ${TESTDIR}
1984-
1985-if test $USERDATA = yes ; then
1986- if test ! -d userdata ; then
1987- echo "User data directory (userdata) does not exist."
1988- exit 1
1989- fi
1990- cp -R userdata/* ${TESTDIR}
1991-fi
1992-
1993-# disable LDAP initialization
1994-LDAPNOINIT=true; export LDAPNOINIT
1995-
1996-echo "Running ${SCRIPT} for ${BACKEND}..."
1997-while [ $COUNTER -le $LOOP ]; do
1998- if [ $LOOP -gt 1 ]; then
1999- echo "Running $COUNTER of $LOOP iterations"
2000- fi
2001- $SCRIPT $*
2002- RC=$?
2003
2004- if test $CLEAN = yes ; then
2005- echo "Cleaning up test run directory from this run."
2006- /bin/rm -rf ${TESTDIR}
2007- echo "Cleaning up symlinks."
2008- /bin/rm -f ${DATADIR} ${SCHEMADIR}
2009- fi
2010+TOPSRCDIR="$SRCDIR" OBJDIR="${LDAP_BUILD}" SRCDIR="${SRCDIR}/tests" DEFSDIR="${SRCDIR}/scripts" SCRIPTDIR="${TOPDIR}/tests/scripts" "${LDAP_BUILD}/tests/run" $*
2011
2012- if [ $RC -ne 0 ]; then
2013- if [ $LOOP -gt 1 ]; then
2014- echo "Failed after $COUNTER of $LOOP iterations"
2015- fi
2016- exit $RC
2017- else
2018- COUNTER=`expr $COUNTER + 1`
2019- if [ $COUNTER -le $LOOP ]; then
2020- echo "Cleaning up test run directory from this run."
2021- /bin/rm -rf ${TESTDIR}
2022- fi
2023- fi
2024-done
2025-exit $RC
2026diff --git a/contrib/slapd-modules/variant/variant.c b/contrib/slapd-modules/variant/variant.c
2027index edf4832..cc1c693 100644
2028--- a/contrib/slapd-modules/variant/variant.c
2029+++ b/contrib/slapd-modules/variant/variant.c
2030@@ -282,9 +282,7 @@ variant_op_add( Operation *op, SlapReply *rs )
2031 variantEntry_info *vei;
2032 int rc;
2033
2034- /* Replication always uses the rootdn */
2035- if ( ov->passReplication && SLAPD_SYNC_IS_SYNCCONN(op->o_connid) &&
2036- be_isroot( op ) ) {
2037+ if ( ov->passReplication && be_shadow_update( op ) ) {
2038 return SLAP_CB_CONTINUE;
2039 }
2040
2041@@ -431,9 +429,7 @@ variant_op_mod( Operation *op, SlapReply *rs )
2042 regmatch_t pmatch[10];
2043 int rc, nmatch = sizeof(pmatch) / sizeof(regmatch_t);
2044
2045- /* Replication always uses the rootdn */
2046- if ( ov->passReplication && SLAPD_SYNC_IS_SYNCCONN(op->o_connid) &&
2047- be_isroot( op ) ) {
2048+ if ( ov->passReplication && be_shadow_update( op ) ) {
2049 return SLAP_CB_CONTINUE;
2050 }
2051
2052@@ -868,6 +864,9 @@ variant_set_dn( ConfigArgs *ca )
2053
2054 dnMatch( &diff, 0, NULL, NULL, &vei->dn, &vei2->dn );
2055 if ( !diff ) {
2056+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2057+ "duplicate variant dn: %s", ca->value_ndn.bv_val );
2058+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2059 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2060 return ca->reply.err;
2061 }
2062@@ -889,7 +888,11 @@ variant_set_regex( ConfigArgs *ca )
2063 } else if ( ca->op == LDAP_MOD_DELETE ) {
2064 ber_memfree( vei->dn.bv_val );
2065 BER_BVZERO( &vei->dn );
2066- regfree( vei->regex );
2067+ if ( vei->regex ) {
2068+ regfree( vei->regex );
2069+ ch_free( vei->regex );
2070+ vei->regex = NULL;
2071+ }
2072 return LDAP_SUCCESS;
2073 }
2074
2075@@ -910,8 +913,9 @@ variant_set_regex( ConfigArgs *ca )
2076 if ( vei == vei2 ) continue;
2077
2078 if ( !ber_bvcmp( &ca->value_bv, &vei2->dn ) ) {
2079- ch_free( vei );
2080- ca->ca_private = NULL;
2081+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2082+ "duplicate variant regex: %s", ca->value_dn.bv_val );
2083+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2084 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2085 return ca->reply.err;
2086 }
2087@@ -920,6 +924,10 @@ variant_set_regex( ConfigArgs *ca )
2088 vei->regex = ch_calloc( 1, sizeof(regex_t) );
2089 if ( regcomp( vei->regex, vei->dn.bv_val, REG_EXTENDED ) ) {
2090 ch_free( vei->regex );
2091+ vei->regex = NULL;
2092+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2093+ "cannot process regex: %s", vei->dn.bv_val );
2094+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2095 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2096 return ca->reply.err;
2097 }
2098@@ -969,9 +977,10 @@ variant_set_alt_pattern( ConfigArgs *ca )
2099 if ( ( ( *p >= '0' ) && ( *p <= '9' ) ) || ( *p == '$' ) ) {
2100 p += 1;
2101 } else {
2102- Debug( LDAP_DEBUG_ANY, "variant_set_alt_pattern: "
2103- "invalid replacement pattern supplied '%s'\n",
2104+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2105+ "invalid replacement pattern supplied '%s'",
2106 ca->value_bv.bv_val );
2107+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2108 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2109 return ca->reply.err;
2110 }
2111@@ -1017,6 +1026,9 @@ variant_set_attribute( ConfigArgs *ca )
2112 rc = slap_str2ad( s, ad, &text );
2113 ber_memfree( ca->value_string );
2114 if ( rc ) {
2115+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2116+ "attribute %s invalid: %s", s, text );
2117+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2118 return rc;
2119 }
2120
2121@@ -1024,6 +1036,10 @@ variant_set_attribute( ConfigArgs *ca )
2122 if ( vai->attr && vai->alternative &&
2123 vai->attr->ad_type->sat_syntax !=
2124 vai->alternative->ad_type->sat_syntax ) {
2125+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2126+ "attribute '%s' syntax doesn't match alternative attribute '%s'",
2127+ vai->attr->ad_cname.bv_val, vai->alternative->ad_cname.bv_val );
2128+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2129 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2130 return ca->reply.err;
2131 }
2132@@ -1033,6 +1049,9 @@ variant_set_attribute( ConfigArgs *ca )
2133 LDAP_SLIST_FOREACH( vai2, &vai->variant->attributes, next ) {
2134 if ( vai == vai2 ) continue;
2135 if ( vai->attr == vai2->attr ) {
2136+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
2137+ "duplicate attribute '%s'", vai->attr->ad_cname.bv_val );
2138+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", ca->log, ca->cr_msg );
2139 ca->reply.err = LDAP_CONSTRAINT_VIOLATION;
2140 return ca->reply.err;
2141 }
2142diff --git a/debian/changelog b/debian/changelog
2143index 786cdf7..61b5af5 100644
2144--- a/debian/changelog
2145+++ b/debian/changelog
2146@@ -1,3 +1,11 @@
2147+openldap (2.5.15+dfsg-0ubuntu0.22.04.1) jammy; urgency=medium
2148+
2149+ * New upstream version (LP: #2027079).
2150+ - Several fixes, including to asynchronous connections to the OpenLDAP
2151+ server.
2152+
2153+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Tue, 11 Jul 2023 15:26:41 -0400
2154+
2155 openldap (2.5.14+dfsg-0ubuntu0.22.04.2) jammy; urgency=medium
2156
2157 * Build the passwd/sha2 contrib module with -fno-strict-aliasing to
2158diff --git a/doc/guide/admin/aspell.en.pws b/doc/guide/admin/aspell.en.pws
2159index 63d3f0e..67bd346 100644
2160--- a/doc/guide/admin/aspell.en.pws
2161+++ b/doc/guide/admin/aspell.en.pws
2162@@ -680,7 +680,6 @@ affectsMultipleDSAs
2163 Preprocessor
2164 lastName
2165 lldap
2166-cachesize
2167 slapauth
2168 attributeType
2169 attributetype
2170diff --git a/doc/guide/admin/guide.html b/doc/guide/admin/guide.html
2171index b1467fc..5fb51d0 100644
2172--- a/doc/guide/admin/guide.html
2173+++ b/doc/guide/admin/guide.html
2174@@ -23,7 +23,7 @@
2175 <DIV CLASS="title">
2176 <H1 CLASS="doc-title">OpenLDAP Software 2.5 Administrator's Guide</H1>
2177 <ADDRESS CLASS="doc-author">The OpenLDAP Project &lt;<A HREF="https://www.openldap.org/">https://www.openldap.org/</A>&gt;</ADDRESS>
2178-<ADDRESS CLASS="doc-modified">8 February 2023</ADDRESS>
2179+<ADDRESS CLASS="doc-modified">10 July 2023</ADDRESS>
2180 <BR CLEAR="All">
2181 </DIV>
2182 <DIV CLASS="contents">
2183@@ -5732,8 +5732,8 @@ Members of a group
2184 pcacheTemplate (&amp;(sn=)(givenName=)) 0 3600
2185 pcacheTemplate (&amp;(departmentNumber=)(secretary=*)) 0 3600
2186
2187- cachesize 20
2188 directory ./testrun/db.2.a
2189+ maxsize 1073741824
2190 index objectClass eq
2191 index cn,sn,uid,mail pres,eq,sub
2192 </PRE>
2193@@ -5763,7 +5763,7 @@ Members of a group
2194 objectClass: olcPcacheDatabase
2195 olcDatabase: {0}mdb
2196 olcDbDirectory: ./testrun/db.2.a
2197- olcDbCacheSize: 20
2198+ olcDbMaxSize: 1073741824
2199 olcDbIndex: objectClass eq
2200 olcDbIndex: cn,sn,uid,mail pres,eq,sub
2201 </PRE>
2202diff --git a/doc/guide/admin/overlays.sdf b/doc/guide/admin/overlays.sdf
2203index 20e4b93..47cb7b8 100644
2204--- a/doc/guide/admin/overlays.sdf
2205+++ b/doc/guide/admin/overlays.sdf
2206@@ -783,8 +783,8 @@ at server {{EX:ldap.example.com}}.
2207 > pcacheTemplate (&(sn=)(givenName=)) 0 3600
2208 > pcacheTemplate (&(departmentNumber=)(secretary=*)) 0 3600
2209 >
2210-> cachesize 20
2211 > directory ./testrun/db.2.a
2212+> maxsize 1073741824
2213 > index objectClass eq
2214 > index cn,sn,uid,mail pres,eq,sub
2215
2216@@ -817,7 +817,7 @@ at server {{EX:ldap.example.com}}.
2217 > objectClass: olcPcacheDatabase
2218 > olcDatabase: {0}mdb
2219 > olcDbDirectory: ./testrun/db.2.a
2220-> olcDbCacheSize: 20
2221+> olcDbMaxSize: 1073741824
2222 > olcDbIndex: objectClass eq
2223 > olcDbIndex: cn,sn,uid,mail pres,eq,sub
2224
2225diff --git a/doc/man/man5/lloadd.conf.5 b/doc/man/man5/lloadd.conf.5
2226index 53f50ba..49c72b9 100644
2227--- a/doc/man/man5/lloadd.conf.5
2228+++ b/doc/man/man5/lloadd.conf.5
2229@@ -824,7 +824,7 @@ The original ETCDIR/lloadd.conf is another example.
2230 .SH LIMITATIONS
2231 Support for proxying SASL Binds is limited to the
2232 .B EXTERNAL
2233-mechanism (and only to extract the DN of a client TLS cerificate if used during
2234+mechanism (and only to extract the DN of a client TLS certificate if used during
2235 the last renegotiation) and mechanisms that rely neither on connection metadata
2236 (as Kerberos does) nor establish a SASL integrity/confidentialiy layer (again,
2237 some Kerberos mechanisms,
2238diff --git a/doc/man/man5/slapd-ldap.5 b/doc/man/man5/slapd-ldap.5
2239index ffcbe81..a3c46e9 100644
2240--- a/doc/man/man5/slapd-ldap.5
2241+++ b/doc/man/man5/slapd-ldap.5
2242@@ -402,6 +402,7 @@ which defaults to "allow".
2243 The identity associated to this directive is also used for privileged
2244 operations whenever \fBidassert\-bind\fP is defined and \fBacl\-bind\fP
2245 is not. See \fBacl\-bind\fP for details.
2246+.RE
2247
2248 .TP
2249 .B idassert-passthru <authz-regexp>
2250diff --git a/doc/man/man5/slapo-pcache.5 b/doc/man/man5/slapo-pcache.5
2251index 1425897..3cfd7f2 100644
2252--- a/doc/man/man5/slapo-pcache.5
2253+++ b/doc/man/man5/slapo-pcache.5
2254@@ -208,7 +208,7 @@ shown here:
2255 .RS
2256 .nf
2257 directory /var/tmp/cache
2258-cachesize 100
2259+maxsize 1073741824
2260 .fi
2261 .RE
2262 .LP
2263diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c
2264index a2409d7..3a81790 100644
2265--- a/libraries/libldap/init.c
2266+++ b/libraries/libldap/init.c
2267@@ -96,9 +96,9 @@ static const struct ol_attribute {
2268 {0, ATTR_OPTION, "URI", NULL, LDAP_OPT_URI}, /* replaces HOST/PORT */
2269 {0, ATTR_OPTION, "SOCKET_BIND_ADDRESSES", NULL, LDAP_OPT_SOCKET_BIND_ADDRESSES},
2270 {0, ATTR_BOOL, "REFERRALS", NULL, LDAP_BOOL_REFERRALS},
2271- {0, ATTR_INT, "KEEPALIVE_IDLE", NULL, LDAP_OPT_X_KEEPALIVE_IDLE},
2272- {0, ATTR_INT, "KEEPALIVE_PROBES", NULL, LDAP_OPT_X_KEEPALIVE_PROBES},
2273- {0, ATTR_INT, "KEEPALIVE_INTERVAL", NULL, LDAP_OPT_X_KEEPALIVE_INTERVAL},
2274+ {0, ATTR_OPT_INT, "KEEPALIVE_IDLE", NULL, LDAP_OPT_X_KEEPALIVE_IDLE},
2275+ {0, ATTR_OPT_INT, "KEEPALIVE_PROBES", NULL, LDAP_OPT_X_KEEPALIVE_PROBES},
2276+ {0, ATTR_OPT_INT, "KEEPALIVE_INTERVAL", NULL, LDAP_OPT_X_KEEPALIVE_INTERVAL},
2277
2278 #if 0
2279 /* This should only be allowed via ldap_set_option(3) */
2280diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c
2281index afef818..bfdbb25 100644
2282--- a/libraries/libldap/open.c
2283+++ b/libraries/libldap/open.c
2284@@ -501,6 +501,11 @@ ldap_int_open_connection(
2285 if( proto == LDAP_PROTO_UDP ) return 0;
2286 #endif
2287
2288+ if ( async && rc == -2) {
2289+ /* Need to let the connect complete asynchronously before we continue */
2290+ return -2;
2291+ }
2292+
2293 #ifdef HAVE_TLS
2294 if ((rc == 0 || rc == -2) && ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ||
2295 strcmp( srv->lud_scheme, "ldaps" ) == 0 ))
2296@@ -585,9 +590,9 @@ ldap_open_internal_connection( LDAP **ldp, ber_socket_t *fdp )
2297 /* Attach the passed socket as the *LDAP's connection */
2298 c = ldap_new_connection( ld, NULL, 1, 0, NULL, 0, 0 );
2299 if( c == NULL ) {
2300+ LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
2301 ldap_unbind_ext( ld, NULL, NULL );
2302 *ldp = NULL;
2303- LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
2304 return( LDAP_NO_MEMORY );
2305 }
2306 ber_sockbuf_ctrl( c->lconn_sb, LBER_SB_OPT_SET_FD, fdp );
2307diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c
2308index 834d986..d6405bc 100644
2309--- a/libraries/libldap/tls_o.c
2310+++ b/libraries/libldap/tls_o.c
2311@@ -52,6 +52,10 @@
2312 #define ASN1_STRING_data(x) ASN1_STRING_get0_data(x)
2313 #endif
2314
2315+#if OPENSSL_VERSION_MAJOR >= 3
2316+#define ERR_get_error_line( a, b ) ERR_get_error_all( a, b, NULL, NULL, NULL )
2317+#define SSL_get_peer_certificate( s ) SSL_get1_peer_certificate( s )
2318+#endif
2319 typedef SSL_CTX tlso_ctx;
2320 typedef SSL tlso_session;
2321
2322@@ -329,7 +333,7 @@ tlso_ctx_cipher13( tlso_ctx *ctx, char *suites )
2323 if ( !strncmp( ver, "TLSv", 4 ) && strncmp( ver+4, "1.3", 3 ) >= 0 ) {
2324 if ( tls13_suites[0] )
2325 ts = tlso_stecpy( ts, ":", te );
2326- ts = tlso_stecpy( ts, sname, te );
2327+ ts = tlso_stecpy( ts, nptr, te );
2328 }
2329 }
2330 }
2331@@ -523,7 +527,13 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
2332 }
2333
2334 if ( is_server && lo->ldo_tls_dhfile ) {
2335+#if OPENSSL_VERSION_MAJOR >= 3
2336+ EVP_PKEY *dh;
2337+#define bio_params( bio, dh ) dh = PEM_read_bio_Parameters( bio, &dh )
2338+#else
2339 DH *dh;
2340+#define bio_params( bio, dh ) dh = PEM_read_bio_DHparams( bio, NULL, NULL, NULL )
2341+#endif
2342 BIO *bio;
2343
2344 if (( bio=BIO_new_file( lt->lt_dhfile,"r" )) == NULL ) {
2345@@ -533,7 +543,7 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
2346 tlso_report_error();
2347 return -1;
2348 }
2349- if (!( dh=PEM_read_bio_DHparams( bio, NULL, NULL, NULL ))) {
2350+ if (!( bio_params( bio, dh ))) {
2351 Debug1( LDAP_DEBUG_ANY,
2352 "TLS: could not read DH parameters file `%s'.\n",
2353 lo->ldo_tls_dhfile );
2354@@ -542,9 +552,13 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
2355 return -1;
2356 }
2357 BIO_free( bio );
2358+#if OPENSSL_VERSION_MAJOR >= 3
2359+ SSL_CTX_set0_tmp_dh_pkey( ctx, dh );
2360+#else
2361 SSL_CTX_set_tmp_dh( ctx, dh );
2362 SSL_CTX_set_options( ctx, SSL_OP_SINGLE_DH_USE );
2363 DH_free( dh );
2364+#endif
2365 }
2366
2367 if ( lo->ldo_tls_ecname ) {
2368diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES
2369index 6ff5d5f..76dd591 100644
2370--- a/libraries/liblmdb/CHANGES
2371+++ b/libraries/liblmdb/CHANGES
2372@@ -1,5 +1,8 @@
2373 LMDB 0.9 Change Log
2374
2375+LMDB 0.9.31 Release (2023/07/10)
2376+ ITS#8447 - Fix cursor_put(MDB_CURRENT) on DUPSORT DB with different sized data
2377+
2378 LMDB 0.9.30 Release (2023/02/08)
2379 ITS#9806 - LMDB page_split: key threshold depends on page size
2380 ITS#9916 - avoid gcc optimization bug on sparc64 linux
2381diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h
2382index 5f5d80a..ff03c22 100644
2383--- a/libraries/liblmdb/lmdb.h
2384+++ b/libraries/liblmdb/lmdb.h
2385@@ -200,7 +200,7 @@ typedef int mdb_filehandle_t;
2386 /** Library minor version */
2387 #define MDB_VERSION_MINOR 9
2388 /** Library patch version */
2389-#define MDB_VERSION_PATCH 30
2390+#define MDB_VERSION_PATCH 31
2391
2392 /** Combine args a,b,c into a single integer for easy version comparisons */
2393 #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c))
2394@@ -210,7 +210,7 @@ typedef int mdb_filehandle_t;
2395 MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH)
2396
2397 /** The release date of this library version */
2398-#define MDB_VERSION_DATE "February 8, 2023"
2399+#define MDB_VERSION_DATE "July 10, 2023"
2400
2401 /** A stringifier for the version info */
2402 #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")"
2403diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
2404index 9315171..deb6779 100644
2405--- a/libraries/liblmdb/mdb.c
2406+++ b/libraries/liblmdb/mdb.c
2407@@ -6963,11 +6963,14 @@ current:
2408 else if (!(mc->mc_flags & C_SUB))
2409 memcpy(olddata.mv_data, data->mv_data, data->mv_size);
2410 else {
2411+ if (key->mv_size != NODEKSZ(leaf))
2412+ goto new_ksize;
2413 memcpy(NODEKEY(leaf), key->mv_data, key->mv_size);
2414 goto fix_parent;
2415 }
2416 return MDB_SUCCESS;
2417 }
2418+new_ksize:
2419 mdb_node_del(mc, 0);
2420 }
2421
2422diff --git a/libraries/librewrite/ldapmap.c b/libraries/librewrite/ldapmap.c
2423index 7d0252b..e62cd3a 100644
2424--- a/libraries/librewrite/ldapmap.c
2425+++ b/libraries/librewrite/ldapmap.c
2426@@ -343,6 +343,7 @@ do_bind:;
2427 NULL, NULL, NULL );
2428 if ( rc == LDAP_SERVER_DOWN && first_try ) {
2429 first_try = 0;
2430+ ldap_unbind_ext( ld, NULL, NULL );
2431 if ( ldap_initialize( &ld, data->lm_url ) != LDAP_SUCCESS ) {
2432 rc = REWRITE_ERR;
2433 goto rc_return;
2434@@ -360,11 +361,14 @@ do_bind:;
2435 data->lm_attrs, 0, NULL, NULL, NULL, 1, &res );
2436 if ( rc == LDAP_SERVER_DOWN && first_try ) {
2437 first_try = 0;
2438- if ( ldap_initialize( &ld, data->lm_url ) != LDAP_SUCCESS ) {
2439+ ldap_unbind_ext( ld, NULL, NULL );
2440+ if ( ldap_initialize( &ld, data->lm_url ) != LDAP_SUCCESS ) {
2441 rc = REWRITE_ERR;
2442 goto rc_return;
2443 }
2444 set_version = 1;
2445+ ldap_msgfree( res );
2446+ res = NULL;
2447 goto do_bind;
2448
2449 } else if ( rc != LDAP_SUCCESS ) {
2450@@ -373,7 +377,6 @@ do_bind:;
2451 }
2452
2453 if ( ldap_count_entries( ld, res ) != 1 ) {
2454- ldap_msgfree( res );
2455 rc = REWRITE_ERR;
2456 goto rc_return;
2457 }
2458@@ -408,14 +411,14 @@ do_bind:;
2459 }
2460 }
2461
2462- ldap_msgfree( res );
2463-
2464 if ( val->bv_val == NULL ) {
2465 rc = REWRITE_ERR;
2466 goto rc_return;
2467 }
2468
2469 rc_return:;
2470+ ldap_msgfree( res );
2471+
2472 if ( data->lm_when == MAP_LDAP_EVERYTIME ) {
2473 if ( ld != NULL ) {
2474 ldap_unbind_ext( ld, NULL, NULL );
2475diff --git a/servers/slapd/at.c b/servers/slapd/at.c
2476index 99efba6..353a641 100644
2477--- a/servers/slapd/at.c
2478+++ b/servers/slapd/at.c
2479@@ -952,11 +952,15 @@ error_return:;
2480 }
2481
2482 if ( oidm ) {
2483+ if ( *err == at->at_oid )
2484+ *err = oidm;
2485 SLAP_FREE( at->at_oid );
2486 at->at_oid = oidm;
2487 }
2488
2489 if ( soidm ) {
2490+ if ( *err == at->at_syntax_oid )
2491+ *err = soidm;
2492 SLAP_FREE( at->at_syntax_oid );
2493 at->at_syntax_oid = soidm;
2494 }
2495diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c
2496index 52fe6ad..15d4a6a 100644
2497--- a/servers/slapd/bconfig.c
2498+++ b/servers/slapd/bconfig.c
2499@@ -5953,12 +5953,21 @@ config_back_add( Operation *op, SlapReply *rs )
2500 }
2501 }
2502
2503+ /*
2504+ * ITS#10045 Pre-check for abandon but be willing to handle that the
2505+ * operation might be abandoned while waiting for the server to pause.
2506+ */
2507 if ( op->o_abandon ) {
2508 rs->sr_err = SLAPD_ABANDON;
2509+ dopause = 0;
2510 goto out;
2511 }
2512 if ( slap_pause_server() < 0 )
2513 dopause = 0;
2514+ if ( op->o_abandon ) {
2515+ rs->sr_err = SLAPD_ABANDON;
2516+ goto out;
2517+ }
2518
2519 ldap_pvt_thread_rdwr_wlock( &cfb->cb_rwlock );
2520
2521@@ -6011,10 +6020,11 @@ config_back_add( Operation *op, SlapReply *rs )
2522
2523 out2:;
2524 ldap_pvt_thread_rdwr_wunlock( &cfb->cb_rwlock );
2525+
2526+out:;
2527 if ( dopause )
2528 slap_unpause_server();
2529
2530-out:;
2531 { int repl = op->o_dont_replicate;
2532 if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
2533 rs->sr_text = NULL; /* Set after config_add_internal */
2534@@ -6490,12 +6500,21 @@ config_back_modify( Operation *op, SlapReply *rs )
2535 slap_mods_opattrs( op, &op->orm_modlist, 1 );
2536
2537 if ( do_pause ) {
2538+ /*
2539+ * ITS#10045 Pre-check for abandon but be willing to handle that the
2540+ * operation might be abandoned while waiting for the server to pause.
2541+ */
2542 if ( op->o_abandon ) {
2543 rs->sr_err = SLAPD_ABANDON;
2544+ do_pause = 0;
2545 goto out;
2546 }
2547 if ( slap_pause_server() < 0 )
2548 do_pause = 0;
2549+ if ( op->o_abandon ) {
2550+ rs->sr_err = SLAPD_ABANDON;
2551+ goto out;
2552+ }
2553 }
2554 ldap_pvt_thread_rdwr_wlock( &cfb->cb_rwlock );
2555
2556@@ -6530,9 +6549,9 @@ config_back_modify( Operation *op, SlapReply *rs )
2557 }
2558
2559 ldap_pvt_thread_rdwr_wunlock( &cfb->cb_rwlock );
2560+out:
2561 if ( do_pause )
2562 slap_unpause_server();
2563-out:
2564 send_ldap_result( op, rs );
2565 slap_graduate_commit_csn( op );
2566 return rs->sr_err;
2567@@ -6662,12 +6681,21 @@ config_back_modrdn( Operation *op, SlapReply *rs )
2568 goto out;
2569 }
2570
2571+ /*
2572+ * ITS#10045 Pre-check for abandon but be willing to handle that the
2573+ * operation might be abandoned while waiting for the server to pause.
2574+ */
2575 if ( op->o_abandon ) {
2576 rs->sr_err = SLAPD_ABANDON;
2577+ dopause = 0;
2578 goto out;
2579 }
2580 if ( slap_pause_server() < 0 )
2581 dopause = 0;
2582+ if ( op->o_abandon ) {
2583+ rs->sr_err = SLAPD_ABANDON;
2584+ goto out;
2585+ }
2586
2587 ldap_pvt_thread_rdwr_wlock( &cfb->cb_rwlock );
2588
2589@@ -6737,9 +6765,9 @@ config_back_modrdn( Operation *op, SlapReply *rs )
2590
2591 ldap_pvt_thread_rdwr_wunlock( &cfb->cb_rwlock );
2592
2593+out:
2594 if ( dopause )
2595 slap_unpause_server();
2596-out:
2597 send_ldap_result( op, rs );
2598 return rs->sr_err;
2599 }
2600@@ -6774,6 +6802,11 @@ config_back_delete( Operation *op, SlapReply *rs )
2601
2602 ldap_pvt_thread_rdwr_wlock( &cfb->cb_rwlock );
2603
2604+ if ( op->o_abandon ) {
2605+ rs->sr_err = SLAPD_ABANDON;
2606+ goto out2;
2607+ }
2608+
2609 if ( ce->ce_type == Cft_Overlay ){
2610 overlay_remove( ce->ce_be, (slap_overinst *)ce->ce_bi, op );
2611 } else if ( ce->ce_type == Cft_Misc ) {
2612diff --git a/servers/slapd/overlays/constraint.c b/servers/slapd/overlays/constraint.c
2613index 1feff7a..c691f0b 100644
2614--- a/servers/slapd/overlays/constraint.c
2615+++ b/servers/slapd/overlays/constraint.c
2616@@ -816,7 +816,7 @@ constraint_add( Operation *op, SlapReply *rs )
2617 int rc = 0;
2618 char *msg = NULL;
2619
2620- if (get_relax(op) || SLAPD_SYNC_IS_SYNCCONN( op->o_connid )) {
2621+ if ( get_relax(op) || be_shadow_update( op ) ) {
2622 return SLAP_CB_CONTINUE;
2623 }
2624
2625@@ -958,7 +958,7 @@ constraint_update( Operation *op, SlapReply *rs )
2626 char *msg = NULL;
2627 int is_v;
2628
2629- if (get_relax(op) || SLAPD_SYNC_IS_SYNCCONN( op->o_connid )) {
2630+ if ( get_relax(op) || be_shadow_update( op ) ) {
2631 return SLAP_CB_CONTINUE;
2632 }
2633
2634diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c
2635index 89425c7..10cacf9 100644
2636--- a/servers/slapd/overlays/dynlist.c
2637+++ b/servers/slapd/overlays/dynlist.c
2638@@ -99,6 +99,83 @@ ad_infilter( AttributeDescription *ad, Filter *f )
2639 return 0;
2640 }
2641
2642+static Filter *
2643+transform_filter( Operation *op, dynlist_info_t *dli, int not, Filter *orig )
2644+{
2645+ Filter *f;
2646+ dynlist_map_t *dlm;
2647+
2648+ /* Tilt the filter towards TRUE if it could match through this dli */
2649+ int result = not ? LDAP_COMPARE_FALSE : LDAP_COMPARE_TRUE;
2650+
2651+ if ( orig ) {
2652+ f = orig;
2653+ } else {
2654+ f = orig = filter_dup( op->ors_filter, op->o_tmpmemctx );
2655+ }
2656+
2657+ switch( f->f_choice & SLAPD_FILTER_MASK ) {
2658+ case LDAP_FILTER_EQUALITY:
2659+ case LDAP_FILTER_GE:
2660+ case LDAP_FILTER_LE:
2661+ case LDAP_FILTER_APPROX:
2662+ for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
2663+ AttributeDescription *ad = dlm->dlm_mapped_ad ? dlm->dlm_mapped_ad : dlm->dlm_member_ad;
2664+ if ( f->f_av_desc == ad ) {
2665+ filter_free_x( op, f, 0 );
2666+ f->f_choice = SLAPD_FILTER_COMPUTED;
2667+ f->f_result = result;
2668+ break;
2669+ }
2670+ }
2671+ break;
2672+ case LDAP_FILTER_PRESENT:
2673+ for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
2674+ AttributeDescription *ad = dlm->dlm_mapped_ad ? dlm->dlm_mapped_ad : dlm->dlm_member_ad;
2675+ if ( f->f_sub_desc == ad ) {
2676+ filter_free_x( op, f, 0 );
2677+ f->f_choice = SLAPD_FILTER_COMPUTED;
2678+ f->f_result = result;
2679+ break;
2680+ }
2681+ }
2682+ break;
2683+ case LDAP_FILTER_SUBSTRINGS:
2684+ for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
2685+ AttributeDescription *ad = dlm->dlm_mapped_ad ? dlm->dlm_mapped_ad : dlm->dlm_member_ad;
2686+ if ( f->f_desc == ad ) {
2687+ filter_free_x( op, f, 0 );
2688+ f->f_choice = SLAPD_FILTER_COMPUTED;
2689+ f->f_result = result;
2690+ break;
2691+ }
2692+ }
2693+ break;
2694+ case LDAP_FILTER_EXT:
2695+ for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
2696+ AttributeDescription *ad = dlm->dlm_mapped_ad ? dlm->dlm_mapped_ad : dlm->dlm_member_ad;
2697+ if ( f->f_mr_desc == ad ) {
2698+ filter_free_x( op, f, 0 );
2699+ f->f_choice = SLAPD_FILTER_COMPUTED;
2700+ f->f_result = result;
2701+ break;
2702+ }
2703+ }
2704+ break;
2705+ case LDAP_FILTER_AND:
2706+ case LDAP_FILTER_OR:
2707+ for ( f = f->f_list; f; f = f->f_next )
2708+ transform_filter( op, dli, not, f );
2709+ break;
2710+ case LDAP_FILTER_NOT:
2711+ transform_filter( op, dli, !not, f->f_list );
2712+ case SLAPD_FILTER_COMPUTED:
2713+ break;
2714+ }
2715+
2716+ return orig;
2717+}
2718+
2719 typedef struct dynlist_filterinst_t {
2720 AttributeAssertion *df_a;
2721 Entry *df_e;
2722@@ -1790,7 +1867,7 @@ dynlist_search( Operation *op, SlapReply *rs )
2723 dynlist_info_t *dli;
2724 Operation o = *op;
2725 dynlist_map_t *dlm;
2726- Filter f[3];
2727+ Filter f[4];
2728 AttributeAssertion ava[2];
2729 AttributeName an[2] = {0};
2730
2731@@ -1908,27 +1985,45 @@ dynlist_search( Operation *op, SlapReply *rs )
2732 }
2733
2734 if ( tmpwant ) {
2735+ Filter *f_new = NULL;
2736+
2737+ if ( tmpwant == WANT_MEMBER ) {
2738+ /*
2739+ * If we only need to list groups, not their members, keep the
2740+ * filter, assuming any references to mapped attributes make it
2741+ * succeed.
2742+ *
2743+ * A nested groups search will indicate that it needs both.
2744+ */
2745+ f_new = transform_filter( op, dli, 0, NULL );
2746+ }
2747
2748 if ( static_oc ) {
2749- f[0].f_choice = LDAP_FILTER_OR;
2750+ f[0].f_choice = LDAP_FILTER_AND;
2751 f[0].f_list = &f[1];
2752 f[0].f_next = NULL;
2753- f[1].f_choice = LDAP_FILTER_EQUALITY;
2754- f[1].f_next = &f[2];
2755- f[1].f_ava = &ava[0];
2756- f[1].f_av_desc = slap_schema.si_ad_objectClass;
2757- f[1].f_av_value = dli->dli_oc->soc_cname;
2758+ f[1].f_choice = LDAP_FILTER_OR;
2759+ f[1].f_list = &f[2];
2760+ f[1].f_next = f_new;
2761 f[2].f_choice = LDAP_FILTER_EQUALITY;
2762- f[2].f_ava = &ava[1];
2763+ f[2].f_next = &f[3];
2764+ f[2].f_ava = &ava[0];
2765 f[2].f_av_desc = slap_schema.si_ad_objectClass;
2766- f[2].f_av_value = static_oc->soc_cname;
2767- f[2].f_next = NULL;
2768+ f[2].f_av_value = dli->dli_oc->soc_cname;
2769+ f[3].f_choice = LDAP_FILTER_EQUALITY;
2770+ f[3].f_ava = &ava[1];
2771+ f[3].f_av_desc = slap_schema.si_ad_objectClass;
2772+ f[3].f_av_value = static_oc->soc_cname;
2773+ f[3].f_next = NULL;
2774 } else {
2775- f[0].f_choice = LDAP_FILTER_EQUALITY;
2776- f[0].f_ava = ava;
2777- f[0].f_av_desc = slap_schema.si_ad_objectClass;
2778- f[0].f_av_value = dli->dli_oc->soc_cname;
2779+ f[0].f_choice = LDAP_FILTER_AND;
2780+ f[0].f_list = &f[1];
2781 f[0].f_next = NULL;
2782+ f[1].f_choice = LDAP_FILTER_EQUALITY;
2783+ f[1].f_ava = ava;
2784+ f[1].f_av_desc = slap_schema.si_ad_objectClass;
2785+ f[1].f_av_value = dli->dli_oc->soc_cname;
2786+ f[1].f_next = f_new;
2787 }
2788
2789 if ( o.o_callback != sc ) {
2790@@ -1963,6 +2058,7 @@ dynlist_search( Operation *op, SlapReply *rs )
2791 }
2792 o.o_tmpfree( o.ors_filterstr.bv_val, o.o_tmpmemctx );
2793 o.ors_filterstr.bv_val = NULL;
2794+ filter_free_x( &o, f_new, 1 );
2795 if ( found != ds->ds_found && nested )
2796 dynlist_nestlink( op, ds );
2797 }
2798diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c
2799index 726eaeb..2b947e4 100644
2800--- a/servers/slapd/overlays/pcache.c
2801+++ b/servers/slapd/overlays/pcache.c
2802@@ -3841,8 +3841,8 @@ pc_cfadd( Operation *op, SlapReply *rs, Entry *p, ConfigArgs *ca )
2803
2804 /* We can only create this entry if the database is table-driven
2805 */
2806- if ( cm->db.bd_info->bi_cf_ocs )
2807- config_build_entry( op, rs, pe, ca, &bv, cm->db.bd_info->bi_cf_ocs,
2808+ if ( cm->db.be_cf_ocs )
2809+ config_build_entry( op, rs, pe, ca, &bv, cm->db.be_cf_ocs,
2810 &pcocs[1] );
2811
2812 return 0;
2813diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c
2814index a3f2e70..48b9942 100644
2815--- a/servers/slapd/overlays/ppolicy.c
2816+++ b/servers/slapd/overlays/ppolicy.c
2817@@ -1617,7 +1617,8 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
2818 } else if ( ppb->pp.pwdMinDelay ) {
2819 int waittime = ppb->pp.pwdMinDelay << fc;
2820 time_t wait_end;
2821- struct berval lockout_stamp;
2822+ char lockout_stamp_buf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
2823+ struct berval lockout_stamp = BER_BVC(lockout_stamp_buf);
2824
2825 if ( waittime > ppb->pp.pwdMaxDelay ) {
2826 waittime = ppb->pp.pwdMaxDelay;
2827@@ -2223,7 +2224,7 @@ ppolicy_add(
2828 return rs->sr_err;
2829
2830 /* If this is a replica, assume the provider checked everything */
2831- if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) )
2832+ if ( be_shadow_update( op ) )
2833 return SLAP_CB_CONTINUE;
2834
2835 ppolicy_get( op, op->ora_e, &pp );
2836@@ -2390,7 +2391,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
2837 /* If this is a replica, we may need to tweak some of the
2838 * provider's modifications. Otherwise, just pass it through.
2839 */
2840- if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
2841+ if ( be_shadow_update( op ) ) {
2842 Modifications **prev;
2843 Attribute *a_grace, *a_lock, *a_fail, *a_success;
2844
2845diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c
2846index 1ff507c..5504c97 100644
2847--- a/servers/slapd/overlays/syncprov.c
2848+++ b/servers/slapd/overlays/syncprov.c
2849@@ -869,6 +869,11 @@ static void free_resinfo( syncres *sr )
2850
2851 #define FS_UNLINK 1
2852 #define FS_LOCK 2
2853+#define FS_DEFER 4
2854+
2855+#define FSR_NOTFREE 0
2856+#define FSR_DIDFREE 1
2857+#define FSR_CANFREE 2
2858
2859 static int
2860 syncprov_free_syncop( syncops *so, int flags )
2861@@ -879,12 +884,19 @@ syncprov_free_syncop( syncops *so, int flags )
2862 if ( flags & FS_LOCK )
2863 ldap_pvt_thread_mutex_lock( &so->s_mutex );
2864 /* already being freed, or still in use */
2865- if ( !so->s_inuse || --so->s_inuse > 0 ) {
2866+ if ( !so->s_inuse || so->s_inuse > 1 ) {
2867 if ( flags & FS_LOCK )
2868 ldap_pvt_thread_mutex_unlock( &so->s_mutex );
2869- return 0;
2870+ if ( !( flags & FS_DEFER ) && so->s_inuse )
2871+ so->s_inuse--;
2872+ return FSR_NOTFREE;
2873 }
2874 ldap_pvt_thread_mutex_unlock( &so->s_mutex );
2875+
2876+ /* caller wants to cleanup other stuff before actual free */
2877+ if ( flags & FS_DEFER )
2878+ return FSR_CANFREE;
2879+
2880 if (( flags & FS_UNLINK ) && so->s_si ) {
2881 syncops **sop;
2882 ldap_pvt_thread_mutex_lock( &so->s_si->si_ops_mutex );
2883@@ -912,7 +924,7 @@ syncprov_free_syncop( syncops *so, int flags )
2884 }
2885 ldap_pvt_thread_mutex_destroy( &so->s_mutex );
2886 ch_free( so );
2887- return 1;
2888+ return FSR_DIDFREE;
2889 }
2890
2891 /* Send a persistent search response */
2892@@ -1027,6 +1039,9 @@ syncprov_qplay( Operation *op, syncops *so )
2893 } else {
2894 rc = syncprov_sendresp( op, sr->s_info, so, sr->s_mode );
2895 }
2896+ } else {
2897+ /* set rc so we don't do a new qstart */
2898+ rc = 1;
2899 }
2900
2901 free_resinfo( sr );
2902@@ -1053,6 +1068,9 @@ syncprov_qplay( Operation *op, syncops *so )
2903 return rc;
2904 }
2905
2906+static int
2907+syncprov_drop_psearch( syncops *so, int lock );
2908+
2909 /* task for playing back queued responses */
2910 static void *
2911 syncprov_qtask( void *ctx, void *arg )
2912@@ -1061,7 +1079,7 @@ syncprov_qtask( void *ctx, void *arg )
2913 OperationBuffer opbuf;
2914 Operation *op;
2915 BackendDB be;
2916- int rc;
2917+ int rc, flag, frc;
2918
2919 op = &opbuf.ob_op;
2920 *op = *so->s_op;
2921@@ -1090,14 +1108,24 @@ syncprov_qtask( void *ctx, void *arg )
2922 if ( !rc && !so->s_res )
2923 rc = 1;
2924
2925+ flag = FS_UNLINK;
2926+ if ( rc && op->o_abandon )
2927+ flag = FS_DEFER;
2928+
2929 /* decrement use count... */
2930- if ( !syncprov_free_syncop( so, FS_UNLINK )) {
2931+ frc = syncprov_free_syncop( so, flag );
2932+ if ( frc == FSR_NOTFREE ) {
2933 if ( rc )
2934 /* if we didn't unlink, and task is no longer queued, clear flag */
2935 so->s_flags ^= PS_TASK_QUEUED;
2936 ldap_pvt_thread_mutex_unlock( &so->s_mutex );
2937 }
2938
2939+ /* if we got abandoned while processing, cleanup now */
2940+ if ( frc == FSR_CANFREE ) {
2941+ syncprov_drop_psearch( so, 1 );
2942+ }
2943+
2944 return NULL;
2945 }
2946
2947@@ -1272,7 +1300,9 @@ syncprov_op_abandon( Operation *op, SlapReply *rs )
2948 return SLAP_CB_CONTINUE;
2949 }
2950 }
2951- syncprov_drop_psearch( so, 0 );
2952+ /* if task is active, it must drop itself */
2953+ if ( !( so->s_flags & PS_TASK_QUEUED ))
2954+ syncprov_drop_psearch( so, 0 );
2955 }
2956 return SLAP_CB_CONTINUE;
2957 }
2958diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c
2959index 2d31bb0..09b12dc 100644
2960--- a/servers/slapd/overlays/translucent.c
2961+++ b/servers/slapd/overlays/translucent.c
2962@@ -176,9 +176,9 @@ translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
2963
2964 /* We can only create this entry if the database is table-driven
2965 */
2966- if ( ov->db.bd_info->bi_cf_ocs )
2967+ if ( ov->db.be_cf_ocs )
2968 config_build_entry( op, rs, cei, ca, &bv,
2969- ov->db.bd_info->bi_cf_ocs,
2970+ ov->db.be_cf_ocs,
2971 &translucentocs[1] );
2972
2973 return 0;
2974diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c
2975index 7a7c8fb..7ff128a 100644
2976--- a/servers/slapd/overlays/unique.c
2977+++ b/servers/slapd/overlays/unique.c
2978@@ -1073,7 +1073,7 @@ unique_add(
2979 Debug(LDAP_DEBUG_TRACE, "==> unique_add <%s>\n",
2980 op->o_req_dn.bv_val );
2981
2982- if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) || (
2983+ if ( be_shadow_update( op ) || (
2984 get_relax(op) > SLAP_CONTROL_IGNORED
2985 && access_allowed( op, op->ora_e,
2986 slap_schema.si_ad_entry, NULL,
2987@@ -1225,7 +1225,7 @@ unique_modify(
2988 return rc;
2989 }
2990
2991- if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
2992+ if ( be_shadow_update( op ) ) {
2993 return rc;
2994 }
2995 if ( get_relax(op) > SLAP_CONTROL_IGNORED
2996@@ -1365,7 +1365,7 @@ unique_modrdn(
2997 Debug(LDAP_DEBUG_TRACE, "==> unique_modrdn <%s> <%s>\n",
2998 op->o_req_dn.bv_val, op->orr_newrdn.bv_val );
2999
3000- if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
3001+ if ( be_shadow_update( op ) ) {
3002 return rc;
3003 }
3004 if ( get_relax(op) > SLAP_CONTROL_IGNORED
3005diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c
3006index eef5b09..b6b1ddb 100644
3007--- a/servers/slapd/passwd.c
3008+++ b/servers/slapd/passwd.c
3009@@ -291,6 +291,8 @@ old_good:
3010 } else {
3011 slap_callback **sc;
3012
3013+ cb.sc_next = op->o_callback;
3014+
3015 op->o_tag = LDAP_REQ_MODIFY;
3016 op->o_callback = &cb;
3017 op->orm_modlist = qpw->rs_mods;
3018diff --git a/servers/slapd/pwmods/README.argon2 b/servers/slapd/pwmods/README.argon2
3019index 595c50d..33c562b 100644
3020--- a/servers/slapd/pwmods/README.argon2
3021+++ b/servers/slapd/pwmods/README.argon2
3022@@ -15,28 +15,16 @@ Both hash the password "secret", the first using the salt "saltsalt", the second
3023 Building
3024 --------
3025
3026-1) Customize the OPENLDAP variable in Makefile to point to the OpenLDAP
3027-source root.
3028-
3029-For initial testing you might also want to edit DEFS to define
3030-SLAPD_ARGON2_DEBUG, which enables logging to stderr (don't leave this on
3031-in production, as it prints passwords in cleartext).
3032-
3033-2) Run 'make' to produce argon2.so
3034-
3035-3) Copy argon2.so somewhere permanent.
3036-
3037-4) Edit your slapd.conf (eg. /etc/ldap/slapd.conf), and add:
3038-
3039-moduleload ...path/to/argon2.so
3040-
3041-5) Restart slapd.
3042-
3043+This module is now part of regular OpenLDAP build process and enabled if
3044+libsodium or libargon2 library and the corresponding development headers are
3045+present. You can also choose the library to build against if you prefer by
3046+passing --enable-argon2=<libsodium|libargon2> to your configure invocation.
3047
3048 Configuring
3049 -----------
3050
3051-The {ARGON2} password scheme should now be recognised.
3052+Load the argon2 module (e.g. with olcModuleLoad or moduleload) and the
3053+{ARGON2} password scheme should now be recognised.
3054
3055 You can also tell OpenLDAP to use one of this scheme when processing LDAP
3056 Password Modify Extended Operations, thanks to the password-hash option in
3057diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c
3058index 5fceb63..3b02a3b 100644
3059--- a/servers/slapd/syncrepl.c
3060+++ b/servers/slapd/syncrepl.c
3061@@ -604,8 +604,10 @@ ldap_sync_search(
3062 lattrs[2] = NULL;
3063 rc = ldap_search_ext_s( si->si_ld, "", LDAP_SCOPE_BASE, generic_filterstr.bv_val, lattrs, 0,
3064 NULL, NULL, NULL, si->si_slimit, &res );
3065- if ( rc )
3066+ if ( rc ) {
3067+ ldap_msgfree( res );
3068 return rc;
3069+ }
3070 msg = ldap_first_message( si->si_ld, res );
3071 if ( msg && ldap_msgtype( msg ) == LDAP_RES_SEARCH_ENTRY ) {
3072 BerElement *ber = NULL;
3073diff --git a/servers/slapd/syslog.c b/servers/slapd/syslog.c
3074index 47ea1c6..50f3053 100644
3075--- a/servers/slapd/syslog.c
3076+++ b/servers/slapd/syslog.c
3077@@ -209,7 +209,7 @@ openlog(const char *ident, int logstat, int logfac)
3078 }
3079
3080 void
3081-closelog()
3082+closelog(void)
3083 {
3084 (void)close(LogFile);
3085 LogFile = -1;
3086diff --git a/tests/progs/slapd-mtread.c b/tests/progs/slapd-mtread.c
3087index 587d3cf..bf6014a 100644
3088--- a/tests/progs/slapd-mtread.c
3089+++ b/tests/progs/slapd-mtread.c
3090@@ -528,6 +528,7 @@ do_random( LDAP *ld,
3091 if ( rc ) {
3092 tester_ldap_error( ld, "ldap_search_ext_s", NULL );
3093 }
3094+ ldap_msgfree( res );
3095 break;
3096 }
3097
3098@@ -566,6 +567,7 @@ do_random( LDAP *ld,
3099
3100 default:
3101 tester_ldap_error( ld, "ldap_search_ext_s", NULL );
3102+ ldap_msgfree( res );
3103 break;
3104 }
3105
3106diff --git a/tests/progs/slapd-search.c b/tests/progs/slapd-search.c
3107index 13a2818..f849199 100644
3108--- a/tests/progs/slapd-search.c
3109+++ b/tests/progs/slapd-search.c
3110@@ -214,6 +214,7 @@ do_random( struct tester_conn_args *config,
3111 if ( rc ) {
3112 tester_ldap_error( ld, "ldap_search_ext_s", NULL );
3113 }
3114+ ldap_msgfree( res );
3115 break;
3116 }
3117
3118@@ -270,6 +271,7 @@ do_random( struct tester_conn_args *config,
3119
3120 default:
3121 tester_ldap_error( ld, "ldap_search_ext_s", NULL );
3122+ ldap_msgfree( res );
3123 break;
3124 }
3125
3126diff --git a/tests/progs/slapd-watcher.c b/tests/progs/slapd-watcher.c
3127index 0fed11f..3c315d7 100644
3128--- a/tests/progs/slapd-watcher.c
3129+++ b/tests/progs/slapd-watcher.c
3130@@ -537,7 +537,6 @@ setup_server( struct tester_conn_args *config, server *sv, int first )
3131 }
3132 }
3133 }
3134- ldap_msgfree( res );
3135 break;
3136
3137 default:
3138@@ -545,6 +544,7 @@ setup_server( struct tester_conn_args *config, server *sv, int first )
3139 if ( first )
3140 exit( EXIT_FAILURE );
3141 }
3142+ ldap_msgfree( res );
3143 }
3144 }
3145
3146diff --git a/tests/scripts/lloadd/test001-backend-issues b/tests/scripts/lloadd/test001-backend-issues
3147index 9b0b0b2..b7f99fc 100755
3148--- a/tests/scripts/lloadd/test001-backend-issues
3149+++ b/tests/scripts/lloadd/test001-backend-issues
3150@@ -55,6 +55,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED
3151 RC=$?
3152 if test $RC != 0 ; then
3153 echo "slapadd failed ($RC)!"
3154+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3155 exit $RC
3156 fi
3157
3158diff --git a/tests/scripts/lloadd/test002-load b/tests/scripts/lloadd/test002-load
3159index 942f6bc..2de04d6 100755
3160--- a/tests/scripts/lloadd/test002-load
3161+++ b/tests/scripts/lloadd/test002-load
3162@@ -74,6 +74,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED
3163 RC=$?
3164 if test $RC != 0 ; then
3165 echo "slapadd failed ($RC)!"
3166+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3167 exit $RC
3168 fi
3169
3170diff --git a/tests/scripts/lloadd/test003-cnconfig b/tests/scripts/lloadd/test003-cnconfig
3171index edf5801..b578b96 100755
3172--- a/tests/scripts/lloadd/test003-cnconfig
3173+++ b/tests/scripts/lloadd/test003-cnconfig
3174@@ -75,6 +75,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED
3175 RC=$?
3176 if test $RC != 0 ; then
3177 echo "slapadd failed ($RC)!"
3178+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3179 exit $RC
3180 fi
3181
3182diff --git a/tests/scripts/lloadd/test004-monitor b/tests/scripts/lloadd/test004-monitor
3183index d1db7c1..5fe9276 100755
3184--- a/tests/scripts/lloadd/test004-monitor
3185+++ b/tests/scripts/lloadd/test004-monitor
3186@@ -87,6 +87,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED
3187 RC=$?
3188 if test $RC != 0 ; then
3189 echo "slapadd failed ($RC)!"
3190+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3191 exit $RC
3192 fi
3193
3194diff --git a/tests/scripts/test049-sync-config b/tests/scripts/test049-sync-config
3195index 88a57b9..b05e041 100755
3196--- a/tests/scripts/test049-sync-config
3197+++ b/tests/scripts/test049-sync-config
3198@@ -61,6 +61,12 @@ esac
3199 echo "Starting provider slapd on TCP/IP port $PORT1..."
3200 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3201 $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
3202+RC=$?
3203+if test $RC != 0 ; then
3204+ echo "slapadd failed ($RC)!"
3205+ exit $RC
3206+fi
3207+
3208 cd $PRODIR
3209 $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 &
3210 PID=$!
3211@@ -134,6 +140,13 @@ fi
3212
3213 echo "Starting consumer slapd on TCP/IP port $PORT2..."
3214 $SLAPADD -F $CFCON -n 0 -l $CONFLDIF
3215+RC=$?
3216+if test $RC != 0 ; then
3217+ echo "slapadd failed ($RC)!"
3218+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3219+ exit $RC
3220+fi
3221+
3222 cd $CONDIR
3223 $SLAPD -F ./slapd.d -h $URI2 -d $LVL > $LOG2 2>&1 &
3224 CONSUMERPID=$!
3225diff --git a/tests/scripts/test050-syncrepl-multiprovider b/tests/scripts/test050-syncrepl-multiprovider
3226index d32ae66..065c86a 100755
3227--- a/tests/scripts/test050-syncrepl-multiprovider
3228+++ b/tests/scripts/test050-syncrepl-multiprovider
3229@@ -79,6 +79,11 @@ objectClass: olcDatabaseConfig
3230 olcDatabase: {0}config
3231 olcRootPW:< file://$CONFIGPWF
3232 EOF
3233+RC=$?
3234+if test $RC != 0 ; then
3235+ echo "slapadd failed ($RC)!"
3236+ exit $RC
3237+fi
3238
3239 n=`expr $n + 1`
3240 done
3241diff --git a/tests/scripts/test053-syncprov-glue b/tests/scripts/test053-syncprov-glue
3242index a75a318..3caa0d4 100755
3243--- a/tests/scripts/test053-syncprov-glue
3244+++ b/tests/scripts/test053-syncprov-glue
3245@@ -74,6 +74,11 @@ olcDatabase: {0}config
3246 olcRootPW:< file://$CONFIGPWF
3247
3248 EOF
3249+RC=$?
3250+if test $RC != 0 ; then
3251+ echo "slapadd failed ($RC)!"
3252+ exit $RC
3253+fi
3254
3255 echo "Initializing provider2 configurations..."
3256 $SLAPADD -F $CFPRO2 -n 0 <<EOF
3257@@ -87,6 +92,11 @@ olcDatabase: {0}config
3258 olcRootPW:< file://$CONFIGPWF
3259
3260 EOF
3261+RC=$?
3262+if test $RC != 0 ; then
3263+ echo "slapadd failed ($RC)!"
3264+ exit $RC
3265+fi
3266
3267 $SLAPADD -F $CFCONS -n 0 <<EOF
3268 dn: cn=config
3269@@ -98,6 +108,11 @@ objectClass: olcDatabaseConfig
3270 olcDatabase: {0}config
3271 olcRootPW:< file://$CONFIGPWF
3272 EOF
3273+RC=$?
3274+if test $RC != 0 ; then
3275+ echo "slapadd failed ($RC)!"
3276+ exit $RC
3277+fi
3278
3279 echo "Starting provider slapd on TCP/IP port $PORT1..."
3280 cd $PRODDIR
3281diff --git a/tests/scripts/test058-syncrepl-asymmetric b/tests/scripts/test058-syncrepl-asymmetric
3282index 22015a7..f950761 100755
3283--- a/tests/scripts/test058-syncrepl-asymmetric
3284+++ b/tests/scripts/test058-syncrepl-asymmetric
3285@@ -175,6 +175,12 @@ olcDatabase: {0}config
3286 olcRootPW:< file://$CONFIGPWF
3287
3288 EOF
3289+ RC=$?
3290+ if test $RC != 0 ; then
3291+ echo "slapadd failed ($RC)!"
3292+ exit $RC
3293+ fi
3294+
3295 ID=`expr $ID + 1`
3296 done
3297
3298@@ -191,6 +197,12 @@ olcDatabase: {0}config
3299 olcRootPW:< file://$CONFIGPWF
3300
3301 EOF
3302+
3303+RC=$?
3304+if test $RC != 0 ; then
3305+ echo "slapadd failed ($RC)!"
3306+ exit $RC
3307+fi
3308 done
3309
3310 echo "Starting central provider slapd on TCP/IP port $PORT1..."
3311diff --git a/tests/scripts/test059-consumer-config b/tests/scripts/test059-consumer-config
3312index 56848db..30e87e4 100755
3313--- a/tests/scripts/test059-consumer-config
3314+++ b/tests/scripts/test059-consumer-config
3315@@ -57,6 +57,12 @@ esac
3316 echo "Starting provider slapd on TCP/IP port $PORT1..."
3317 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3318 $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
3319+RC=$?
3320+if test $RC != 0 ; then
3321+ echo "slapadd failed ($RC)!"
3322+ exit $RC
3323+fi
3324+
3325 $SLAPD -F $CFPRO -h $URI1 -d $LVL > $LOG1 2>&1 &
3326 PID=$!
3327 if test $WAIT != 0 ; then
3328@@ -182,6 +188,13 @@ fi
3329
3330 echo "Starting consumer slapd on TCP/IP port $PORT2..."
3331 $SLAPADD -F $CFCON -n 0 -l $CONFLDIF
3332+RC=$?
3333+if test $RC != 0 ; then
3334+ echo "slapadd failed ($RC)!"
3335+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3336+ exit $RC
3337+fi
3338+
3339 $SLAPD -F $CFCON -h $URI2 -d $LVL > $LOG2 2>&1 &
3340 CONSUMERPID=$!
3341 if test $WAIT != 0 ; then
3342diff --git a/tests/scripts/test061-syncreplication-initiation b/tests/scripts/test061-syncreplication-initiation
3343index a8ce51c..3e3b973 100755
3344--- a/tests/scripts/test061-syncreplication-initiation
3345+++ b/tests/scripts/test061-syncreplication-initiation
3346@@ -82,6 +82,12 @@ olcDatabase: {0}config
3347 olcRootPW:< file://$CONFIGPWF
3348
3349 EOF
3350+
3351+ RC=$?
3352+ if test $RC != 0 ; then
3353+ echo "slapadd failed ($RC)!"
3354+ exit $RC
3355+ fi
3356 done
3357
3358 echo "Starting provider slapd on $PROV_URI"
3359diff --git a/tests/scripts/test062-config-delete b/tests/scripts/test062-config-delete
3360index dde8acd..afb87c4 100755
3361--- a/tests/scripts/test062-config-delete
3362+++ b/tests/scripts/test062-config-delete
3363@@ -39,6 +39,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF
3364 echo "Starting slapd on TCP/IP port $PORT1... $PWD"
3365 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3366 $SLAPADD -F $CONFDIR -n 0 -l $CONFLDIF
3367+RC=$?
3368+if test $RC != 0 ; then
3369+ echo "slapadd failed ($RC)!"
3370+ exit $RC
3371+fi
3372+
3373 cd $TESTDIR
3374 $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 &
3375 PID=$!
3376diff --git a/tests/scripts/test063-delta-multiprovider b/tests/scripts/test063-delta-multiprovider
3377index df4bdd1..8ce5906 100755
3378--- a/tests/scripts/test063-delta-multiprovider
3379+++ b/tests/scripts/test063-delta-multiprovider
3380@@ -214,6 +214,12 @@ olcDatabase: {3}monitor
3381 EOF
3382
3383 $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1
3384+RC=$?
3385+if test $RC != 0 ; then
3386+ echo "slapadd failed ($RC)!"
3387+ exit $RC
3388+fi
3389+
3390 PORT=`eval echo '$PORT'$n`
3391 echo "Starting server $n on TCP/IP port $PORT..."
3392 cd ${XDIR}${n}
3393diff --git a/tests/scripts/test064-constraint b/tests/scripts/test064-constraint
3394index c263cf9..5519123 100755
3395--- a/tests/scripts/test064-constraint
3396+++ b/tests/scripts/test064-constraint
3397@@ -120,6 +120,11 @@ olcConstraintAttribute: uid
3398 EOF
3399
3400 $SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif
3401+RC=$?
3402+if test $RC != 0 ; then
3403+ echo "slapadd failed ($RC)!"
3404+ exit $RC
3405+fi
3406
3407 echo "Starting slapd on TCP/IP port $PORT1..."
3408 $SLAPD -F $CONFDIR -h $URI1 -d $LVL > $LOG1 2>&1 &
3409diff --git a/tests/scripts/test066-autoca b/tests/scripts/test066-autoca
3410index fd23140..dd8b502 100755
3411--- a/tests/scripts/test066-autoca
3412+++ b/tests/scripts/test066-autoca
3413@@ -47,6 +47,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF
3414 echo "Starting slapd on TCP/IP port $PORT1..."
3415 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3416 $SLAPADD -F $CFDIR -n 0 -l $CONFLDIF
3417+RC=$?
3418+if test $RC != 0 ; then
3419+ echo "slapadd failed ($RC)!"
3420+ exit $RC
3421+fi
3422+
3423 $SLAPD -F $CFDIR -h $URIP1 -d $LVL > $LOG1 2>&1 &
3424 PID=$!
3425 if test $WAIT != 0 ; then
3426diff --git a/tests/scripts/test069-delta-multiprovider-starttls b/tests/scripts/test069-delta-multiprovider-starttls
3427index 2f5a0d3..277c0a7 100755
3428--- a/tests/scripts/test069-delta-multiprovider-starttls
3429+++ b/tests/scripts/test069-delta-multiprovider-starttls
3430@@ -195,7 +195,14 @@ olcAccessLogOps: writes
3431 olcAccessLogSuccess: TRUE
3432
3433 EOF
3434+
3435 $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1
3436+RC=$?
3437+if test $RC != 0 ; then
3438+ echo "slapadd failed ($RC)!"
3439+ exit $RC
3440+fi
3441+
3442 PORT=`eval echo '$PORT'$n`
3443 echo "Starting server $n on TCP/IP port $PORT..."
3444 cd ${XDIR}${n}
3445diff --git a/tests/scripts/test070-delta-multiprovider-ldaps b/tests/scripts/test070-delta-multiprovider-ldaps
3446index 18869d1..3fb96cc 100755
3447--- a/tests/scripts/test070-delta-multiprovider-ldaps
3448+++ b/tests/scripts/test070-delta-multiprovider-ldaps
3449@@ -195,6 +195,12 @@ olcAccessLogSuccess: TRUE
3450
3451 EOF
3452 $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1
3453+RC=$?
3454+if test $RC != 0 ; then
3455+ echo "slapadd failed ($RC)!"
3456+ exit $RC
3457+fi
3458+
3459 PORT=`eval echo '$PORT'$n`
3460 echo "Starting server $n on TCP/IP port $PORT..."
3461 cd ${XDIR}${n}
3462diff --git a/tests/scripts/test071-dirsync b/tests/scripts/test071-dirsync
3463index 9f5aede..455629b 100755
3464--- a/tests/scripts/test071-dirsync
3465+++ b/tests/scripts/test071-dirsync
3466@@ -88,6 +88,13 @@ objectclass: dcObject
3467 o: OpenLDAP Testing
3468
3469 EOMODS
3470+RC=$?
3471+if test $RC != 0 ; then
3472+ echo "slapadd failed ($RC)!"
3473+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3474+ exit $RC
3475+fi
3476+
3477 $SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
3478 CONSUMERPID=$!
3479 if test $WAIT != 0 ; then
3480diff --git a/tests/scripts/test076-authid-rewrite b/tests/scripts/test076-authid-rewrite
3481index 7799d88..383e4c3 100755
3482--- a/tests/scripts/test076-authid-rewrite
3483+++ b/tests/scripts/test076-authid-rewrite
3484@@ -31,6 +31,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF
3485 echo "Starting slapd on TCP/IP port $PORT1... $PWD"
3486 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3487 $SLAPADD -F $CONFDIR -n 0 -l $CONFLDIF
3488+RC=$?
3489+if test $RC != 0 ; then
3490+ echo "slapadd failed ($RC)!"
3491+ exit $RC
3492+fi
3493+
3494 cd $TESTDIR
3495 $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 &
3496 PID=$!
3497diff --git a/tests/scripts/test078-persistent-sessionlog b/tests/scripts/test078-persistent-sessionlog
3498index acb8fad..8f3d07f 100755
3499--- a/tests/scripts/test078-persistent-sessionlog
3500+++ b/tests/scripts/test078-persistent-sessionlog
3501@@ -185,6 +185,12 @@ olcAccessLogSuccess: TRUE
3502
3503 EOF
3504 $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1
3505+RC=$?
3506+if test $RC != 0 ; then
3507+ echo "slapadd failed ($RC)!"
3508+ exit $RC
3509+fi
3510+
3511 PORT=`eval echo '$PORT'$n`
3512 echo "Starting server $n on TCP/IP port $PORT..."
3513 cd ${XDIR}${n}
3514diff --git a/tests/scripts/test083-argon2 b/tests/scripts/test083-argon2
3515index 9700f1a..01803b3 100755
3516--- a/tests/scripts/test083-argon2
3517+++ b/tests/scripts/test083-argon2
3518@@ -97,6 +97,11 @@ EOF
3519 fi
3520
3521 $SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif
3522+RC=$?
3523+if test $RC != 0 ; then
3524+ echo "slapadd failed ($RC)!"
3525+ exit $RC
3526+fi
3527
3528 echo "Starting slapd on TCP/IP port $PORT1..."
3529 $SLAPD -F $CONFDIR -h $URI1 -d $LVL > $LOG1 2>&1 &
3530diff --git a/tests/scripts/test086-delta-consumer-config b/tests/scripts/test086-delta-consumer-config
3531index b8f08cf..d89af3f 100755
3532--- a/tests/scripts/test086-delta-consumer-config
3533+++ b/tests/scripts/test086-delta-consumer-config
3534@@ -61,6 +61,12 @@ esac
3535 echo "Starting provider slapd on TCP/IP port $PORT1..."
3536 . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF
3537 $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
3538+RC=$?
3539+if test $RC != 0 ; then
3540+ echo "slapadd failed ($RC)!"
3541+ exit $RC
3542+fi
3543+
3544 $SLAPD -F $CFPRO -h $URI1 -d $LVL > $LOG1 2>&1 &
3545 PID=$!
3546 if test $WAIT != 0 ; then
3547@@ -324,6 +330,13 @@ fi
3548
3549 echo "Starting consumer slapd on TCP/IP port $PORT2..."
3550 $SLAPADD -F $CFCON -n 0 -l $CONFLDIF
3551+RC=$?
3552+if test $RC != 0 ; then
3553+ echo "slapadd failed ($RC)!"
3554+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
3555+ exit $RC
3556+fi
3557+
3558 $SLAPD -F $CFCON -h $URI2 -d $LVL > $LOG2 2>&1 &
3559 CONSUMERPID=$!
3560 if test $WAIT != 0 ; then

Subscribers

People subscribed via source and target branches