On 2013/01/14 22:47, Stuart Henderson wrote: > On 2013/01/14 19:18, Friedrich Locke wrote: > > Hi folks, > > > > this is my first message to this list. I am writing because i am in need to > > use openldap from ports. > > Initially i tried openldap with support to BDB, but it is buggy. > > I was suggest to try mdb, but openldap's Makefile have the --disable-mdb > > instruction.
here is a diff which updates OpenLDAP to 2.4.34 and enables MDB support but with a sanity check added. I have not tested the MDB support _at all_ but in theory, it should prevent you from running with MDB without also configuring writemap. anyone fancy testing it? Index: Makefile =================================================================== RCS file: /cvs/ports/databases/openldap/Makefile,v retrieving revision 1.122 diff -u -p -r1.122 Makefile --- Makefile 21 Mar 2013 08:45:14 -0000 1.122 +++ Makefile 26 Mar 2013 19:33:02 -0000 @@ -3,7 +3,7 @@ COMMENT-main = open-source LDAP software (client) COMMENT-server = open-source LDAP software (server) -DISTNAME = openldap-2.4.33 +DISTNAME = openldap-2.4.34 PKGNAME-main = ${DISTNAME:S/-/-client-/} PKGNAME-server = ${DISTNAME:S/-/-server-/} @@ -62,14 +62,14 @@ CONFIGURE_ARGS += --enable-bdb \ --enable-dnssrv \ --enable-hdb \ --enable-ldap \ + --enable-mdb \ --enable-meta \ --enable-monitor \ --enable-null \ + --enable-overlays \ --enable-passwd \ --enable-perl \ - --enable-shell \ - --enable-overlays \ - --disable-mdb + --enable-shell .if ${FLAVOR:Maci} CONFIGURE_ARGS += --enable-aci Index: distinfo =================================================================== RCS file: /cvs/ports/databases/openldap/distinfo,v retrieving revision 1.38 diff -u -p -r1.38 distinfo --- distinfo 3 Jan 2013 11:52:29 -0000 1.38 +++ distinfo 26 Mar 2013 19:33:02 -0000 @@ -1,2 +1,2 @@ -SHA256 (openldap-2.4.33.tgz) = gensog8XpppdFevExmoyMQbaT0+AoyEFvHzeozOsoUw= -SIZE (openldap-2.4.33.tgz) = 5463850 +SHA256 (openldap-2.4.34.tgz) = 6qtMSmsJzJ5g+X5u+ZdPgyfZd9HXr3vADCvF+Q3+BgY= +SIZE (openldap-2.4.34.tgz) = 5485028 Index: patches/patch-servers_slapd_back-mdb_init_c =================================================================== RCS file: patches/patch-servers_slapd_back-mdb_init_c diff -N patches/patch-servers_slapd_back-mdb_init_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-servers_slapd_back-mdb_init_c 26 Mar 2013 19:33:02 -0000 @@ -0,0 +1,36 @@ +$OpenBSD$ +--- servers/slapd/back-mdb/init.c.orig Fri Mar 22 10:47:17 2013 ++++ servers/slapd/back-mdb/init.c Fri Mar 22 10:47:36 2013 +@@ -158,6 +158,32 @@ mdb_db_open( BackendDB *be, ConfigReply *cr ) + dbhome = mdb->mi_dbenv_home; + #endif + ++#ifdef __OpenBSD__ ++ /* ++ * Enforce that MDB_WRITEMAP is set. ++ * ++ * MDB assumes a unified buffer cache. ++ * ++ * See http://www.openldap.org/pub/hyc/mdm-paper.pdf section 3.1, ++ * references 17, 18, and 19. ++ * ++ * From Howard Chu: "This requirement can be relaxed in the ++ * current version of the library. If you create the environment ++ * with the MDB_WRITEMAP option then all reads and writes are ++ * performed using mmap, so the file buffer cache is irrelevant. ++ * Of course then you lose the protection that the read-only ++ * map offers." ++ */ ++ ++ if ( !(flags & MDB_WRITEMAP) ) { ++ Debug( LDAP_DEBUG_ANY, ++ LDAP_XSTRING(mdb_db_open) ": database \"%s\" does not have writemap. " ++ "This is required on systems without unified buffer cache.\n", ++ be->be_suffix[0].bv_val, rc, 0 ); ++ goto fail; ++ } ++#endif ++ + Debug( LDAP_DEBUG_TRACE, + LDAP_XSTRING(mdb_db_open) ": database \"%s\": " + "dbenv_open(%s).\n", Index: pkg/PFRAG.shared-main =================================================================== RCS file: pkg/PFRAG.shared-main diff -N pkg/PFRAG.shared-main --- pkg/PFRAG.shared-main 7 Jan 2011 10:24:30 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,7 +0,0 @@ -@comment $OpenBSD: PFRAG.shared-main,v 1.2 2011/01/07 10:24:30 pea Exp $ -@lib lib/liblber-2.4.so.${LIBlber-2.4_VERSION} -@lib lib/liblber.so.${LIBlber_VERSION} -@lib lib/libldap-2.4.so.${LIBldap-2.4_VERSION} -@lib lib/libldap.so.${LIBldap_VERSION} -@lib lib/libldap_r-2.4.so.${LIBldap_r-2.4_VERSION} -@lib lib/libldap_r.so.${LIBldap_r_VERSION} Index: pkg/PLIST-main =================================================================== RCS file: /cvs/ports/databases/openldap/pkg/PLIST-main,v retrieving revision 1.7 diff -u -p -r1.7 PLIST-main --- pkg/PLIST-main 9 Mar 2012 09:48:32 -0000 1.7 +++ pkg/PLIST-main 26 Mar 2013 19:33:02 -0000 @@ -19,12 +19,18 @@ include/ldap_schema.h include/ldap_utf8.h include/ldif.h include/slapi-plugin.h +@lib lib/liblber-2.4.so.${LIBlber-2.4_VERSION} lib/liblber.a lib/liblber.la +@lib lib/liblber.so.${LIBlber_VERSION} +@lib lib/libldap-2.4.so.${LIBldap-2.4_VERSION} lib/libldap.a lib/libldap.la +@lib lib/libldap.so.${LIBldap_VERSION} +@lib lib/libldap_r-2.4.so.${LIBldap_r-2.4_VERSION} lib/libldap_r.a lib/libldap_r.la +@lib lib/libldap_r.so.${LIBldap_r_VERSION} @man man/man1/ldapadd.1 @man man/man1/ldapcompare.1 @man man/man1/ldapdelete.1 @@ -226,4 +232,3 @@ share/examples/openldap/ @sample ${SYSCONFDIR}/openldap/ share/examples/openldap/ldap.conf @sample ${SYSCONFDIR}/openldap/ldap.conf -%%SHARED%%