[Midnightbsd-cvs] mports [24320] trunk/net/openldap24-server: update openldap to 2.4.45

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 13 09:28:56 EDT 2018


Revision: 24320
          http://svnweb.midnightbsd.org/mports/?rev=24320
Author:   laffer1
Date:     2018-09-13 09:28:55 -0400 (Thu, 13 Sep 2018)
Log Message:
-----------
update openldap to 2.4.45

Modified Paths:
--------------
    trunk/net/openldap24-server/Makefile
    trunk/net/openldap24-server/distinfo
    trunk/net/openldap24-server/files/pkg-message.in
    trunk/net/openldap24-server/pkg-plist
    trunk/net/openldap24-server/pkg-plist.client

Added Paths:
-----------
    trunk/net/openldap24-server/files/extrapatch-ITS6300
    trunk/net/openldap24-server/files/patch-libressl

Removed Paths:
-------------
    trunk/net/openldap24-server/files/patch-des
    trunk/net/openldap24-server/files/patch-libraries__libldap__tls_o.c

Modified: trunk/net/openldap24-server/Makefile
===================================================================
--- trunk/net/openldap24-server/Makefile	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/Makefile	2018-09-13 13:28:55 UTC (rev 24320)
@@ -1,45 +1,55 @@
 # $MidnightBSD$
 
 PORTNAME=		openldap
-DISTVERSION=		2.4.44
+DISTVERSION=		2.4.45
 PORTREVISION=		${OPENLDAP_PORTREVISION}
 CATEGORIES=		net databases
 MASTER_SITES=		ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
 			ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/ \
 			ftp://ftp.ntua.gr/mirror/OpenLDAP/%SUBDIR%/ \
-			ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/%SUBDIR%/ \
 			ftp://ftp.u-aizu.ac.jp/pub/net/openldap/%SUBDIR%/ \
 			ftp://ftp.nl.uu.net/pub/unix/db/openldap/%SUBDIR%/ \
 			ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/%SUBDIR%/ \
 			http://www.openldap.org/software/download/OpenLDAP/%SUBDIR%/
 MASTER_SITE_SUBDIR=	openldap-release
-
 .if defined(CLIENT_ONLY)
 .if ${CLIENT_ONLY} == sasl
 PKGNAMESUFFIX=		-sasl-client
-COMMENT=		Open source LDAP client implementation with SASL2 support
-CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-client-2.* \
-			${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.[0-3].*
 .else
 PKGNAMESUFFIX=		-client
-COMMENT=		Open source LDAP client implementation
-CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-client-2.[0-3].* \
-			${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.*
 .endif
 .else
 PKGNAMESUFFIX?=		-server
 .endif
-EXTRACT_SUFX=		.tgz
 
 MAINTAINER=		ports at MidnightBSD.org
-COMMENT?=		Open source LDAP server implementation
+.if defined(CLIENT_ONLY)
+.if ${CLIENT_ONLY} == sasl
+COMMENT=		Open source LDAP client implementation with SASL2 support
+.else
+COMMENT=		Open source LDAP client implementation
+.endif
+.else
+COMMENT=		Open source LDAP server implementation
+.endif
 
 LICENSE=		openldap2.8
+LICENSE_FILE=		${WRKSRC}/LICENSE
 
+.if defined(CLIENT_ONLY)
+.if ${CLIENT_ONLY} == sasl
+CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-client-2.* \
+			${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.[0-3].*
+.else
+CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-client-2.[0-3].* \
+			${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.*
+.endif
+.endif
+
 GNU_CONFIGURE=		yes
-CONFIGURE_TARGET=	${ARCH}-portbld-freebsd10.4
+#CONFIGURE_TARGET=	${ARCH}-portbld-freebsd10.4
 # :keepla because port uses lt_dlopen
-USES=			cpe groff:build libtool:keepla ssl
+USES=			cpe groff:build libtool:keepla ssl tar:tgz
 .if !defined(CLIENT_ONLY)
 USERS=			ldap
 GROUPS=			ldap
@@ -53,9 +63,9 @@
 .endif
 
 PORTREVISION_CLIENT=	0
-PORTREVISION_SERVER=	0
+PORTREVISION_SERVER=	4
 OPENLDAP_SHLIB_MAJOR=	2
-OPENLDAP_SHLIB_MINOR=	10.7
+OPENLDAP_SHLIB_MINOR=	10.8
 OPENLDAP_MAJOR=		${DISTVERSION:R}
 
 OPTIONS_DEFINE=		DEBUG FETCH GSSAPI
@@ -72,6 +82,8 @@
 OPTIONS_DEFINE+=	UNIQUE VALSORT SMBPWD SHA2 DYNAMIC_BACKENDS SASL
 OPTIONS_DEFINE+=	LMPASSWD
 OPTIONS_DEFINE+=	OUTLOOK
+OPTIONS_DEFINE+=	LASTBIND
+OPTIONS_DEFINE+=	KQUEUE
 
 OPTIONS_DEFAULT=	MDB SYNCPROV DYNAMIC_BACKENDS
 
@@ -116,6 +128,8 @@
 LMPASSWD_DESC=		With LM hash password support (DEPRECATED)
 DYNAMIC_BACKENDS_DESC=	Build dynamic backends
 OUTLOOK_DESC=		Force caseIgnoreOrderingMatch on name attribute (experimental)
+LASTBIND_DESC=		With lastbind overlay
+KQUEUE_DESC=		With kqueue support (experimental)
 .endif
 
 .if defined(CLIENT_ONLY)
@@ -137,12 +151,14 @@
 PORT_OPTIONS+=	SASL
 .endif
 .if defined(USE_OPENLDAP)
-BROKEN=			You have 'USE_OPENLDAP' variable defined either in environment or in make(1) arguments. Please undefine and try again.
+BROKEN=			you have USE_OPENLDAP variable defined either in environment or in make(1) arguments; please undefine and try again
 .endif
 .else
 USE_OPENLDAP=		yes
 WANT_OPENLDAP_VER=	24
 
+LIB_DEPENDS+=		libicudata.so:devel/icu
+
 .if ${PORT_OPTIONS:MGSSAPI} && empty(PORT_OPTIONS:MSASL)
 PORT_OPTIONS+=	SASL
 .endif
@@ -152,7 +168,7 @@
 CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-client-2.*
 PKGNAMESUFFIX=		-sasl-server
 .if ${PORT_OPTIONS:MGSSAPI}
-RUN_DEPENDS+=		cyrus-sasl-gssapi>0:${PORTSDIR}/security/cyrus-sasl2-gssapi
+RUN_DEPENDS+=		cyrus-sasl-gssapi>0:security/cyrus-sasl2-gssapi
 .endif
 .else
 CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.*
@@ -182,24 +198,12 @@
 			--disable-dependency-tracking \
 			--enable-dynamic
 
-# XXX FreeBSD does not implement O_DSYNC and fdatasync at this time.
+.if ${OSVERSION} < 1101000
 CFLAGS+=		-DMDB_DSYNC=O_SYNC -Dfdatasync=fsync
-
-.if ${PORT_OPTIONS:MDEBUG}
-CONFIGURE_ARGS+=	--enable-debug=yes
-.else
-CONFIGURE_ARGS+=	--disable-debug
-CFLAGS+=		-DNDEBUG
 .endif
 
-MAKE_ENV+=		STRIP=${STRIP}
-
-.if !${PORT_OPTIONS:MFETCH}
-CONFIGURE_ARGS+=	--without-fetch
-.endif
-
 .if ${PORT_OPTIONS:MSASL}
-LIB_DEPENDS+=		libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
+LIB_DEPENDS+=		libsasl2.so:security/cyrus-sasl2
 CONFIGURE_ARGS+=	--with-cyrus-sasl
 .else
 CONFIGURE_ARGS+=	--without-cyrus-sasl
@@ -227,8 +231,8 @@
 
 EXTRA_PATCHES+=		${FILESDIR}/extrapatch-Makefile.in
 
-.if ${PORT_OPTIONS:MMODULES} || ${PORT_OPTIONS:MDYNAMIC_BACKENDS} || ${PORT_OPTIONS:MSLAPI}
-LIB_DEPENDS+=		libltdl.so:${PORTSDIR}/devel/libltdl
+.if ${PORT_OPTIONS:MDYNAMIC_BACKENDS} || ${PORT_OPTIONS:MSLAPI}
+LIB_DEPENDS+=		libltdl.so:devel/libltdl
 CONFIGURE_ARGS+=	--enable-modules
 PLIST_SUB+=		MODULES=""
 .else
@@ -279,6 +283,12 @@
 CONFIGURE_ARGS+=	--enable-dds=${OVERLAY_ENABLE}
 .endif
 
+.if ${PORT_OPTIONS:MDEBUG}
+CONFIGURE_ARGS+=	--enable-debug=yes
+.endif
+
+MAKE_ENV+=		STRIP=${STRIP}
+
 .if ${PORT_OPTIONS:MDEREF}
 CONFIGURE_ARGS+=	--enable-deref=${OVERLAY_ENABLE}
 .endif
@@ -355,6 +365,10 @@
 CONFIGURE_ARGS+=	--enable-dynacl
 .endif
 
+.if ${PORT_OPTIONS:MLASTBIND}
+CONFIGURE_ARGS+=	--enable-lastbind
+.endif
+
 .if !${PORT_OPTIONS:MBDB}
 CONFIGURE_ARGS+=	--disable-bdb \
 			--disable-hdb
@@ -435,7 +449,7 @@
 .if ${PORT_OPTIONS:MODBC}
 CONFIGURE_ARGS+=	--enable-sql=${BACKEND_ENABLE}
 PLIST_SUB+=		BACK_SQL=${BACKEND_PLIST}
-LIB_DEPENDS+=		libodbc.so:${PORTSDIR}/databases/unixODBC
+LIB_DEPENDS+=		libodbc.so:databases/unixODBC
 LDFLAGS+=		-L${LOCALBASE}/lib
 .else
 PLIST_SUB+=		BACK_SQL="@comment "
@@ -453,6 +467,12 @@
 PLIST_SUB+=		SHA2="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MLASTBIND}
+PLIST_SUB+=		LASTBIND=""
+.else
+PLIST_SUB+=		LASTBIND="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MRLOOKUPS}
 CONFIGURE_ARGS+=	--enable-rlookups
 PLIST_SUB+=		RLOOKUPS=""
@@ -470,7 +490,7 @@
 
 .if ${PORT_OPTIONS:MSLP}
 CONFIGURE_ARGS+=	--enable-slp
-LIB_DEPENDS+=		libslp.so:${PORTSDIR}/net/openslp
+LIB_DEPENDS+=		libslp.so:net/openslp
 .endif
 
 # Include tcp-wrapper support
@@ -485,6 +505,11 @@
 EXTRA_PATCHES+=		${FILESDIR}/extrapatch-outlook-servers__slapd__schema_prep.c
 .endif
 
+.if ${PORT_OPTIONS:MKQUEUE}
+BUILD_DEPENDS+=		autoconf>0:devel/autoconf
+EXTRA_PATCHES+=		${FILESDIR}/extrapatch-ITS6300
+.endif
+
 # end of client/server specific configuration
 .endif
 
@@ -507,6 +532,16 @@
 PLIST_SUB+=		SHLIB_MINOR=${OPENLDAP_SHLIB_MINOR}
 PLIST_SUB+=		OPENLDAP_MAJOR=${OPENLDAP_MAJOR}
 
+.include <bsd.port.pre.mk>
+
+.if !${PORT_OPTIONS:MFETCH}
+CONFIGURE_ARGS+=	--without-fetch
+.else
+. if defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != "" || ${SSL_DEFAULT} != base
+BROKEN=	using OpenSSL from ports and OPTION FETCH together is not supported
+. endif
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|%LOCALSTATEDIR%/run/|${LDAP_RUN_DIR}/|g' \
 		${SED_MODULES} ${WRKSRC}/servers/slapd/slapd.conf
@@ -519,6 +554,15 @@
 		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 .endif
 
+pre-configure:
+	@if [ -n "`${PKG_INFO} -xI '^bind\(84\)\{0,1\}-base-8\.' 2>/dev/null`" ]; then \
+		${ECHO_CMD} "${PKGNAME}: bind installed with PORT_REPLACES_BASE_BIND causes build problems."; \
+		${FALSE}; \
+	fi
+.if ${PORT_OPTIONS:MKQUEUE}
+	@(cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf)
+.endif
+
 .if !defined(CLIENT_ONLY)
 test: build
 	@(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} \
@@ -536,7 +580,12 @@
 		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
 		${MAKE_ARGS} prefix="${PREFIX}" all)
 .endif
+.if ${PORT_OPTIONS:MLASTBIND}
+	@(cd ${BUILD_WRKSRC}/contrib/slapd-modules/lastbind && \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
+		${MAKE_ARGS} prefix="${PREFIX}" all)
 .endif
+.endif
 
 pre-install:
 .if !defined(CLIENT_ONLY)
@@ -551,12 +600,12 @@
 		${MKDIR} ${DOCSDIR}/$${dir}; \
 		${INSTALL_DATA} ${WRKSRC}/doc/$${dir}/* ${DOCSDIR}/$${dir}; \
 	done
-	@for prog in ldapcompare ldapdelete ldapexop ldapmodify ldapmodrdn ldappasswd ldapsearch ldapurl ldapwhoami; do\
-		${STRIP_CMD} ${PREFIX}/bin/$${prog}; \
+	for prog in ldapcompare ldapdelete ldapexop ldapmodify ldapmodrdn ldappasswd ldapsearch ldapurl ldapwhoami; do\
+		${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/$${prog}; \
 	done
 
-	@for library in lber ldap ldap_r; do \
-		${STRIP_CMD} ${PREFIX}/lib/lib$${library}-${OPENLDAP_MAJOR}.so.${OPENLDAP_SHLIB_MAJOR}; \
+	for library in lber ldap ldap_r; do \
+		${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib$${library}-${OPENLDAP_MAJOR}.so.${OPENLDAP_SHLIB_MAJOR}; \
 	done
 .else
 	@${MKDIR} ${FAKE_DESTDIR}${LDAP_RUN_DIR}
@@ -570,11 +619,20 @@
 	@(cd ${WRKSRC}/contrib/slapd-modules/passwd/sha2 && \
 		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
 		${MAKE_ARGS} prefix="${PREFIX}" install)
-	${RM} ${PREFIX}/libexec/openldap/pw-sha2.a
+	${RM} ${STAGEDIR}${PREFIX}/libexec/openldap/pw-sha2.a
 .endif
+.if ${PORT_OPTIONS:MLASTBIND}
+	(cd ${WRKSRC}/contrib/slapd-modules/lastbind && \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
+		${MAKE_ARGS} prefix="${PREFIX}" install)
+	${RM} ${STAGEDIR}${PREFIX}/libexec/openldap/lastbind.a
+.endif
 .if ${PORT_OPTIONS:MDYNAMIC_BACKENDS} || ${PORT_OPTIONS:MSMBPWD} || ${PORT_OPTIONS:MSHA2}
-	@${STRIP_CMD} ${PREFIX}/libexec/openldap/*.so
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/openldap/*.so
 .endif
+.if ${PORT_OPTIONS:MDYNAMIC_BACKENDS} || ${PORT_OPTIONS:MSLAPI}
+	${MKDIR} ${STAGEDIR}${PREFIX}/libexec/openldap
+.endif
 .endif # defined(CLIENT_ONLY)
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: trunk/net/openldap24-server/distinfo
===================================================================
--- trunk/net/openldap24-server/distinfo	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/distinfo	2018-09-13 13:28:55 UTC (rev 24320)
@@ -1,2 +1,3 @@
-SHA256 (openldap-2.4.44.tgz) = d7de6bf3c67009c95525dde3a0212cc110d0a70b92af2af8e3ee800e81b88400
-SIZE (openldap-2.4.44.tgz) = 5658830
+TIMESTAMP = 1496558623
+SHA256 (openldap-2.4.45.tgz) = cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824
+SIZE (openldap-2.4.45.tgz) = 5672845

Added: trunk/net/openldap24-server/files/extrapatch-ITS6300
===================================================================
--- trunk/net/openldap24-server/files/extrapatch-ITS6300	                        (rev 0)
+++ trunk/net/openldap24-server/files/extrapatch-ITS6300	2018-09-13 13:28:55 UTC (rev 24320)
@@ -0,0 +1,434 @@
+--- configure.in.orig	2017-06-01 20:01:07 UTC
++++ configure.in
+@@ -978,6 +978,18 @@ if test "${ac_cv_header_sys_epoll_h}" = yes; then
+ fi
+ 
+ dnl ----------------------------------------------------------------
++AC_CHECK_HEADERS( sys/event.h )
++if test "${ac_cv_header_sys_event_h}" = yes; then
++AC_MSG_CHECKING(for kqueue system call)
++AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
++{
++	int kqfd = kqueue();
++	exit (kqfd == -1 ? 1 : 0);
++}]])],[AC_MSG_RESULT(yes)
++AC_DEFINE(HAVE_KQUEUE,1, [define if your system supports kqueue])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
++fi
++
++dnl ----------------------------------------------------------------
+ AC_CHECK_HEADERS( sys/devpoll.h )
+ dnl "/dev/poll" needs <sys/poll.h> as well...
+ if test "${ac_cv_header_sys_devpoll_h}" = yes \
+--- include/portable.hin.orig	2017-06-01 20:01:07 UTC
++++ include/portable.hin
+@@ -280,6 +280,9 @@
+ /* Define to 1 if you have the <io.h> header file. */
+ #undef HAVE_IO_H
+ 
++/* define if your system supports kqueue */
++#undef HAVE_KQUEUE
++
+ /* Define to 1 if you have the `gen' library (-lgen). */
+ #undef HAVE_LIBGEN
+ 
+@@ -664,6 +667,9 @@
+ 
+ /* Define to 1 if you have the <sys/errno.h> header file. */
+ #undef HAVE_SYS_ERRNO_H
++
++/* Define to 1 if you have the <sys/event.h> header file. */
++#undef HAVE_SYS_EVENT_H
+ 
+ /* Define to 1 if you have the <sys/file.h> header file. */
+ #undef HAVE_SYS_FILE_H
+--- servers/slapd/daemon.c.orig	2017-06-01 20:01:07 UTC
++++ servers/slapd/daemon.c
+@@ -41,14 +41,18 @@
+ 
+ #include "ldap_rq.h"
+ 
+-#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL)
++#ifdef HAVE_KQUEUE
++# include <sys/types.h>
++# include <sys/event.h>
++# include <sys/time.h>
++#elif defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL)
+ # include <sys/epoll.h>
+ #elif defined(SLAP_X_DEVPOLL) && defined(HAVE_SYS_DEVPOLL_H) && defined(HAVE_DEVPOLL)
+ # include <sys/types.h>
+ # include <sys/stat.h>
+ # include <fcntl.h>
+ # include <sys/devpoll.h>
+-#endif /* ! epoll && ! /dev/poll */
++#endif /* ! kqueue && ! epoll && ! /dev/poll */
+ 
+ #ifdef HAVE_TCPD
+ int allow_severity = LOG_INFO;
+@@ -89,7 +93,7 @@ static volatile sig_atomic_t listening = 1; /* 0 when 
+ static ldap_pvt_thread_t *listener_tid;
+ 
+ #ifndef SLAPD_LISTEN_BACKLOG
+-#define SLAPD_LISTEN_BACKLOG 1024
++#define SLAPD_LISTEN_BACKLOG 2048
+ #endif /* ! SLAPD_LISTEN_BACKLOG */
+ 
+ #define	DAEMON_ID(fd)	(fd & slapd_daemon_mask)
+@@ -138,7 +142,21 @@ typedef struct slap_daemon_st {
+ 	int			sd_nwriters;
+ 	int			sd_nfds;
+ 
+-#if defined(HAVE_EPOLL)
++#if defined(HAVE_KQUEUE)
++	uint8_t*        sd_fdmodes; /* indexed by fd */
++	Listener**      sd_l;       /* indexed by fd */
++	/* Double buffer the kqueue changes to avoid holding the sd_mutex \
++	 * during a kevent() call. \
++	 */
++	struct kq_change {
++	    struct kevent*  sd_changes;
++	    int             sd_nchanges;
++	    int             sd_maxchanges;
++	}               sd_kqc[2];
++	int             sd_changeidx; /* index to current change buffer */
++	int             sd_kq;
++#elif defined(HAVE_EPOLL)
++
+ 	struct epoll_event	*sd_epolls;
+ 	int			*sd_index;
+ 	int			sd_epfd;
+@@ -148,7 +166,7 @@ typedef struct slap_daemon_st {
+ 	int			*sd_index;
+ 	Listener		**sd_l;
+ 	int			sd_dpfd;
+-#else /* ! epoll && ! /dev/poll */
++#else /* ! kqueue && ! epoll && ! /dev/poll */
+ #ifdef HAVE_WINSOCK
+ 	char	*sd_flags;
+ 	char	*sd_rflags;
+@@ -157,7 +175,7 @@ typedef struct slap_daemon_st {
+ 	fd_set			sd_readers;
+ 	fd_set			sd_writers;
+ #endif /* ! HAVE_WINSOCK */
+-#endif /* ! epoll && ! /dev/poll */
++#endif /* ! kqueue && ! epoll && ! /dev/poll */
+ } slap_daemon_st;
+ 
+ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS];
+@@ -169,11 +187,220 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THR
+  *   with file descriptors and events respectively
+  *
+  * - SLAP_<type>_* for private interface; type by now is one of
+- *   EPOLL, DEVPOLL, SELECT
++ *   EPOLL, DEVPOLL, SELECT, KQUEUE
+  *
+  * private interface should not be used in the code.
+  */
+-#if defined(HAVE_EPOLL)
++#ifdef HAVE_KQUEUE
++# define SLAP_EVENT_FNAME		    "kqueue"
++# define SLAP_EVENTS_ARE_INDEXED	0
++# define SLAP_EVENT_MAX(t)             (2 * dtblsize)  /* each fd can have a read & a write event */
++
++# define SLAP_EVENT_DECL \
++     static struct kevent* events = NULL
++
++# define SLAP_EVENT_INIT(t) do {\
++    if (!events) { \
++        events = ch_malloc(sizeof(*events) * SLAP_EVENT_MAX(t)); \
++        if (!events) { \
++            Debug(LDAP_DEBUG_ANY, \
++                "daemon: SLAP_EVENT_INIT: ch_malloc of events failed, wanted %d bytes\n", \
++                sizeof(*events) * SLAP_EVENT_MAX(t), 0, 0); \
++                slapd_shutdown = 2; \
++        } \
++    } \
++} while (0)
++
++# define SLAP_SOCK_INIT(t) do { \
++    int kq_i; \
++    size_t kq_nbytes; \
++    Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: dtblsize=%d\n", dtblsize, 0, 0); \
++    slap_daemon[t].sd_nfds       = 0; \
++    slap_daemon[t].sd_changeidx  = 0; \
++    for (kq_i = 0;  kq_i < 2;  kq_i++) { \
++        struct kq_change* kqc = &slap_daemon[t].sd_kqc[kq_i]; \
++        kqc->sd_nchanges   = 0; \
++        kqc->sd_maxchanges = 256; /* will grow as needed */ \
++        kq_nbytes = sizeof(*kqc->sd_changes) * kqc->sd_maxchanges; \
++        kqc->sd_changes = ch_calloc(1, kq_nbytes); \
++        if (!kqc->sd_changes) { \
++            Debug(LDAP_DEBUG_ANY, \
++                  "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_changes[%d] failed, wanted %d bytes, shutting down\n", \
++                  kq_i, kq_nbytes, 0); \
++                  slapd_shutdown = 2; \
++        } \
++    } \
++    kq_nbytes = sizeof(*slap_daemon[t].sd_fdmodes) * dtblsize; \
++    slap_daemon[t].sd_fdmodes = ch_calloc(1, kq_nbytes); \
++    if (!slap_daemon[t].sd_fdmodes) { \
++        Debug(LDAP_DEBUG_ANY, \
++            "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_fdmodes failed, wanted %d bytes, shutting down\n", \
++            kq_nbytes, 0, 0); \
++        slapd_shutdown = 2; \
++    } \
++    kq_nbytes = sizeof(*slap_daemon[t].sd_l) * dtblsize; \
++    slap_daemon[t].sd_l = ch_calloc(1, kq_nbytes); \
++    if (!slap_daemon[t].sd_l) { \
++        Debug(LDAP_DEBUG_ANY, \
++            "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_l failed, wanted %d bytes, shutting down\n", \
++            kq_nbytes, 0, 0); \
++        slapd_shutdown = 2; \
++    } \
++    slap_daemon[t].sd_kq = kqueue(); \
++    if (slap_daemon[t].sd_kq < 0) { \
++        Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: kqueue() failed, errno=%d, shutting down\n", errno, 0, 0); \
++        slapd_shutdown = 2; \
++    } \
++} while (0)
++
++# define SLAP_SOCK_DESTROY(t) do { \
++	int kq_i; \
++    if (slap_daemon[t].sd_kq > 0) { \
++        close(slap_daemon[t].sd_kq); \
++        slap_daemon[t].sd_kq = -1; \
++    } \
++    for (kq_i = 0;  kq_i < 2;  kq_i++) { \
++        if (slap_daemon[t].sd_kqc[kq_i].sd_changes != NULL) { \
++            ch_free(slap_daemon[t].sd_kqc[kq_i].sd_changes); \
++            slap_daemon[t].sd_kqc[kq_i].sd_changes = NULL; \
++        } \
++        slap_daemon[t].sd_kqc[kq_i].sd_nchanges = 0; \
++        slap_daemon[t].sd_kqc[kq_i].sd_maxchanges = 0; \
++    } \
++    if (slap_daemon[t].sd_l != NULL) { \
++        ch_free(slap_daemon[t].sd_l); \
++        slap_daemon[t].sd_l = NULL; \
++    } \
++    if (slap_daemon[t].sd_fdmodes != NULL) { \
++        ch_free(slap_daemon[t].sd_fdmodes); \
++        slap_daemon[t].sd_fdmodes = NULL; \
++    } \
++    slap_daemon[t].sd_nfds = 0; \
++} while (0)
++
++# define SLAP_KQUEUE_SOCK_ACTIVE        0x01
++# define SLAP_KQUEUE_SOCK_READ_ENABLED  0x02
++# define SLAP_KQUEUE_SOCK_WRITE_ENABLED 0x04
++
++# define SLAP_SOCK_IS_ACTIVE(t,s)  (slap_daemon[t].sd_fdmodes[(s)] != 0)
++# define SLAP_SOCK_NOT_ACTIVE(t,s) (slap_daemon[t].sd_fdmodes[(s)] == 0)
++# define SLAP_SOCK_IS_READ(t,s)    (slap_daemon[t].sd_fdmodes[(s)] & SLAP_KQUEUE_SOCK_READ_ENABLED)
++# define SLAP_SOCK_IS_WRITE(t,s)   (slap_daemon[t].sd_fdmodes[(s)] & SLAP_KQUEUE_SOCK_WRITE_ENABLED)
++
++/*
++ * SLAP_SOCK_SET_* & SLAP_SOCK_CLR_* get called a _lot_.  Since kevent()
++ * processes changes before it looks for events, batch up the changes which
++ * will get submitted the next time kevent() is called for events.
++ */
++
++# define SLAP_KQUEUE_CHANGE(t, s, filter, flag) do { \
++    /* If maxchanges is reached, have to realloc to make room for more. \
++     * Ideally we'd call kevent(), but the daemon thread could be sitting \
++     * in kevent() waiting for events. \
++     */ \
++    struct kq_change* kqc = &slap_daemon[t].sd_kqc[slap_daemon[t].sd_changeidx]; \
++    if (kqc->sd_nchanges == kqc->sd_maxchanges) { \
++        /* Don't want to do this very often.  Double the size. */ \
++        size_t kq_nbytes; \
++        Debug(LDAP_DEBUG_CONNS, \
++              "daemon: SLAP_KQUEUE_CHANGE: increasing slap_daemon.sd_kqc[%d].maxchanges from %d to %d\n", \
++              slap_daemon[t].sd_changeidx, kqc->sd_maxchanges, 2*kqc->sd_maxchanges); \
++        kqc->sd_maxchanges += kqc->sd_maxchanges; \
++        kq_nbytes = sizeof(*kqc->sd_changes) * kqc->sd_maxchanges; \
++        kqc->sd_changes = ch_realloc(kqc->sd_changes, kq_nbytes); \
++        if (!kqc->sd_changes) { \
++            Debug(LDAP_DEBUG_ANY, \
++                "daemon: SLAP_KQUEUE_CHANGE: ch_realloc of slap_daemon.sd_kqc[%d].sd_changes failed, wanted %d bytes, shutting down\n", \
++                slap_daemon[t].sd_changeidx, kq_nbytes, 0); \
++            slapd_shutdown = 2; \
++            break; /* Don't want to do the EV_SET if sd_changes is NULL */ \
++        } \
++    } \
++    EV_SET(&kqc->sd_changes[kqc->sd_nchanges++], \
++           (s), (filter), (flag), 0, 0, slap_daemon[t].sd_l[(s)]); \
++} while (0)
++
++# define SLAP_KQUEUE_SOCK_SET(t, s, filter, mode) do { \
++    if ((slap_daemon[t].sd_fdmodes[(s)] & (mode)) != (mode)) { \
++        slap_daemon[t].sd_fdmodes[(s)] |= (mode); \
++        SLAP_KQUEUE_CHANGE(t, (s), (filter), EV_ENABLE); \
++    } \
++} while (0)
++
++# define SLAP_KQUEUE_SOCK_CLR(t, s, filter, mode) do { \
++    if (slap_daemon[t].sd_fdmodes[(s)] & (mode)) { \
++        slap_daemon[t].sd_fdmodes[(s)] &= ~(mode); \
++        SLAP_KQUEUE_CHANGE(t, (s), (filter), EV_DISABLE); \
++    } \
++} while (0)
++
++# define SLAP_SOCK_SET_READ(t, s)  SLAP_KQUEUE_SOCK_SET(t, (s), EVFILT_READ,  SLAP_KQUEUE_SOCK_READ_ENABLED)
++# define SLAP_SOCK_SET_WRITE(t, s) SLAP_KQUEUE_SOCK_SET(t, (s), EVFILT_WRITE, SLAP_KQUEUE_SOCK_WRITE_ENABLED)
++# define SLAP_SOCK_CLR_READ(t, s)  SLAP_KQUEUE_SOCK_CLR(t, (s), EVFILT_READ,  SLAP_KQUEUE_SOCK_READ_ENABLED)
++# define SLAP_SOCK_CLR_WRITE(t, s) SLAP_KQUEUE_SOCK_CLR(t, (s), EVFILT_WRITE, SLAP_KQUEUE_SOCK_WRITE_ENABLED)
++
++/* kqueue doesn't need to do anything to clear the event. */
++# define SLAP_EVENT_CLR_READ(i)     do {} while (0)
++# define SLAP_EVENT_CLR_WRITE(i)    do {} while (0)
++
++# define SLAP_SOCK_ADD(t, s, l) do { \
++    assert( s < dtblsize ); \
++    slap_daemon[t].sd_l[(s)] = (l); \
++    slap_daemon[t].sd_fdmodes[(s)] = SLAP_KQUEUE_SOCK_ACTIVE | SLAP_KQUEUE_SOCK_READ_ENABLED; \
++    ++slap_daemon[t].sd_nfds; \
++    SLAP_KQUEUE_CHANGE(t, (s), EVFILT_READ, EV_ADD); \
++    SLAP_KQUEUE_CHANGE(t, (s), EVFILT_WRITE, EV_ADD | EV_DISABLE); \
++} while (0)
++
++# define SLAP_SOCK_DEL(t, s) do { \
++    SLAP_KQUEUE_CHANGE(t, (s), EVFILT_READ, EV_DELETE); \
++    SLAP_KQUEUE_CHANGE(t, (s), EVFILT_WRITE, EV_DELETE); \
++    slap_daemon[t].sd_l[(s)] = NULL; \
++    slap_daemon[t].sd_fdmodes[(s)] = 0; \
++    --slap_daemon[t].sd_nfds; \
++} while (0)
++
++# define SLAP_EVENT_FD(t, i)          (events[(i)].ident)
++
++# define SLAP_EVENT_IS_READ(t, i) \
++    (events[(i)].filter == EVFILT_READ && SLAP_SOCK_IS_READ(t, SLAP_EVENT_FD(0, i)))
++
++# define SLAP_EVENT_IS_WRITE(t, i) \
++    (events[(i)].filter == EVFILT_WRITE && SLAP_SOCK_IS_WRITE(t, SLAP_EVENT_FD(0, i)))
++
++# define SLAP_EVENT_IS_LISTENER(t, i) \
++    (events[(i)].udata && SLAP_SOCK_IS_READ(t, SLAP_EVENT_FD(t, i)))
++
++# define SLAP_EVENT_LISTENER(t, i)    ((Listener*)(events[(i)].udata))
++
++# define SLAP_EVENT_WAIT(t, tvp, nsp) do { \
++    struct timespec  kq_ts; \
++    struct timespec* kq_tsp; \
++    int kq_idx; \
++    if (tvp) { \
++        TIMEVAL_TO_TIMESPEC((tvp), &kq_ts); \
++        kq_tsp = &kq_ts; \
++    } else { \
++        kq_tsp = NULL; \
++    } \
++    /* Save the change buffer index for use when the mutex is unlocked, \
++     * then switch the index so new changes go to the other buffer. \
++     */ \
++    ldap_pvt_thread_mutex_lock( &slap_daemon[t].sd_mutex ); \
++    kq_idx = slap_daemon[t].sd_changeidx; \
++    slap_daemon[t].sd_changeidx ^= 1; \
++    ldap_pvt_thread_mutex_unlock( &slap_daemon[t].sd_mutex ); \
++    *(nsp) = kevent(slap_daemon[t].sd_kq, \
++                    slap_daemon[t].sd_kqc[kq_idx].sd_nchanges \
++                        ? slap_daemon[t].sd_kqc[kq_idx].sd_changes : NULL, \
++                    slap_daemon[t].sd_kqc[kq_idx].sd_nchanges, \
++                    events, SLAP_EVENT_MAX(t), kq_tsp); \
++    slap_daemon[t].sd_kqc[kq_idx].sd_nchanges = 0; \
++} while(0)
++
++/*-------------------------------------------------------------------------------*/
++
++#elif defined(HAVE_EPOLL)
+ /***************************************
+  * Use epoll infrastructure - epoll(4) *
+  ***************************************/
+@@ -486,7 +713,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THR
+ 	*(nsp) = ioctl( slap_daemon[t].sd_dpfd, DP_POLL, &sd_dvpoll ); \
+ } while (0)
+ 
+-#else /* ! epoll && ! /dev/poll */
++#else /* ! kqueue && ! epoll && ! /dev/poll */
+ # ifdef HAVE_WINSOCK
+ # define SLAP_EVENT_FNAME		"WSselect"
+ /* Winsock provides a "select" function but its fd_sets are
+@@ -674,7 +901,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THR
+ 		nwriters > 0 ? &writefds : NULL, NULL, (tvp) ); \
+ } while (0)
+ # endif /* !HAVE_WINSOCK */
+-#endif /* ! epoll && ! /dev/poll */
++#endif /* ! kqueue && ! epoll && ! /dev/poll */
+ 
+ #ifdef HAVE_SLP
+ /*
+@@ -2733,8 +2960,13 @@ loop:
+ 			/* Don't log internal wake events */
+ 			if ( fd == wake_sds[tid][0] ) continue;
+ 
++#ifdef HAVE_KQUEUE
++			r = SLAP_EVENT_IS_READ( tid, i );
++			w = SLAP_EVENT_IS_WRITE( tid, i );
++#else
+ 			r = SLAP_EVENT_IS_READ( i );
+ 			w = SLAP_EVENT_IS_WRITE( i );
++#endif /* HAVE_KQUEUE */
+ 			if ( r || w ) {
+ 				Debug( LDAP_DEBUG_CONNS, " %d%s%s", fd,
+ 				    r ? "r" : "", w ? "w" : "" );
+@@ -2765,7 +2997,11 @@ loop:
+ 					continue;
+ 				}
+ 
++#ifdef HAVE_KQUEUE
++				if ( SLAP_EVENT_IS_WRITE( tid, i ) ) {
++#else
+ 				if ( SLAP_EVENT_IS_WRITE( i ) ) {
++#endif  /* HAVE_KQUEUE */
+ 					Debug( LDAP_DEBUG_CONNS,
+ 						"daemon: write active on %d\n",
+ 						fd, 0, 0 );
+@@ -2784,7 +3020,11 @@ loop:
+ 					}
+ 				}
+ 				/* If event is a read */
++#ifdef HAVE_KQUEUE
++				if ( SLAP_EVENT_IS_READ( tid, i )) {
++#else
+ 				if ( SLAP_EVENT_IS_READ( i )) {
++#endif /* HAVE_KQUEUE */
+ 					r = 1;
+ 					Debug( LDAP_DEBUG_CONNS,
+ 						"daemon: read active on %d\n",
+@@ -2841,6 +3081,10 @@ loop:
+ 		slapd_abrupt_shutdown = 1;
+ 		connections_shutdown();
+ 	}
++
++#ifdef HAVE_KQUEUE
++     close( slap_daemon[tid].sd_kq );
++#endif
+ 
+ 	if ( LogTest( LDAP_DEBUG_ANY )) {
+ 		int t = ldap_pvt_thread_pool_backload( &connection_pool );
+--- libraries/liblutil/detach.c.orig	2017-06-01 20:01:07 UTC
++++ libraries/liblutil/detach.c
+@@ -73,7 +73,7 @@ lutil_detach( int debug, int do_close )
+ #ifdef HAVE_THR
+ 			pid = fork1();
+ #else
+-			pid = fork();
++			pid = rfork(RFPROC);
+ #endif
+ 			switch ( pid )
+ 			{
+--- servers/slapd/main.c.orig	2017-06-01 20:01:07 UTC
++++ servers/slapd/main.c
+@@ -923,12 +923,11 @@ unhandled_option:;
+ 		if ( pid ) {
+ 			char buf[4];
+ 			rc = EXIT_SUCCESS;
+-			close( waitfds[1] );
+ 			if ( read( waitfds[0], buf, 1 ) != 1 )
+ 				rc = EXIT_FAILURE;
+-			_exit( rc );
+-		} else {
++			close( waitfds[1] );
+ 			close( waitfds[0] );
++			_exit( rc );
+ 		}
+ 	}
+ #endif /* HAVE_WINSOCK */


Property changes on: trunk/net/openldap24-server/files/extrapatch-ITS6300
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/net/openldap24-server/files/patch-des
===================================================================
--- trunk/net/openldap24-server/files/patch-des	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/files/patch-des	2018-09-13 13:28:55 UTC (rev 24320)
@@ -1,204 +0,0 @@
---- libraries/liblutil/passwd.c.orig	2014-09-19 03:48:49.000000000 +0200
-+++ libraries/liblutil/passwd.c	2014-11-05 19:57:10.807555025 +0100
-@@ -38,11 +38,11 @@
- #	include <openssl/des.h>
- 
- 
--typedef des_cblock des_key;
--typedef des_cblock des_data_block;
--typedef des_key_schedule des_context;
--#define des_failed(encrypted) 0
--#define des_finish(key, schedule) 
-+typedef DES_cblock DES_key;
-+typedef DES_cblock DES_data_block;
-+typedef DES_key_schedule DES_context;
-+#define DES_failed(encrypted) 0
-+#define DES_finish(key, schedule) 
- 
- #elif defined(HAVE_MOZNSS)
- /*
-@@ -53,9 +53,9 @@
- */
- #define PROTYPES_H 1
- #	include <nss/pk11pub.h>
--typedef PK11SymKey *des_key;
--typedef unsigned char des_data_block[8];
--typedef PK11Context *des_context[1];
-+typedef PK11SymKey *DES_key;
-+typedef unsigned char DES_data_block[8];
-+typedef PK11Context *DES_context[1];
- #define DES_ENCRYPT CKA_ENCRYPT
- 
- #endif
-@@ -664,10 +664,10 @@
-  * abstract away setting the parity.
-  */
- static void
--des_set_key_and_parity( des_key *key, unsigned char *keyData)
-+DES_set_key_and_parity( DES_key *key, unsigned char *keyData)
- {
-     memcpy(key, keyData, 8);
--    des_set_odd_parity( key );
-+    DES_set_odd_parity( key );
- }
- 
- 
-@@ -677,7 +677,7 @@
-  * implement MozNSS wrappers for the openSSL calls 
-  */
- static void
--des_set_key_and_parity( des_key *key, unsigned char *keyData)
-+DES_set_key_and_parity( DES_key *key, unsigned char *keyData)
- {
-     SECItem keyDataItem;
-     PK11SlotInfo *slot;
-@@ -699,7 +699,7 @@
- }
- 
- static void
--des_set_key_unchecked( des_key *key, des_context ctxt )
-+DES_set_key_unchecked( DES_key *key, DES_context ctxt )
- {
-     ctxt[0] = NULL;
- 
-@@ -712,37 +712,37 @@
- }
- 
- static void
--des_ecb_encrypt( des_data_block *plain, des_data_block *encrypted, 
--			des_context ctxt, int op)
-+DES_ecb_encrypt( DES_data_block *plain, DES_data_block *encrypted, 
-+			DES_context ctxt, int op)
- {
-     SECStatus rv;
-     int size;
- 
-     if (ctxt[0] == NULL) {
- 	/* need to fail here...  */
--	memset(encrypted, 0, sizeof(des_data_block));
-+	memset(encrypted, 0, sizeof(DES_data_block));
- 	return;
-     }
-     rv = PK11_CipherOp(ctxt[0], (unsigned char *)&encrypted[0], 
--			&size, sizeof(des_data_block),
--			(unsigned char *)&plain[0], sizeof(des_data_block));
-+			&size, sizeof(DES_data_block),
-+			(unsigned char *)&plain[0], sizeof(DES_data_block));
-     if (rv != SECSuccess) {
- 	/* signal failure */
--	memset(encrypted, 0, sizeof(des_data_block));
-+	memset(encrypted, 0, sizeof(DES_data_block));
- 	return;
-     }
-     return;
- }
- 
- static int
--des_failed(des_data_block *encrypted)
-+DES_failed(DES_data_block *encrypted)
- {
--   static const des_data_block zero = { 0 };
-+   static const DES_data_block zero = { 0 };
-    return memcmp(encrypted, zero, sizeof(zero)) == 0;
- }
- 
- static void
--des_finish(des_key *key, des_context ctxt)
-+DES_finish(DES_key *key, DES_context ctxt)
- {
-      if (*key) {
- 	PK11_FreeSymKey(*key);
-@@ -817,7 +817,7 @@
- 
- static void lmPasswd_to_key(
- 	const char *lmPasswd,
--	des_key *key)
-+	DES_key *key)
- {
- 	const unsigned char *lpw = (const unsigned char *) lmPasswd;
- 	unsigned char k[8];
-@@ -832,7 +832,7 @@
- 	k[6] = ((lpw[5] & 0x3F) << 2) | (lpw[6] >> 6);
- 	k[7] = ((lpw[6] & 0x7F) << 1);
- 		
--	des_set_key_and_parity( key, k );
-+	DES_set_key_and_parity( key, k );
- }	
- 
- static int chk_lanman(
-@@ -843,10 +843,10 @@
- {
- 	ber_len_t i;
- 	char UcasePassword[15];
--	des_key key;
--	des_context schedule;
--	des_data_block StdText = "KGS!@#$%";
--	des_data_block PasswordHash1, PasswordHash2;
-+	DES_key key;
-+	DES_context schedule;
-+	DES_data_block StdText = "KGS!@#$%";
-+	DES_data_block PasswordHash1, PasswordHash2;
- 	char PasswordHash[33], storedPasswordHash[33];
- 	
- 	for( i=0; i<cred->bv_len; i++) {
-@@ -864,21 +864,21 @@
- 	ldap_pvt_str2upper( UcasePassword );
- 	
- 	lmPasswd_to_key( UcasePassword, &key );
--	des_set_key_unchecked( &key, schedule );
--	des_ecb_encrypt( &StdText, &PasswordHash1, schedule , DES_ENCRYPT );
-+	DES_set_key_unchecked( &key, &schedule );
-+	DES_ecb_encrypt( &StdText, &PasswordHash1, &schedule , DES_ENCRYPT );
- 
--	if (des_failed(&PasswordHash1)) {
-+	if (DES_failed(&PasswordHash1)) {
- 	    return LUTIL_PASSWD_ERR;
- 	}
- 	
- 	lmPasswd_to_key( &UcasePassword[7], &key );
--	des_set_key_unchecked( &key, schedule );
--	des_ecb_encrypt( &StdText, &PasswordHash2, schedule , DES_ENCRYPT );
--	if (des_failed(&PasswordHash2)) {
-+	DES_set_key_unchecked( &key, &schedule );
-+	DES_ecb_encrypt( &StdText, &PasswordHash2, &schedule , DES_ENCRYPT );
-+	if (DES_failed(&PasswordHash2)) {
- 	    return LUTIL_PASSWD_ERR;
- 	}
- 
--	des_finish( &key, schedule );
-+	DES_finish( &key, schedule );
- 	
- 	sprintf( PasswordHash, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 
- 		PasswordHash1[0],PasswordHash1[1],PasswordHash1[2],PasswordHash1[3],
-@@ -1139,10 +1139,10 @@
- 
- 	ber_len_t i;
- 	char UcasePassword[15];
--	des_key key;
--	des_context schedule;
--	des_data_block StdText = "KGS!@#$%";
--	des_data_block PasswordHash1, PasswordHash2;
-+	DES_key key;
-+	DES_context schedule;
-+	DES_data_block StdText = "KGS!@#$%";
-+	DES_data_block PasswordHash1, PasswordHash2;
- 	char PasswordHash[33];
- 	
- 	for( i=0; i<passwd->bv_len; i++) {
-@@ -1160,12 +1160,12 @@
- 	ldap_pvt_str2upper( UcasePassword );
- 	
- 	lmPasswd_to_key( UcasePassword, &key );
--	des_set_key_unchecked( &key, schedule );
--	des_ecb_encrypt( &StdText, &PasswordHash1, schedule , DES_ENCRYPT );
-+	DES_set_key_unchecked( &key, &schedule );
-+	DES_ecb_encrypt( &StdText, &PasswordHash1, &schedule , DES_ENCRYPT );
- 	
- 	lmPasswd_to_key( &UcasePassword[7], &key );
--	des_set_key_unchecked( &key, schedule );
--	des_ecb_encrypt( &StdText, &PasswordHash2, schedule , DES_ENCRYPT );
-+	DES_set_key_unchecked( &key, &schedule );
-+	DES_ecb_encrypt( &StdText, &PasswordHash2, &schedule , DES_ENCRYPT );
- 	
- 	sprintf( PasswordHash, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 
- 		PasswordHash1[0],PasswordHash1[1],PasswordHash1[2],PasswordHash1[3],

Deleted: trunk/net/openldap24-server/files/patch-libraries__libldap__tls_o.c
===================================================================
--- trunk/net/openldap24-server/files/patch-libraries__libldap__tls_o.c	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/files/patch-libraries__libldap__tls_o.c	2018-09-13 13:28:55 UTC (rev 24320)
@@ -1,11 +0,0 @@
---- libraries/libldap/tls_o.c	2009/02/10 12:27:22	1.6
-+++ libraries/libldap/tls_o.c	2009/03/02 16:43:38	1.7
-@@ -421,7 +421,7 @@
- 	xn = X509_get_subject_name(x);
- 	der_dn->bv_len = i2d_X509_NAME( xn, NULL );
- 	der_dn->bv_val = xn->bytes->data;
--	X509_free(x);
-+	/* Don't X509_free, the session is still using it */
- 	return 0;
- }
- 

Added: trunk/net/openldap24-server/files/patch-libressl
===================================================================
--- trunk/net/openldap24-server/files/patch-libressl	                        (rev 0)
+++ trunk/net/openldap24-server/files/patch-libressl	2018-09-13 13:28:55 UTC (rev 24320)
@@ -0,0 +1,65 @@
+--- libraries/libldap/tls_o.c.orig	2017-06-04 16:31:28 UTC
++++ libraries/libldap/tls_o.c
+@@ -47,7 +47,7 @@
+ #include <ssl.h>
+ #endif
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000
++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
+ #define ASN1_STRING_data(x)	ASN1_STRING_get0_data(x)
+ #endif
+ 
+@@ -157,7 +157,7 @@ tlso_init( void )
+ 	(void) tlso_seed_PRNG( lo->ldo_tls_randfile );
+ #endif
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000
++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+ 	SSL_load_error_strings();
+ 	SSL_library_init();
+ 	OpenSSL_add_all_digests();
+@@ -205,7 +205,7 @@ static void
+ tlso_ctx_ref( tls_ctx *ctx )
+ {
+ 	tlso_ctx *c = (tlso_ctx *)ctx;
+-#if OPENSSL_VERSION_NUMBER < 0x10100000
++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+ #define	SSL_CTX_up_ref(ctx)	CRYPTO_add( &(ctx->references), 1, CRYPTO_LOCK_SSL_CTX )
+ #endif
+ 	SSL_CTX_up_ref( c );
+@@ -464,7 +464,7 @@ tlso_session_my_dn( tls_session *sess, struct berval *
+ 	if (!x) return LDAP_INVALID_CREDENTIALS;
+ 	
+ 	xn = X509_get_subject_name(x);
+-#if OPENSSL_VERSION_NUMBER < 0x10100000
++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+ 	der_dn->bv_len = i2d_X509_NAME( xn, NULL );
+ 	der_dn->bv_val = xn->bytes->data;
+ #else
+@@ -500,7 +500,7 @@ tlso_session_peer_dn( tls_session *sess, struct berval
+ 		return LDAP_INVALID_CREDENTIALS;
+ 
+ 	xn = X509_get_subject_name(x);
+-#if OPENSSL_VERSION_NUMBER < 0x10100000
++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+ 	der_dn->bv_len = i2d_X509_NAME( xn, NULL );
+ 	der_dn->bv_val = xn->bytes->data;
+ #else
+@@ -721,7 +721,7 @@ struct tls_data {
+ 	Sockbuf_IO_Desc		*sbiod;
+ };
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000
++#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+ #define BIO_set_init(b, x)	b->init = x
+ #define BIO_set_data(b, x)	b->ptr = x
+ #define BIO_clear_flags(b, x)	b->flags &= ~(x)
+@@ -822,7 +822,7 @@ tlso_bio_puts( BIO *b, const char *str )
+ 	return tlso_bio_write( b, str, strlen( str ) );
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000
++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
+ struct bio_method_st {
+     int type;
+     const char *name;


Property changes on: trunk/net/openldap24-server/files/patch-libressl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/net/openldap24-server/files/pkg-message.in
===================================================================
--- trunk/net/openldap24-server/files/pkg-message.in	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/files/pkg-message.in	2018-09-13 13:28:55 UTC (rev 24320)
@@ -16,7 +16,7 @@
 Try `man slapd' and the online manual at
   http://www.OpenLDAP.org/doc/
 for more information.
-  
+
 slapd runs under a non-privileged user id (by default `ldap'),
 see %%PREFIX%%/etc/rc.d/slapd for more information.
 

Modified: trunk/net/openldap24-server/pkg-plist
===================================================================
--- trunk/net/openldap24-server/pkg-plist	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/pkg-plist	2018-09-13 13:28:55 UTC (rev 24320)
@@ -1,40 +1,38 @@
- at unexec %%RC_DIR%%/etc/rc.d/slapd stop 2>&1 >/dev/null || true
-etc/openldap/schema/README
-etc/openldap/schema/collective.ldif
- at sample etc/openldap/schema/collective.schema.sample
-etc/openldap/schema/corba.ldif
- at sample etc/openldap/schema/corba.schema.sample
-etc/openldap/schema/core.ldif
- at sample etc/openldap/schema/core.schema.sample
-etc/openldap/schema/cosine.ldif
- at sample etc/openldap/schema/cosine.schema.sample
-etc/openldap/schema/duaconf.ldif
- at sample etc/openldap/schema/duaconf.schema.sample
-etc/openldap/schema/dyngroup.ldif
- at sample etc/openldap/schema/dyngroup.schema.sample
-etc/openldap/schema/inetorgperson.ldif
- at sample etc/openldap/schema/inetorgperson.schema.sample
-etc/openldap/schema/java.ldif
- at sample etc/openldap/schema/java.schema.sample
-etc/openldap/schema/misc.ldif
- at sample etc/openldap/schema/misc.schema.sample
-etc/openldap/schema/nis.ldif
- at sample etc/openldap/schema/nis.schema.sample
-etc/openldap/schema/openldap.ldif
- at sample etc/openldap/schema/openldap.schema.sample
-etc/openldap/schema/pmi.ldif
- at sample etc/openldap/schema/pmi.schema.sample
-etc/openldap/schema/ppolicy.ldif
- at sample etc/openldap/schema/ppolicy.schema.sample
- at sample etc/openldap/slapd.conf.sample
- at sample etc/openldap/slapd.ldif.sample
-%%BACK_BDB%%etc/openldap/DB_CONFIG.example
+%%ETCDIR%%/schema/README
+%%ETCDIR%%/schema/collective.ldif
+ at sample %%ETCDIR%%/schema/collective.schema.sample
+%%ETCDIR%%/schema/corba.ldif
+ at sample %%ETCDIR%%/schema/corba.schema.sample
+%%ETCDIR%%/schema/core.ldif
+ at sample %%ETCDIR%%/schema/core.schema.sample
+%%ETCDIR%%/schema/cosine.ldif
+ at sample %%ETCDIR%%/schema/cosine.schema.sample
+%%ETCDIR%%/schema/duaconf.ldif
+ at sample %%ETCDIR%%/schema/duaconf.schema.sample
+%%ETCDIR%%/schema/dyngroup.ldif
+ at sample %%ETCDIR%%/schema/dyngroup.schema.sample
+%%ETCDIR%%/schema/inetorgperson.ldif
+ at sample %%ETCDIR%%/schema/inetorgperson.schema.sample
+%%ETCDIR%%/schema/java.ldif
+ at sample %%ETCDIR%%/schema/java.schema.sample
+%%ETCDIR%%/schema/misc.ldif
+ at sample %%ETCDIR%%/schema/misc.schema.sample
+%%ETCDIR%%/schema/nis.ldif
+ at sample %%ETCDIR%%/schema/nis.schema.sample
+%%ETCDIR%%/schema/openldap.ldif
+ at sample %%ETCDIR%%/schema/openldap.schema.sample
+%%ETCDIR%%/schema/pmi.ldif
+ at sample %%ETCDIR%%/schema/pmi.schema.sample
+%%ETCDIR%%/schema/ppolicy.ldif
+ at sample %%ETCDIR%%/schema/ppolicy.schema.sample
+ at sample %%ETCDIR%%/slapd.conf.sample
+ at sample %%ETCDIR%%/slapd.ldif.sample
+%%BACK_BDB%%%%ETCDIR%%/DB_CONFIG.example
 %%SLAPI%%lib/libslapi-%%OPENLDAP_MAJOR%%.so.%%SHLIB_MAJOR%%
 %%SLAPI%%lib/libslapi-%%OPENLDAP_MAJOR%%.so.%%SHLIB_MAJOR%%.%%SHLIB_MINOR%%
 %%SLAPI%%lib/libslapi.a
 %%SLAPI%%lib/libslapi.la
 %%SLAPI%%lib/libslapi.so
-%%MODULES%%@exec mkdir -p %D/libexec/openldap
 %%BACK_BDB%%libexec/openldap/back_bdb-%%OPENLDAP_MAJOR%%.so.%%SHLIB_MAJOR%%
 %%BACK_BDB%%libexec/openldap/back_bdb-%%OPENLDAP_MAJOR%%.so.%%SHLIB_MAJOR%%.%%SHLIB_MINOR%%
 %%BACK_BDB%%libexec/openldap/back_bdb.la
@@ -99,6 +97,10 @@
 %%SMBPWD%%libexec/openldap/smbk5pwd.so
 %%SMBPWD%%libexec/openldap/smbk5pwd.so.0
 %%SMBPWD%%libexec/openldap/smbk5pwd.so.0.0.0
+%%LASTBIND%%libexec/openldap/lastbind.la
+%%LASTBIND%%libexec/openldap/lastbind.so
+%%LASTBIND%%libexec/openldap/lastbind.so.0
+%%LASTBIND%%libexec/openldap/lastbind.so.0.0.0
 libexec/slapd
 man/man5/slapd-bdb.5.gz
 man/man5/slapd-config.5.gz
@@ -163,7 +165,7 @@
 sbin/slappasswd
 sbin/slapschema
 sbin/slaptest
- at dir etc/openldap/schema
+ at dir %%ETCDIR%%/schema
 %%MODULES%%@dir libexec/openldap
 @dir(%%LDAP_USER%%,%%LDAP_GROUP%%,775) %%LDAP_RUN_DIR%%
 @dir(%%LDAP_USER%%,%%LDAP_GROUP%%,775) %%DATABASEDIR%%

Modified: trunk/net/openldap24-server/pkg-plist.client
===================================================================
--- trunk/net/openldap24-server/pkg-plist.client	2018-09-13 04:01:34 UTC (rev 24319)
+++ trunk/net/openldap24-server/pkg-plist.client	2018-09-13 13:28:55 UTC (rev 24320)
@@ -227,4 +227,4 @@
 man/man3/ldap_value_free_len.3.gz
 man/man5/ldap.conf.5.gz
 man/man5/ldif.5.gz
- at dir etc/openldap
+ at dir %%ETCDIR%%



More information about the Midnightbsd-cvs mailing list