pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases Fix build of openldap-server against BDB 4.7...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ea0f0843e09b
branches:  trunk
changeset: 546744:ea0f0843e09b
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Sep 07 12:18:06 2008 +0000

description:
Fix build of openldap-server against BDB 4.7, using patches from upstream
CVS. Bump PKGREVISION.

diffstat:

 databases/openldap-server/Makefile  |     3 +-
 databases/openldap/distinfo         |     3 +-
 databases/openldap/patches/patch-ca |  2177 +++++++++++++++++++++++++++++++++++
 3 files changed, 2181 insertions(+), 2 deletions(-)

diffs (truncated from 2207 to 300 lines):

diff -r ba3d46c6badf -r ea0f0843e09b databases/openldap-server/Makefile
--- a/databases/openldap-server/Makefile        Sun Sep 07 12:01:46 2008 +0000
+++ b/databases/openldap-server/Makefile        Sun Sep 07 12:18:06 2008 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.13 2008/02/24 20:15:06 ghen Exp $
+# $NetBSD: Makefile,v 1.14 2008/09/07 12:18:07 wiz Exp $
 
 PKGNAME=               ${DISTNAME:S/-/-server-/}
+PKGREVISION=           1
 COMMENT=               Lightweight Directory Access Protocol server suite
 
 CONFLICTS+=            openldap<2.3.23nb1
diff -r ba3d46c6badf -r ea0f0843e09b databases/openldap/distinfo
--- a/databases/openldap/distinfo       Sun Sep 07 12:01:46 2008 +0000
+++ b/databases/openldap/distinfo       Sun Sep 07 12:18:06 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.65 2008/07/19 21:08:42 ghen Exp $
+$NetBSD: distinfo,v 1.66 2008/09/07 12:18:06 wiz Exp $
 
 SHA1 (openldap-2.4.11.tgz) = 5a7d2d8824d8d2671a781a2fc24b629a145b919d
 RMD160 (openldap-2.4.11.tgz) = 27959c4111f6ba5b7c4b1344c2cb27d9f69cd628
@@ -19,3 +19,4 @@
 SHA1 (patch-be) = fb828f59b4ff21009c24be94a18c01276feab0b5
 SHA1 (patch-bf) = 09874cc5fcd476b4bc37bcb1ad5b7f833cfcdb94
 SHA1 (patch-bh) = f8660750454c80e7520ed27f1a2e39ecfd266997
+SHA1 (patch-ca) = 317c8862aed7432b45e788cafd72cef0ebce2a4d
diff -r ba3d46c6badf -r ea0f0843e09b databases/openldap/patches/patch-ca
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/openldap/patches/patch-ca       Sun Sep 07 12:18:06 2008 +0000
@@ -0,0 +1,2177 @@
+$NetBSD: patch-ca,v 1.1 2008/09/07 12:18:07 wiz Exp $
+
+BDB 4.7 support based on
+http://www.openldap.org/lists/openldap-commit/200808/msg00045.html
+http://www.openldap.org/lists/openldap-commit/200808/msg00048.html
+
+Index: add.c
+===================================================================
+RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-bdb/add.c,v
+retrieving revision 1.173
+retrieving revision 1.174
+diff -u -r1.173 -r1.174
+--- servers/slapd/back-bdb/add.c       1 May 2008 11:25:15 -0000       1.173
++++ servers/slapd/back-bdb/add.c       26 Aug 2008 23:45:35 -0000      1.174
+@@ -32,11 +32,10 @@
+       size_t textlen = sizeof textbuf;
+       AttributeDescription *children = slap_schema.si_ad_children;
+       AttributeDescription *entry = slap_schema.si_ad_entry;
+-      DB_TXN          *ltid = NULL, *lt2;
++      DB_TXN          *ltid = NULL, *lt2, *rtxn;
+       ID eid = NOID;
+       struct bdb_op_info opinfo = {0};
+       int subentry;
+-      BDB_LOCKER      locker = 0, rlocker = 0;
+       DB_LOCK         lock;
+ 
+       int             num_retries = 0;
+@@ -115,8 +114,8 @@
+ 
+       subentry = is_entry_subentry( op->oq_add.rs_e );
+ 
+-      /* Get our thread locker ID */
+-      rs->sr_err = LOCK_ID( bdb->bi_dbenv, &rlocker );
++      /* Get our reader TXN */
++      rs->sr_err = bdb_reader_get( op, bdb->bi_dbenv, &rtxn );
+ 
+       if( 0 ) {
+ retry:        /* transaction retry */
+@@ -157,8 +156,6 @@
+               goto return_results;
+       }
+ 
+-      locker = TXN_ID ( ltid );
+-
+       opinfo.boi_oe.oe_key = bdb;
+       opinfo.boi_txn = ltid;
+       opinfo.boi_err = 0;
+@@ -176,7 +173,7 @@
+ 
+       /* get entry or parent */
+       rs->sr_err = bdb_dn2entry( op, ltid, &op->ora_e->e_nname, &ei,
+-              1, locker, &lock );
++              1, &lock );
+       switch( rs->sr_err ) {
+       case 0:
+               rs->sr_err = LDAP_ALREADY_EXISTS;
+@@ -428,8 +425,8 @@
+                       nrdn = op->ora_e->e_nname;
+               }
+ 
+-              /* Use the thread locker here, outside the txn */
+-              bdb_cache_add( bdb, ei, op->ora_e, &nrdn, rlocker, &lock );
++              /* Use the reader txn here, outside the add txn */
++              bdb_cache_add( bdb, ei, op->ora_e, &nrdn, rtxn, &lock );
+ 
+               if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
+                       rs->sr_text = "txn_commit failed";
+Index: back-bdb.h
+===================================================================
+RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-bdb/back-bdb.h,v
+retrieving revision 1.173
+retrieving revision 1.174
+diff -u -r1.173 -r1.174
+--- servers/slapd/back-bdb/back-bdb.h  1 May 2008 10:49:35 -0000       1.173
++++ servers/slapd/back-bdb/back-bdb.h  26 Aug 2008 23:45:35 -0000      1.174
+@@ -58,30 +58,6 @@
+ #define       BDB_PAGESIZE    4096    /* BDB's original default */
+ #endif
+ 
+-/* 4.6.18 redefines cursor->locker */
+-#if DB_VERSION_FULL >= 0x04060012
+-
+-struct __db_locker {
+-      u_int32_t       id;
+-};
+-
+-typedef struct __db_locker * BDB_LOCKER;
+-
+-extern int __lock_getlocker(DB_LOCKTAB *lt, u_int32_t locker, int create, DB_LOCKER **ret);
+-
+-#define CURSOR_SETLOCKER(cursor, id)  cursor->locker = id
+-#define CURSOR_GETLOCKER(cursor)      cursor->locker
+-#define BDB_LOCKID(locker)    locker->id
+-#else
+-
+-typedef u_int32_t BDB_LOCKER;
+-
+-#define CURSOR_SETLOCKER(cursor, id)  cursor->locker = id
+-#define CURSOR_GETLOCKER(cursor)      cursor->locker
+-#define BDB_LOCKID(locker)    locker
+-
+-#endif
+-
+ #define DEFAULT_CACHE_SIZE     1000
+ 
+ /* The default search IDL stack cache depth */
+@@ -160,7 +136,7 @@
+       int             c_eiused;       /* EntryInfo's in use */
+       int             c_leaves;       /* EntryInfo leaf nodes */
+       int             c_purging;
+-      BDB_LOCKER      c_locker;       /* used by lru cleaner */
++      DB_TXN  *c_txn; /* used by lru cleaner */
+       ldap_pvt_thread_rdwr_t c_rwlock;
+       ldap_pvt_thread_mutex_t c_lru_mutex;
+       ldap_pvt_thread_mutex_t c_count_mutex;
+@@ -309,12 +285,6 @@
+       ((db)->open)(db, NULL, file, name, type, flags, mode)
+ #endif
+ 
+-/* BDB 4.6.18 makes locker a struct instead of an int */
+-#if DB_VERSION_FULL >= 0x04060012
+-#undef TXN_ID
+-#define TXN_ID(txn)   (txn)->locker
+-#endif
+-
+ /* #undef BDB_LOG_DEBUG */
+ 
+ #ifdef BDB_LOG_DEBUG
+@@ -343,8 +313,6 @@
+ #define DB_BUFFER_SMALL                       ENOMEM
+ #endif
+ 
+-#define BDB_REUSE_LOCKERS
+-
+ #define BDB_CSN_COMMIT        0
+ #define BDB_CSN_ABORT 1
+ #define BDB_CSN_RETRY 2
+Index: bind.c
+===================================================================
+RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-bdb/bind.c,v
+retrieving revision 1.54
+retrieving revision 1.55
+diff -u -r1.54 -r1.55
+--- servers/slapd/back-bdb/bind.c      7 Jan 2008 23:20:10 -0000       1.54
++++ servers/slapd/back-bdb/bind.c      26 Aug 2008 23:45:35 -0000      1.55
+@@ -32,7 +32,7 @@
+ 
+       AttributeDescription *password = slap_schema.si_ad_userPassword;
+ 
+-      BDB_LOCKER      locker;
++      DB_TXN          *rtxn;
+       DB_LOCK         lock;
+ 
+       Debug( LDAP_DEBUG_ARGS,
+@@ -55,7 +55,7 @@
+               break;
+       }
+ 
+-      rs->sr_err = LOCK_ID(bdb->bi_dbenv, &locker);
++      rs->sr_err = bdb_reader_get(op, bdb->bi_dbenv, &rtxn);
+       switch(rs->sr_err) {
+       case 0:
+               break;
+@@ -67,8 +67,8 @@
+ 
+ dn2entry_retry:
+       /* get entry with reader lock */
+-      rs->sr_err = bdb_dn2entry( op, NULL, &op->o_req_ndn, &ei, 1,
+-              locker, &lock );
++      rs->sr_err = bdb_dn2entry( op, rtxn, &op->o_req_ndn, &ei, 1,
++              &lock );
+ 
+       switch(rs->sr_err) {
+       case DB_NOTFOUND:
+@@ -76,14 +76,12 @@
+               break;
+       case LDAP_BUSY:
+               send_ldap_error( op, rs, LDAP_BUSY, "ldap_server_busy" );
+-              LOCK_ID_FREE(bdb->bi_dbenv, locker);
+               return LDAP_BUSY;
+       case DB_LOCK_DEADLOCK:
+       case DB_LOCK_NOTGRANTED:
+               goto dn2entry_retry;
+       default:
+               send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
+-              LOCK_ID_FREE(bdb->bi_dbenv, locker);
+               return rs->sr_err;
+       }
+ 
+@@ -97,8 +95,6 @@
+               rs->sr_err = LDAP_INVALID_CREDENTIALS;
+               send_ldap_result( op, rs );
+ 
+-              LOCK_ID_FREE(bdb->bi_dbenv, locker);
+-
+               return rs->sr_err;
+       }
+ 
+@@ -158,8 +154,6 @@
+               bdb_cache_return_entry_r( bdb, e, &lock );
+       }
+ 
+-      LOCK_ID_FREE(bdb->bi_dbenv, locker);
+-
+       if ( rs->sr_err ) {
+               send_ldap_result( op, rs );
+               if ( rs->sr_ref ) {
+Index: cache.c
+===================================================================
+RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-bdb/cache.c,v
+retrieving revision 1.180
+retrieving revision 1.182
+diff -u -r1.180 -r1.182
+--- servers/slapd/back-bdb/cache.c     1 May 2008 21:02:52 -0000       1.180
++++ servers/slapd/back-bdb/cache.c     27 Aug 2008 20:28:16 -0000      1.182
+@@ -159,7 +159,7 @@
+ int
+ bdb_cache_entry_db_relock(
+       struct bdb_info *bdb,
+-      BDB_LOCKER locker,
++      DB_TXN *txn,
+       EntryInfo *ei,
+       int rw,
+       int tryOnly,
+@@ -183,7 +183,7 @@
+       list[1].lock = *lock;
+       list[1].mode = rw ? DB_LOCK_WRITE : DB_LOCK_READ;
+       list[1].obj = &lockobj;
+-      rc = bdb->bi_dbenv->lock_vec(bdb->bi_dbenv, BDB_LOCKID(locker), tryOnly ? DB_LOCK_NOWAIT : 0,
++      rc = bdb->bi_dbenv->lock_vec(bdb->bi_dbenv, TXN_ID(txn), tryOnly ? DB_LOCK_NOWAIT : 0,
+               list, 2, NULL );
+ 
+       if (rc && !tryOnly) {
+@@ -198,7 +198,7 @@
+ }
+ 
+ static int
+-bdb_cache_entry_db_lock( struct bdb_info *bdb, BDB_LOCKER locker, EntryInfo *ei,
++bdb_cache_entry_db_lock( struct bdb_info *bdb, DB_TXN *txn, EntryInfo *ei,
+       int rw, int tryOnly, DB_LOCK *lock )
+ {
+ #ifdef NO_DB_LOCK
+@@ -218,7 +218,7 @@
+       lockobj.data = &ei->bei_id;
+       lockobj.size = sizeof(ei->bei_id) + 1;
+ 
+-      rc = LOCK_GET(bdb->bi_dbenv, BDB_LOCKID(locker), tryOnly ? DB_LOCK_NOWAIT : 0,
++      rc = LOCK_GET(bdb->bi_dbenv, TXN_ID(txn), tryOnly ? DB_LOCK_NOWAIT : 0,
+                                       &lockobj, db_rw, lock);
+       if (rc && !tryOnly) {
+               Debug( LDAP_DEBUG_TRACE,
+@@ -394,7 +394,7 @@
+ int
+ bdb_cache_find_ndn(
+       Operation       *op,
+-      BDB_LOCKER              locker,
++      DB_TXN          *txn,
+       struct berval   *ndn,
+       EntryInfo       **res )
+ {
+@@ -448,7 +448,7 @@
+                               ei.bei_nrdn.bv_val );
+ 
+                       lock.mode = DB_LOCK_NG;
+-                      rc = bdb_dn2id( op, &ei.bei_nrdn, &ei, locker, &lock );
++                      rc = bdb_dn2id( op, &ei.bei_nrdn, &ei, txn, &lock );
+                       if (rc) {
+                               bdb_cache_entryinfo_lock( eip );
+                               bdb_cache_entry_db_unlock( bdb, &lock );
+@@ -508,7 +508,7 @@



Home | Main Index | Thread Index | Old Index