~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/back-bdb/back-bdb.h

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Steve Langasek, Mathias Gug
  • Date: 2009-02-18 18:44:00 UTC
  • mfrom: (1.1.2 upstream) (0.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20090218184400-zw4mjse9eywt5566
Tags: 2.4.14-0ubuntu1
[ Steve Langasek ]
* New upstream version
  - Fixes a bug with the pcache overlay not returning cached entries
    (closes: #497697)
  - Update evolution-ntlm patch to apply to current Makefiles.
  - (tentatively) drop gnutls-ciphers, since this bug was reported to be
    fixed upstream in 2.4.8.  The fix applied in 2.4.8 didn't match the
    patch from the bug report, so this should be watched for regressions.
* Build against db4.7 instead of db4.2 at last!  Closes: #421946.
* Build with --disable-ndb, to avoid a misbuild when libmysqlclient is
  installed in the build environment.
* New patch, no-crlcheck-for-gnutls, to fix a build failure when using
  --with-tls=gnutls.

[ Mathias Gug ]
* Merge from debian unstable, remaining changes:
  - debian/apparmor-profile: add AppArmor profile
  - debian/slapd.postinst: Reload AA profile on configuration
  - updated debian/slapd.README.Debian for note on AppArmor
  - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6
  - debian/control: Conflicts with apparmor-profiles << 2.1+1075-0ubuntu4
    to make sure that if earlier version of apparmour-profiles gets
    installed it won't overwrite our profile.
  - Modify Maintainer value to match the DebianMaintainerField
    speficication.
  - follow ApparmorProfileMigration and force apparmor compalin mode on 
    some upgrades (LP: #203529)
  - debian/slapd.dirs: add etc/apparmor.d/force-complain
  - debian/slapd.preinst: create symlink for force-complain on pre-feisty
    upgrades, upgrades where apparmor-profiles profile is unchanged (ie
    non-enforcing) and upgrades where apparmor profile does not exist.
  - debian/slapd.postrm: remove symlink in force-complain/ on purge
  - debian/patches/fix-ucred-libc due to changes how newer glibc handle
    the ucred struct now.
  - debian/control:
    - Build-depend on libltdl7-dev rather then libltdl3-dev.
  - debian/patches/autogen.sh:
    - Call libtoolize with the --install option to install config.{guess,sub}
      files.
  - Don't use local statement in config script as it fails if /bin/sh
    points to bash (LP: #286063).
  - Disable the testsuite on hppa. Allows building of packages on this
    architecture again, once this package is in the archive.
    LP: #288908.
  - debian/slapd.postinst, debian/slapd.script-common: set correct ownership
    and permissions on /var/lib/ldap, /etc/ldap/slapd.d (group readable) and
    /var/run/slapd (world readable). (LP: #257667).
  - debian/patches/nssov-build, debian/rules: 
    Build and package the nss overlay.
    debian/schema/misc.ldif: add ldif file for the misc schema, which defines
    rfc822MailMember (required by the nss overlay).
  - debian/{control,rules}: enable PIE hardening
  - Use cn=config as the default configuration backend instead of 
    slapd.conf. Migrate slapd.conf  file to /etc/ldap/slapd.d/ on upgrade
    asking the end user to enter a new password to control the access to the
    cn=config tree.
* debian/patches/corrupt-contextCSN: The contextCSN can get corrupted at
  times. (ITS: #5947)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* back-bdb.h - bdb back-end header file */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/back-bdb.h,v 1.141.2.14 2008/05/01 21:39:35 quanah Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/back-bdb.h,v 1.141.2.19 2009/01/22 00:01:04 kurt Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
 
 * Copyright 2000-2008 The OpenLDAP Foundation.
 
5
 * Copyright 2000-2009 The OpenLDAP Foundation.
6
6
 * All rights reserved.
7
7
 *
8
8
 * Redistribution and use in source and binary forms, with or without
54
54
#define BDB_ID2ENTRY_PAGESIZE   16384
55
55
#endif
56
56
 
57
 
#ifndef BDB_PAGESIZE
58
 
#define BDB_PAGESIZE    4096    /* BDB's original default */
59
 
#endif
60
 
 
61
 
/* 4.6.18 redefines cursor->locker */
62
 
#if DB_VERSION_FULL >= 0x04060012
63
 
 
64
 
struct __db_locker {
65
 
        u_int32_t       id;
66
 
};
67
 
 
68
 
typedef struct __db_locker * BDB_LOCKER;
69
 
 
70
 
extern int __lock_getlocker(DB_LOCKTAB *lt, u_int32_t locker, int create, DB_LOCKER **ret);
71
 
 
72
 
#define CURSOR_SETLOCKER(cursor, id)    cursor->locker = id
73
 
#define CURSOR_GETLOCKER(cursor)        cursor->locker
74
 
#define BDB_LOCKID(locker)      locker->id
75
 
#else
76
 
 
77
 
typedef u_int32_t BDB_LOCKER;
78
 
 
79
 
#define CURSOR_SETLOCKER(cursor, id)    cursor->locker = id
80
 
#define CURSOR_GETLOCKER(cursor)        cursor->locker
81
 
#define BDB_LOCKID(locker)      locker
82
 
 
83
 
#endif
84
 
 
85
57
#define DEFAULT_CACHE_SIZE     1000
86
58
 
87
59
/* The default search IDL stack cache depth */
160
132
        int             c_eiused;       /* EntryInfo's in use */
161
133
        int             c_leaves;       /* EntryInfo leaf nodes */
162
134
        int             c_purging;
163
 
        BDB_LOCKER      c_locker;       /* used by lru cleaner */
 
135
        DB_TXN  *c_txn; /* used by lru cleaner */
164
136
        ldap_pvt_thread_rdwr_t c_rwlock;
165
137
        ldap_pvt_thread_mutex_t c_lru_mutex;
166
138
        ldap_pvt_thread_mutex_t c_count_mutex;
180
152
        DB                      *bdi_db;
181
153
};
182
154
 
 
155
struct bdb_db_pgsize {
 
156
        struct bdb_db_pgsize *bdp_next;
 
157
        struct berval   bdp_name;
 
158
        int     bdp_size;
 
159
};
 
160
 
183
161
#ifdef LDAP_DEVEL
184
162
#define BDB_MONITOR_IDX
185
163
#endif /* LDAP_DEVEL */
202
180
        int                     bi_dbenv_mode;
203
181
 
204
182
        int                     bi_ndatabases;
 
183
        int             bi_db_opflags;  /* db-specific flags */
205
184
        struct bdb_db_info **bi_databases;
206
185
        ldap_pvt_thread_mutex_t bi_database_mutex;
207
 
        int             bi_db_opflags;  /* db-specific flags */
 
186
        struct bdb_db_pgsize *bi_pagesizes;
208
187
 
209
188
        slap_mask_t     bi_defaultmask;
210
189
        Cache           bi_cache;
250
229
#define BDB_UPD_CONFIG  0x04
251
230
#define BDB_DEL_INDEX   0x08
252
231
#define BDB_RE_OPEN             0x10
 
232
#define BDB_CHKSUM              0x20
253
233
#ifdef BDB_HIER
254
234
        int             bi_modrdns;             /* number of modrdns completed */
255
235
        ldap_pvt_thread_mutex_t bi_modrdns_mutex;
262
242
 
263
243
struct bdb_lock_info {
264
244
        struct bdb_lock_info *bli_next;
 
245
        DB_LOCK bli_lock;
265
246
        ID              bli_id;
266
 
        DB_LOCK bli_lock;
 
247
        int             bli_flag;
267
248
};
 
249
#define BLI_DONTFREE    1
268
250
 
269
251
struct bdb_op_info {
270
252
        OpExtra boi_oe;
271
253
        DB_TXN*         boi_txn;
 
254
        struct bdb_lock_info *boi_locks;        /* used when no txn */
272
255
        u_int32_t       boi_err;
273
 
        int             boi_acl_cache;
274
 
        struct bdb_lock_info *boi_locks;        /* used when no txn */
 
256
        char            boi_acl_cache;
 
257
        char            boi_flag;
275
258
};
 
259
#define BOI_DONTFREE    1
276
260
 
277
261
#define DB_OPEN(db, file, name, type, flags, mode) \
278
262
        ((db)->open)(db, file, name, type, flags, mode)
309
293
        ((db)->open)(db, NULL, file, name, type, flags, mode)
310
294
#endif
311
295
 
312
 
/* BDB 4.6.18 makes locker a struct instead of an int */
313
 
#if DB_VERSION_FULL >= 0x04060012
314
 
#undef TXN_ID
315
 
#define TXN_ID(txn)     (txn)->locker
316
 
#endif
317
 
 
318
296
/* #undef BDB_LOG_DEBUG */
319
297
 
320
298
#ifdef BDB_LOG_DEBUG
343
321
#define DB_BUFFER_SMALL                 ENOMEM
344
322
#endif
345
323
 
346
 
#define BDB_REUSE_LOCKERS
347
 
 
348
324
#define BDB_CSN_COMMIT  0
349
325
#define BDB_CSN_ABORT   1
350
326
#define BDB_CSN_RETRY   2
360
336
 
361
337
/* Copy a pointer "src" to a pointer "dst" from big-endian to native order */
362
338
#define BDB_DISK2ID( src, dst ) \
363
 
        do { int i0; ID tmp = 0; unsigned char *_p;     \
 
339
        do { unsigned i0; ID tmp = 0; unsigned char *_p;        \
364
340
                _p = (unsigned char *)(src);    \
365
341
                for ( i0=0; i0<sizeof(ID); i0++ ) {     \
366
342
                        tmp <<= 8; tmp |= *_p++;        \