ldap/servers
by thierry bordaz
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 38 +++++++++++++--------------
1 file changed, 19 insertions(+), 19 deletions(-)
New commits:
commit 0bfe1ee7da84f7b5c9d8839fedc964b1955664fc
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Fri Jul 11 15:24:53 2014 +0200
Ticket 47797 - fix the indentation
Bug Description:
Indentation of some parts of the fix was 8 spaces rather than 4
Fix Description:
https://fedorahosted.org/389/ticket/47797
Reviewed by: Mark Reynolds
Platforms tested: f17
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index 8cf5749..fc24402 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -1808,15 +1808,15 @@ retry_get:
*elem = (rdn_elem *)data->data;
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- if (db_txn) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_elem: cursor get deadlock while under txn -> failure\n");
- } else {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_elem: cursor get deadlock\n");
- /* try again */
- goto retry_get;
- }
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock while under txn -> failure\n");
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock\n");
+ /* try again */
+ goto retry_get;
+ }
} else if (DB_BUFFER_SMALL == rc) {
/* try again */
data->flags = DB_DBT_MALLOC;
@@ -2591,10 +2591,10 @@ _entryrdn_insert_key(backend *be,
int isexception = 0;
if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
- "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
- goto bail;
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ goto bail;
}
/* Check the RDN is in the exception list */
for (ep = rdn_exceptions; ep && *ep; ep++) {
@@ -3247,11 +3247,11 @@ _entryrdn_index_read(backend *be,
if (rc || NULL == *elem) {
slapi_ch_free((void **)elem);
if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
- slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
- "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
- "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
- slapi_rdn_free(&tmpsrdn);
- goto bail;
+ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
+ "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ slapi_rdn_free(&tmpsrdn);
+ goto bail;
}
if (flags & TOMBSTONE_INCLUDED) {
/* Node might be a tombstone. */
@@ -3345,7 +3345,7 @@ _entryrdn_index_read(backend *be,
"_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
"%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
if (tmpsrdn != srdn) {
- slapi_rdn_free(&tmpsrdn);
+ slapi_rdn_free(&tmpsrdn);
}
goto bail;
}
9 years, 10 months
Branch '389-ds-base-1.3.2' - ldap/servers
by thierry bordaz
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 263 ++++++++++++++++-----------
1 file changed, 163 insertions(+), 100 deletions(-)
New commits:
commit a722b2e3acdb6b618a104f31c0867cedca091366
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Thu Jul 10 14:05:16 2014 +0200
Ticket 47797 - DB deadlock when two threads (on separated backend) try to record changes in retroCL
Bug Description:
The DB is opened so that if a db lock can not be granted it does not wait and returns DB_DEADLOCK
In some part of code, the server just loops retrying where it should abort the txn (and release the locks
it may hold) and retry with a different txn
Fix Description:
If DB_LOCK_DEADLOCK is returned, the correct course of action is to abort the (possibly nested) transaction
and retry the database operation
file:///usr/share/doc/db4-devel-4.7.25/gsg_txn/C/lockingsubsystem.html
Resolving Deadlocks
When DB determines that a deadlock has occurred, it will select a thread of control to
resolve the deadlock and then return DB_LOCK_DEADLOCK to that thread.
If a deadlock is detected, the thread must:
Cease all read and write operations.
Close all open cursors.
Abort the transaction.
Optionally retry the operation. If your application retries deadlocked operations, the new attempt must be made using a new transaction.
https://fedorahosted.org/389/ticket/47797
Reviewed by: Rich and Mark (Thanks)
Platforms tested: F17/F20 (ipa unit tests)
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index 91397d6..2937d1b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -113,15 +113,15 @@ static int _entryrdn_open_index(backend *be, struct attrinfo **ai, DB **dbp);
static char *_entryrdn_encrypt_key(backend *be, const char *key, struct attrinfo *ai);
static char *_entryrdn_decrypt_key(backend *be, const char *key, struct attrinfo *ai);
#endif
-static int _entryrdn_get_elem(DBC *cursor, DBT *key, DBT *data, const char *comp_key, rdn_elem **elem);
-static int _entryrdn_get_tombstone_elem(DBC *cursor, Slapi_RDN *srdn, DBT *key, const char *comp_key, rdn_elem **elem);
+static int _entryrdn_get_elem(DBC *cursor, DBT *key, DBT *data, const char *comp_key, rdn_elem **elem, DB_TXN *db_txn);
+static int _entryrdn_get_tombstone_elem(DBC *cursor, Slapi_RDN *srdn, DBT *key, const char *comp_key, rdn_elem **elem, DB_TXN *db_txn);
static int _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn);
static int _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn);
static int _entryrdn_insert_key(backend *be, DBC *cursor, Slapi_RDN *srdn, ID id, DB_TXN *db_txn);
static int _entryrdn_insert_key_elems(backend *be, DBC *cursor, Slapi_RDN *srdn, DBT *key, rdn_elem *elem, rdn_elem *childelem, size_t childelemlen, DB_TXN *db_txn);
static int _entryrdn_delete_key(backend *be, DBC *cursor, Slapi_RDN *srdn, ID id, DB_TXN *db_txn);
static int _entryrdn_index_read(backend *be, DBC *cursor, Slapi_RDN *srdn, rdn_elem **elem, rdn_elem **parentelem, rdn_elem ***childelems, int flags, DB_TXN *db_txn);
-static int _entryrdn_append_childidl(DBC *cursor, const char *nrdn, ID id, IDList **affectedidl);
+static int _entryrdn_append_childidl(DBC *cursor, const char *nrdn, ID id, IDList **affectedidl, DB_TXN *db_txn);
static void _entryrdn_cursor_print_error(char *fn, void *key, size_t need, size_t actual, int rc);
static int entryrdn_warning_on_encryption = 1;
@@ -1065,6 +1065,9 @@ entryrdn_get_subordinates(backend *be,
rc = _entryrdn_index_read(be, cursor, &srdn, &elem,
NULL, &childelems, 0/*flags*/, db_txn);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ goto bail;
+ }
for (cep = childelems; cep && *cep; cep++) {
ID childid = id_stored_to_internal((*cep)->rdn_elem_id);
@@ -1079,7 +1082,7 @@ entryrdn_get_subordinates(backend *be,
/* set indirect subordinates to the idlist */
rc = _entryrdn_append_childidl(cursor, (*cep)->rdn_elem_nrdn_rdn,
- childid, subordinates);
+ childid, subordinates, db_txn);
if (rc) {
slapi_log_error(SLAPI_LOG_FATAL, ENTRYRDN_TAG,
"entryrdn_get_subordinates: Appending %d to idl "
@@ -1246,13 +1249,16 @@ retry_get0:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock\n");
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) { /* could be a suffix or
note: no parent for suffix */
slapi_ch_free_string(&keybuf);
@@ -1264,13 +1270,15 @@ retry_get1:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: retry cursor get deadlock\n");
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND != rc) {
_entryrdn_cursor_print_error("entryrdn_lookup_dn",
key.data, data.size, data.ulen, rc);
@@ -1456,13 +1464,15 @@ retry_get0:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock\n");
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) { /* could be a suffix
note: no parent for suffix */
slapi_ch_free_string(&keybuf);
@@ -1474,13 +1484,15 @@ retry_get1:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND != rc) {
_entryrdn_cursor_print_error("entryrdn_get_parent",
key.data, data.size, data.ulen, rc);
@@ -1764,7 +1776,8 @@ _entryrdn_get_elem(DBC *cursor,
DBT *key,
DBT *data,
const char *comp_key,
- rdn_elem **elem)
+ rdn_elem **elem,
+ DB_TXN *db_txn)
{
int rc = 0;
void *ptr = NULL;
@@ -1786,13 +1799,15 @@ retry_get:
*elem = (rdn_elem *)data->data;
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_elem: cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock while under txn -> failure\n");
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock\n");
+ /* try again */
+ goto retry_get;
+ }
} else if (DB_BUFFER_SMALL == rc) {
/* try again */
data->flags = DB_DBT_MALLOC;
@@ -1828,7 +1843,8 @@ _entryrdn_get_tombstone_elem(DBC *cursor,
Slapi_RDN *srdn,
DBT *key,
const char *comp_key,
- rdn_elem **elem)
+ rdn_elem **elem,
+ DB_TXN *db_txn)
{
int rc = 0;
DBT data;
@@ -1859,13 +1875,17 @@ _entryrdn_get_tombstone_elem(DBC *cursor,
retry_get0:
rc = cursor->c_get(cursor, key, &data, DB_SET|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_tombstone_elem: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock\n");
+ goto retry_get0;
+ }
+
} else if (DB_NOTFOUND == rc) {
rc = 0; /* Child not found is ok */
goto bail;
@@ -1914,13 +1934,16 @@ retry_get0:
retry_get1:
rc = cursor->c_get(cursor, key, &data, DB_NEXT_DUP|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_tombstone_elem: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
goto bail; /* done */
@@ -2552,11 +2575,18 @@ _entryrdn_insert_key(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the suffix element */
- rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, &elem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, &elem, db_txn);
if (rc) {
const char *myrdn = slapi_rdn_get_nrdn(srdn);
const char **ep = NULL;
int isexception = 0;
+
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ goto bail;
+ }
/* Check the RDN is in the exception list */
for (ep = rdn_exceptions; ep && *ep; ep++) {
if (!strcmp(*ep, myrdn)) {
@@ -2659,10 +2689,15 @@ _entryrdn_insert_key(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the child element */
- rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem, db_txn);
if (rc) {
slapi_ch_free((void **)&tmpelem);
- if (DB_NOTFOUND == rc) {
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", childnrdn, dblayer_strerror(rc), rc);
+ goto bail;
+ } else if (DB_NOTFOUND == rc) {
/* if 0 == rdnidx, Child is a Leaf RDN to be added */
if (0 == rdnidx) {
/* keybuf (C#) is consumed in _entryrdn_insert_key_elems */
@@ -2687,7 +2722,7 @@ _entryrdn_insert_key(backend *be,
* latter case.
*/
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn, &key,
- childnrdn, &tmpelem);
+ childnrdn, &tmpelem, db_txn);
if (rc) {
char *dn = NULL;
slapi_rdn_get_dn(tmpsrdn, &dn);
@@ -2851,13 +2886,16 @@ _entryrdn_delete_key(backend *be,
while (!done) {
rc = cursor->c_get(cursor, &key, &data, DB_SET|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_delete_key: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- continue;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock\n");
+ /* try again */
+ continue;
+ }
} else if (DB_NOTFOUND == rc) {
/* no children; ok */
done = 1;
@@ -2893,13 +2931,16 @@ _entryrdn_delete_key(backend *be,
retry_get:
rc = cursor->c_get(cursor, &key, &data, DB_NEXT_DUP|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_delete_key: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: retry cursor get deadlock\n");
+ /* try again */
+ goto retry_get;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
done = 1;
@@ -2985,7 +3026,7 @@ retry_get:
/* Position cursor at the matching key */
rc = _entryrdn_get_elem(cursor, &key, &data,
- slapi_rdn_get_nrdn(tmpsrdn), &elem);
+ slapi_rdn_get_nrdn(tmpsrdn), &elem, db_txn);
if (tmpsrdn != srdn) {
slapi_rdn_free(&tmpsrdn);
}
@@ -3193,13 +3234,20 @@ _entryrdn_index_read(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the suffix element */
- rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, elem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, elem, db_txn);
if (rc || NULL == *elem) {
slapi_ch_free((void **)elem);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
+ "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ slapi_rdn_free(&tmpsrdn);
+ goto bail;
+ }
if (flags & TOMBSTONE_INCLUDED) {
/* Node might be a tombstone. */
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn,
- &key, nrdn, elem);
+ &key, nrdn, elem, db_txn);
rdnidx--; /* consider nsuniqueid=..,<RDN> one RDN */
}
if (rc || NULL == *elem) {
@@ -3280,9 +3328,18 @@ _entryrdn_index_read(backend *be,
data.flags = DB_DBT_USERMEM;
/* Position cursor at the matching key */
- rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem, db_txn);
if (rc) {
slapi_ch_free((void **)&tmpelem);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
+ "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ if (tmpsrdn != srdn) {
+ slapi_rdn_free(&tmpsrdn);
+ }
+ goto bail;
+ }
if (flags & TOMBSTONE_INCLUDED) {
/* Node might be a tombstone */
/*
@@ -3292,7 +3349,7 @@ _entryrdn_index_read(backend *be,
* nsuniqueid=...,cn=A,nsuniqueid=...,ou=B,o=C
*/
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn, &key,
- childnrdn, &tmpelem);
+ childnrdn, &tmpelem, db_txn);
if (rc || (NULL == tmpelem)) {
slapi_ch_free((void **)&tmpelem);
if (DB_NOTFOUND != rc) {
@@ -3374,11 +3431,12 @@ retry_get0:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_index_read: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get0;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* Child not found is ok */
goto bail;
@@ -3418,11 +3476,13 @@ retry_get1:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_index_read: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get1;
+
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
goto bail; /* done */
@@ -3448,7 +3508,8 @@ static int
_entryrdn_append_childidl(DBC *cursor,
const char *nrdn,
ID id,
- IDList **affectedidl)
+ IDList **affectedidl,
+ DB_TXN *db_txn)
{
/* E.g., C5 */
char *keybuf = slapi_ch_smprintf("%c%u", RDN_INDEX_CHILD, id);
@@ -3474,11 +3535,12 @@ retry_get0:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_append_childidl: cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* okay not to have children */
} else {
@@ -3513,7 +3575,7 @@ retry_get0:
}
rc = _entryrdn_append_childidl(cursor,
(const char *)myelem->rdn_elem_nrdn_rdn,
- myid, affectedidl);
+ myid, affectedidl, db_txn);
if (rc) {
goto bail;
}
@@ -3524,11 +3586,12 @@ retry_get1:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_append_childidl: retry cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* okay not to have children */
} else {
9 years, 10 months
ldap/servers
by thierry bordaz
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 263 ++++++++++++++++-----------
1 file changed, 163 insertions(+), 100 deletions(-)
New commits:
commit 85016a82989a7fd5e185a298b19ff31d81f1bc2e
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Thu Jul 10 14:05:16 2014 +0200
Ticket 47797 - DB deadlock when two threads (on separated backend) try to record changes in retroCL
Bug Description:
The DB is opened so that if a db lock can not be granted it does not wait and returns DB_DEADLOCK
In some part of code, the server just loops retrying where it should abort the txn (and release the locks
it may hold) and retry with a different txn
Fix Description:
If DB_LOCK_DEADLOCK is returned, the correct course of action is to abort the (possibly nested) transaction
and retry the database operation
file:///usr/share/doc/db4-devel-4.7.25/gsg_txn/C/lockingsubsystem.html
Resolving Deadlocks
When DB determines that a deadlock has occurred, it will select a thread of control to
resolve the deadlock and then return DB_LOCK_DEADLOCK to that thread.
If a deadlock is detected, the thread must:
Cease all read and write operations.
Close all open cursors.
Abort the transaction.
Optionally retry the operation. If your application retries deadlocked operations, the new attempt must be made using a new transaction.
https://fedorahosted.org/389/ticket/47797
Reviewed by: Rich and Mark (Thanks)
Platforms tested: F17/F20 (ipa unit tests)
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index d4039e4..8cf5749 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -113,15 +113,15 @@ static int _entryrdn_open_index(backend *be, struct attrinfo **ai, DB **dbp);
static char *_entryrdn_encrypt_key(backend *be, const char *key, struct attrinfo *ai);
static char *_entryrdn_decrypt_key(backend *be, const char *key, struct attrinfo *ai);
#endif
-static int _entryrdn_get_elem(DBC *cursor, DBT *key, DBT *data, const char *comp_key, rdn_elem **elem);
-static int _entryrdn_get_tombstone_elem(DBC *cursor, Slapi_RDN *srdn, DBT *key, const char *comp_key, rdn_elem **elem);
+static int _entryrdn_get_elem(DBC *cursor, DBT *key, DBT *data, const char *comp_key, rdn_elem **elem, DB_TXN *db_txn);
+static int _entryrdn_get_tombstone_elem(DBC *cursor, Slapi_RDN *srdn, DBT *key, const char *comp_key, rdn_elem **elem, DB_TXN *db_txn);
static int _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn);
static int _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn);
static int _entryrdn_insert_key(backend *be, DBC *cursor, Slapi_RDN *srdn, ID id, DB_TXN *db_txn);
static int _entryrdn_insert_key_elems(backend *be, DBC *cursor, Slapi_RDN *srdn, DBT *key, rdn_elem *elem, rdn_elem *childelem, size_t childelemlen, DB_TXN *db_txn);
static int _entryrdn_delete_key(backend *be, DBC *cursor, Slapi_RDN *srdn, ID id, DB_TXN *db_txn);
static int _entryrdn_index_read(backend *be, DBC *cursor, Slapi_RDN *srdn, rdn_elem **elem, rdn_elem **parentelem, rdn_elem ***childelems, int flags, DB_TXN *db_txn);
-static int _entryrdn_append_childidl(DBC *cursor, const char *nrdn, ID id, IDList **affectedidl);
+static int _entryrdn_append_childidl(DBC *cursor, const char *nrdn, ID id, IDList **affectedidl, DB_TXN *db_txn);
static void _entryrdn_cursor_print_error(char *fn, void *key, size_t need, size_t actual, int rc);
static int entryrdn_warning_on_encryption = 1;
@@ -1074,6 +1074,9 @@ entryrdn_get_subordinates(backend *be,
rc = _entryrdn_index_read(be, cursor, &srdn, &elem,
NULL, &childelems, 0/*flags*/, db_txn);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ goto bail;
+ }
for (cep = childelems; cep && *cep; cep++) {
ID childid = id_stored_to_internal((*cep)->rdn_elem_id);
@@ -1088,7 +1091,7 @@ entryrdn_get_subordinates(backend *be,
/* set indirect subordinates to the idlist */
rc = _entryrdn_append_childidl(cursor, (*cep)->rdn_elem_nrdn_rdn,
- childid, subordinates);
+ childid, subordinates, db_txn);
if (rc) {
slapi_log_error(SLAPI_LOG_FATAL, ENTRYRDN_TAG,
"entryrdn_get_subordinates: Appending %d to idl "
@@ -1255,13 +1258,16 @@ retry_get0:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock\n");
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) { /* could be a suffix or
note: no parent for suffix */
slapi_ch_free_string(&keybuf);
@@ -1273,13 +1279,15 @@ retry_get1:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: retry cursor get deadlock\n");
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND != rc) {
_entryrdn_cursor_print_error("entryrdn_lookup_dn",
key.data, data.size, data.ulen, rc);
@@ -1465,13 +1473,15 @@ retry_get0:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock\n");
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) { /* could be a suffix
note: no parent for suffix */
slapi_ch_free_string(&keybuf);
@@ -1483,13 +1493,15 @@ retry_get1:
rc = cursor->c_get(cursor, &key, &data, DB_SET);
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "entryrdn_get_parent: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: cursor get deadlock while under txn -> failure\n");
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "entryrdn_get_parent: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND != rc) {
_entryrdn_cursor_print_error("entryrdn_get_parent",
key.data, data.size, data.ulen, rc);
@@ -1773,7 +1785,8 @@ _entryrdn_get_elem(DBC *cursor,
DBT *key,
DBT *data,
const char *comp_key,
- rdn_elem **elem)
+ rdn_elem **elem,
+ DB_TXN *db_txn)
{
int rc = 0;
void *ptr = NULL;
@@ -1795,13 +1808,15 @@ retry_get:
*elem = (rdn_elem *)data->data;
if (rc) {
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_elem: cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock while under txn -> failure\n");
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_elem: cursor get deadlock\n");
+ /* try again */
+ goto retry_get;
+ }
} else if (DB_BUFFER_SMALL == rc) {
/* try again */
data->flags = DB_DBT_MALLOC;
@@ -1837,7 +1852,8 @@ _entryrdn_get_tombstone_elem(DBC *cursor,
Slapi_RDN *srdn,
DBT *key,
const char *comp_key,
- rdn_elem **elem)
+ rdn_elem **elem,
+ DB_TXN *db_txn)
{
int rc = 0;
DBT data;
@@ -1868,13 +1884,17 @@ _entryrdn_get_tombstone_elem(DBC *cursor,
retry_get0:
rc = cursor->c_get(cursor, key, &data, DB_SET|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_tombstone_elem: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock\n");
+ goto retry_get0;
+ }
+
} else if (DB_NOTFOUND == rc) {
rc = 0; /* Child not found is ok */
goto bail;
@@ -1923,13 +1943,16 @@ retry_get0:
retry_get1:
rc = cursor->c_get(cursor, key, &data, DB_NEXT_DUP|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- /* try again */
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_get_tombstone_elem: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ /* try again */
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_get_tombstone_elem: retry cursor get deadlock\n");
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
goto bail; /* done */
@@ -2561,11 +2584,18 @@ _entryrdn_insert_key(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the suffix element */
- rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, &elem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, &elem, db_txn);
if (rc) {
const char *myrdn = slapi_rdn_get_nrdn(srdn);
const char **ep = NULL;
int isexception = 0;
+
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ goto bail;
+ }
/* Check the RDN is in the exception list */
for (ep = rdn_exceptions; ep && *ep; ep++) {
if (!strcmp(*ep, myrdn)) {
@@ -2668,10 +2698,15 @@ _entryrdn_insert_key(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the child element */
- rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem, db_txn);
if (rc) {
slapi_ch_free((void **)&tmpelem);
- if (DB_NOTFOUND == rc) {
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_insert_key: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", childnrdn, dblayer_strerror(rc), rc);
+ goto bail;
+ } else if (DB_NOTFOUND == rc) {
/* if 0 == rdnidx, Child is a Leaf RDN to be added */
if (0 == rdnidx) {
/* keybuf (C#) is consumed in _entryrdn_insert_key_elems */
@@ -2696,7 +2731,7 @@ _entryrdn_insert_key(backend *be,
* latter case.
*/
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn, &key,
- childnrdn, &tmpelem);
+ childnrdn, &tmpelem, db_txn);
if (rc) {
char *dn = NULL;
slapi_rdn_get_dn(tmpsrdn, &dn);
@@ -2860,13 +2895,16 @@ _entryrdn_delete_key(backend *be,
while (!done) {
rc = cursor->c_get(cursor, &key, &data, DB_SET|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_delete_key: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- continue;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock\n");
+ /* try again */
+ continue;
+ }
} else if (DB_NOTFOUND == rc) {
/* no children; ok */
done = 1;
@@ -2902,13 +2940,16 @@ _entryrdn_delete_key(backend *be,
retry_get:
rc = cursor->c_get(cursor, &key, &data, DB_NEXT_DUP|DB_MULTIPLE);
if (DB_LOCK_DEADLOCK == rc) {
- slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
- "_entryrdn_delete_key: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get;
+ if (db_txn) {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: cursor get deadlock while under txn -> failure\n");
+ goto bail;
+ } else {
+ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
+ "_entryrdn_delete_key: retry cursor get deadlock\n");
+ /* try again */
+ goto retry_get;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
done = 1;
@@ -2994,7 +3035,7 @@ retry_get:
/* Position cursor at the matching key */
rc = _entryrdn_get_elem(cursor, &key, &data,
- slapi_rdn_get_nrdn(tmpsrdn), &elem);
+ slapi_rdn_get_nrdn(tmpsrdn), &elem, db_txn);
if (tmpsrdn != srdn) {
slapi_rdn_free(&tmpsrdn);
}
@@ -3202,13 +3243,20 @@ _entryrdn_index_read(backend *be,
data.flags = DB_DBT_USERMEM;
/* getting the suffix element */
- rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, elem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, elem, db_txn);
if (rc || NULL == *elem) {
slapi_ch_free((void **)elem);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
+ "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ slapi_rdn_free(&tmpsrdn);
+ goto bail;
+ }
if (flags & TOMBSTONE_INCLUDED) {
/* Node might be a tombstone. */
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn,
- &key, nrdn, elem);
+ &key, nrdn, elem, db_txn);
rdnidx--; /* consider nsuniqueid=..,<RDN> one RDN */
}
if (rc || NULL == *elem) {
@@ -3289,9 +3337,18 @@ _entryrdn_index_read(backend *be,
data.flags = DB_DBT_USERMEM;
/* Position cursor at the matching key */
- rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem);
+ rc = _entryrdn_get_elem(cursor, &key, &data, childnrdn, &tmpelem, db_txn);
if (rc) {
slapi_ch_free((void **)&tmpelem);
+ if ((rc == DB_LOCK_DEADLOCK) && db_txn) {
+ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG,
+ "_entryrdn_index_read: Suffix \"%s\" cursor get fails: "
+ "%s(%d)\n", nrdn, dblayer_strerror(rc), rc);
+ if (tmpsrdn != srdn) {
+ slapi_rdn_free(&tmpsrdn);
+ }
+ goto bail;
+ }
if (flags & TOMBSTONE_INCLUDED) {
/* Node might be a tombstone */
/*
@@ -3301,7 +3358,7 @@ _entryrdn_index_read(backend *be,
* nsuniqueid=...,cn=A,nsuniqueid=...,ou=B,o=C
*/
rc = _entryrdn_get_tombstone_elem(cursor, tmpsrdn, &key,
- childnrdn, &tmpelem);
+ childnrdn, &tmpelem, db_txn);
if (rc || (NULL == tmpelem)) {
slapi_ch_free((void **)&tmpelem);
if (DB_NOTFOUND != rc) {
@@ -3383,11 +3440,12 @@ retry_get0:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_index_read: cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get0;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* Child not found is ok */
goto bail;
@@ -3427,11 +3485,13 @@ retry_get1:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_index_read: retry cursor get deadlock\n");
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- /* try again */
- goto retry_get1;
+
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0;
goto bail; /* done */
@@ -3457,7 +3517,8 @@ static int
_entryrdn_append_childidl(DBC *cursor,
const char *nrdn,
ID id,
- IDList **affectedidl)
+ IDList **affectedidl,
+ DB_TXN *db_txn)
{
/* E.g., C5 */
char *keybuf = slapi_ch_smprintf("%c%u", RDN_INDEX_CHILD, id);
@@ -3483,11 +3544,12 @@ retry_get0:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_append_childidl: cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get0;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get0;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* okay not to have children */
} else {
@@ -3522,7 +3584,7 @@ retry_get0:
}
rc = _entryrdn_append_childidl(cursor,
(const char *)myelem->rdn_elem_nrdn_rdn,
- myid, affectedidl);
+ myid, affectedidl, db_txn);
if (rc) {
goto bail;
}
@@ -3533,11 +3595,12 @@ retry_get1:
if (DB_LOCK_DEADLOCK == rc) {
slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG,
"_entryrdn_append_childidl: retry cursor get deadlock\n");
- /* try again */
-#ifdef FIX_TXN_DEADLOCKS
-#error if txn != NULL, have to retry the entire transaction
-#endif
- goto retry_get1;
+ if (db_txn) {
+ goto bail;
+ } else {
+ /* try again */
+ goto retry_get1;
+ }
} else if (DB_NOTFOUND == rc) {
rc = 0; /* okay not to have children */
} else {
9 years, 10 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Noriko Hosoi
ldap/servers/plugins/replication/urp.c | 3
ldap/servers/plugins/replication/urp.h | 2
ldap/servers/plugins/replication/urp_glue.c | 2
ldap/servers/plugins/replication/urp_tombstone.c | 59 +++++++++-----
ldap/servers/slapd/add.c | 2
ldap/servers/slapd/attrlist.c | 7 +
ldap/servers/slapd/back-ldbm/cache.c | 91 ++++++++++++++++++-----
ldap/servers/slapd/back-ldbm/ldbm_add.c | 35 +++++++-
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 66 ++++++++++++++--
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 2
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 54 +++++++++++--
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 3
ldap/servers/slapd/dn.c | 6 +
ldap/servers/slapd/rdn.c | 22 ++++-
ldap/servers/slapd/slapi-plugin.h | 4 -
15 files changed, 288 insertions(+), 70 deletions(-)
New commits:
commit 513788ce60ef4f3742bfdb5442a92887735367c9
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 24 16:39:24 2014 -0700
Ticket #47834 - Tombstone_to_glue: if parents are also converted to glue, the target entry's DN must be adjusted.
Bug description: tombstone_to_glue resolves parents recursively if
they are also a tombstone entry, which may change the DN of the
target entry, but the DN change was not adjusted.
Fix description: Added a new argument newparentdn to tombstone_to_
glue_resolve_parent to return the new parent DN if it has been updated.
If a new parent DN is returned, set it to the target DN.
This patch also adds a cache debugging function: check_entry_cache,
which is disabled by default (in #ifdef CACHE_DEBUG)
Note: this bug is a left over of ticket #47750.
https://fedorahosted.org/389/ticket/47834
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit 708a56b8d524131362e2d71b7fbc2eb257075e14)
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
index d867274..c7d60e2 100644
--- a/ldap/servers/plugins/replication/urp.c
+++ b/ldap/servers/plugins/replication/urp.c
@@ -966,7 +966,8 @@ urp_add_resolve_parententry (Slapi_PBlock *pb, char *sessionid, Slapi_Entry *ent
if(is_tombstone_entry(parententry)) /* The parent is a tombstone */
{
/* The parent entry must be resurected from the dead. */
- ldap_rc = tombstone_to_glue (pb, sessionid, parententry, parentdn, REASON_RESURRECT_ENTRY, opcsn);
+ /* parentdn retrieved from entry is not tombstone dn. */
+ ldap_rc = tombstone_to_glue (pb, sessionid, parententry, parentdn, REASON_RESURRECT_ENTRY, opcsn, NULL);
if ( ldap_rc != LDAP_SUCCESS )
{
ldap_rc= LDAP_OPERATIONS_ERROR;
diff --git a/ldap/servers/plugins/replication/urp.h b/ldap/servers/plugins/replication/urp.h
index 8afd7d1..678a2cc 100644
--- a/ldap/servers/plugins/replication/urp.h
+++ b/ldap/servers/plugins/replication/urp.h
@@ -79,6 +79,6 @@ PRBool get_glue_csn(const Slapi_Entry *entry, const CSN **gluecsn);
* urp_tombstone.c
*/
int is_tombstone_entry(const Slapi_Entry* entry);
-int tombstone_to_glue(Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry, const Slapi_DN *parentdn, const char *reason, CSN *opcsn);
+int tombstone_to_glue(Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry, const Slapi_DN *parentdn, const char *reason, CSN *opcsn, Slapi_DN **newparentdn);
int entry_to_tombstone ( Slapi_PBlock *pb, Slapi_Entry *entry );
PRBool get_tombstone_csn(const Slapi_Entry *entry, const CSN **delcsn);
diff --git a/ldap/servers/plugins/replication/urp_glue.c b/ldap/servers/plugins/replication/urp_glue.c
index 199d4de..a13c0be 100644
--- a/ldap/servers/plugins/replication/urp_glue.c
+++ b/ldap/servers/plugins/replication/urp_glue.c
@@ -230,7 +230,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char
slapi_pblock_get( pb, SLAPI_BACKEND, &backend );
slapi_sdn_get_backend_parent ( dn, superiordn, backend );
- slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(dn), 1/* skip nsuniqeid=..., in dn */);
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(dn), SLAPI_RDN_SET_DN_SKIP_UNIQUEID);
while(!done)
{
diff --git a/ldap/servers/plugins/replication/urp_tombstone.c b/ldap/servers/plugins/replication/urp_tombstone.c
index 5a37ca8..db7fa00 100644
--- a/ldap/servers/plugins/replication/urp_tombstone.c
+++ b/ldap/servers/plugins/replication/urp_tombstone.c
@@ -87,17 +87,18 @@ tombstone_to_glue_resolve_parent (
char *sessionid,
const Slapi_DN *parentdn,
const char *parentuniqueid,
- CSN *opcsn)
+ CSN *opcsn,
+ Slapi_DN **newparentdn)
{
/* Let's have a look at the parent of this entry... */
if(!slapi_sdn_isempty(parentdn) && parentuniqueid!=NULL)
{
int op_result;
- Slapi_PBlock *newpb= slapi_pblock_new();
- slapi_search_internal_set_pb(
- newpb,
- slapi_sdn_get_dn(parentdn), /* JCM - This DN just identifies the backend to be searched. */
- LDAP_SCOPE_BASE,
+ Slapi_PBlock *newpb= slapi_pblock_new();
+ slapi_search_internal_set_pb(
+ newpb,
+ slapi_sdn_get_dn(parentdn), /* JCM - This DN just identifies the backend to be searched. */
+ LDAP_SCOPE_BASE,
"objectclass=*",
NULL, /*attrs*/
0, /*attrsonly*/
@@ -106,7 +107,7 @@ tombstone_to_glue_resolve_parent (
repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
0);
slapi_search_internal_pb(newpb);
- slapi_pblock_get(newpb, SLAPI_PLUGIN_INTOP_RESULT, &op_result);
+ slapi_pblock_get(newpb, SLAPI_PLUGIN_INTOP_RESULT, &op_result);
switch(op_result)
{
case LDAP_SUCCESS:
@@ -118,7 +119,8 @@ tombstone_to_glue_resolve_parent (
{
if(is_tombstone_entry(entries[0]))
{
- tombstone_to_glue (pb, sessionid, entries[0], parentdn, REASON_RESURRECT_ENTRY, opcsn);
+ tombstone_to_glue(pb, sessionid, entries[0], parentdn,
+ REASON_RESURRECT_ENTRY, opcsn, newparentdn);
}
}
else
@@ -146,14 +148,16 @@ tombstone_to_glue (
Slapi_PBlock *pb,
char *sessionid,
Slapi_Entry *tombstoneentry,
- const Slapi_DN *tombstonedn,
+ const Slapi_DN *gluedn, /* does not start with uniqueid= */
const char *reason,
- CSN *opcsn)
+ CSN *opcsn,
+ Slapi_DN **newparentdn)
{
Slapi_DN *parentdn;
char *parentuniqueid;
const char *tombstoneuniqueid;
- Slapi_Entry *addingentry;
+ Slapi_Entry *addingentry = NULL;
+ Slapi_Entry *addingentry_bakup = NULL;
const char *addingdn;
int op_result;
int rdn_is_conflict = 0;
@@ -164,23 +168,35 @@ tombstone_to_glue (
* must attach the entry to the Operation
*/
-
/* Resurrect the parent entry first */
/* JCM - This DN calculation is odd. It could resolve to NULL
* which won't help us identify the correct backend to search.
*/
- is_suffix_dn_ext (pb, tombstonedn, &parentdn, 1 /* is_tombstone */);
- parentuniqueid= slapi_entry_attr_get_charptr (tombstoneentry, SLAPI_ATTR_VALUE_PARENT_UNIQUEID); /* Allocated */
- tombstone_to_glue_resolve_parent (pb, sessionid, parentdn, parentuniqueid, opcsn);
+ is_suffix_dn_ext (pb, gluedn, &parentdn, 1 /* is_tombstone */);
+ parentuniqueid = slapi_entry_attr_get_charptr (tombstoneentry, SLAPI_ATTR_VALUE_PARENT_UNIQUEID); /* Allocated */
+ tombstone_to_glue_resolve_parent (pb, sessionid, parentdn, parentuniqueid, opcsn, newparentdn);
/* Submit an Add operation to turn the tombstone entry into glue. */
/*
* The tombstone is stored with an invalid DN, we must fix this.
*/
addingentry = slapi_entry_dup(tombstoneentry);
- addingdn = slapi_sdn_get_dn(tombstonedn);
- slapi_entry_set_sdn(addingentry, tombstonedn);
+
+ if (newparentdn && *newparentdn && slapi_sdn_compare(parentdn, *newparentdn)) {
+ /* If the parents are resolved, the tombstone's DN is going to be different... */
+ /* Update DN in addingentry */
+ Slapi_RDN *rdn = slapi_rdn_new();
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(gluedn), SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID);
+ addingdn = slapi_moddn_get_newdn(slapi_entry_get_sdn(addingentry), slapi_rdn_get_rdn(rdn),
+ slapi_sdn_get_dn(*newparentdn));
+ slapi_rdn_free(&rdn);
+ slapi_sdn_init_normdn_passin(*newparentdn, addingdn); /* to return the new parentdn to the caller */
+ } else {
+ slapi_sdn_free(newparentdn); /* no change in parentdn; returning NULL */
+ addingdn = slapi_sdn_get_dn(gluedn);
+ }
+ slapi_sdn_set_normdn_byval(slapi_entry_get_sdn(addingentry), addingdn);
/* not just e_sdn, e_rsdn needs to be updated. */
slapi_rdn_set_all_dn(slapi_entry_get_srdn(addingentry), slapi_entry_get_dn_const(addingentry));
rdn_is_conflict = slapi_rdn_is_conflict(slapi_entry_get_srdn(addingentry));
@@ -198,6 +214,7 @@ tombstone_to_glue (
* tombstoneentry from DB/entry cache is duplicated and turned to be a glue.
* This addingentry is freed in op_shared_add.
*/
+ addingentry_bakup = slapi_entry_dup(addingentry);
op_result = urp_fixup_add_entry (addingentry, tombstoneuniqueid, slapi_ch_strdup(parentuniqueid), opcsn, OP_FLAG_RESURECT_ENTRY);
if ((LDAP_ALREADY_EXISTS == op_result) && !rdn_is_conflict) {
/* conflict -- there's already the same named entry added.
@@ -207,7 +224,8 @@ tombstone_to_glue (
* */
char *conflictrdn = get_rdn_plus_uniqueid(sessionid, addingdn, tombstoneuniqueid);
if (conflictrdn) {
- addingentry = slapi_entry_dup(tombstoneentry);
+ addingentry = addingentry_bakup;
+ addingentry_bakup = NULL;
if (!slapi_entry_attr_hasvalue(addingentry, ATTR_NSDS5_REPLCONFLICT, reason)) {
/* Add the reason of turning it to glue - The backend code will use it*/
slapi_entry_add_string(addingentry, ATTR_NSDS5_REPLCONFLICT, reason);
@@ -223,15 +241,16 @@ tombstone_to_glue (
addingentry = NULL;
}
}
+ slapi_entry_free(addingentry_bakup);
slapi_ch_free_string(&parentuniqueid);
if (op_result == LDAP_SUCCESS)
{
- slapi_log_error (slapi_log_urp, repl_plugin_name,
+ slapi_log_error (/*slapi_log_urp*/SLAPI_LOG_FATAL, repl_plugin_name,
"%s: Resurrected tombstone %s to glue reason '%s'\n", sessionid, addingdn, reason);
}
else if (LDAP_ALREADY_EXISTS == op_result)
{
- slapi_log_error(slapi_log_urp, repl_plugin_name,
+ slapi_log_error(/*slapi_log_urp*/SLAPI_LOG_FATAL, repl_plugin_name,
"%s: No need to turn tombstone %s to glue; it was already resurrected.\n",
sessionid, addingdn);
op_result = LDAP_SUCCESS;
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 875ad22..170e28b 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -732,9 +732,9 @@ static void op_shared_add (Slapi_PBlock *pb)
if (be->be_add != NULL)
{
- rc = (*be->be_add)(pb);
/* backend may change this if errors and not consumed */
slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &save_e);
+ rc = (*be->be_add)(pb);
slapi_pblock_set(pb, SLAPI_ADD_ENTRY, ec);
if (rc == 0)
{
diff --git a/ldap/servers/slapd/attrlist.c b/ldap/servers/slapd/attrlist.c
index 8825e2b..6743bde 100644
--- a/ldap/servers/slapd/attrlist.c
+++ b/ldap/servers/slapd/attrlist.c
@@ -312,6 +312,13 @@ int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals)
(*a)->a_flags |= SLAPI_ATTR_FLAG_NORMALIZED_CES;
}
rc = attr_replace(*a, values);
+ if (rc) {
+ slapi_log_error(SLAPI_LOG_FATAL, "attrlist_replace",
+ "attr_replace (%s, %s) failed.\n",
+ type, vals[0]->bv_val);
+ valuearray_free(&values);
+ slapi_attr_free(a);
+ }
}
return rc;
}
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 0309fcf..0732415 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -47,6 +47,7 @@
#ifdef DEBUG
#define LDAP_CACHE_DEBUG
/* #define LDAP_CACHE_DEBUG_LRU * causes slowdown */
+/* #define CACHE_DEBUG * causes slowdown */
#endif
/* cache can't get any smaller than this (in bytes) */
@@ -1341,14 +1342,14 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state,
{
if (my_alt->ep_state & ENTRY_STATE_CREATING)
{
- LOG("the entry %s is reserved (ep_state: 0x%x, state: 0x%x\n", ndn, e->ep_state, state);
+ LOG("the entry %s is reserved (ep_state: 0x%x, state: 0x%x)\n", ndn, e->ep_state, state);
e->ep_state |= ENTRY_STATE_NOTINCACHE;
PR_Unlock(cache->c_mutex);
return -1;
}
else if (state != 0)
{
- LOG("the entry %s already exists. cannot reserve it. (ep_state: 0x%x, state: 0x%x\n",
+ LOG("the entry %s already exists. cannot reserve it. (ep_state: 0x%x, state: 0x%x)\n",
ndn, e->ep_state, state);
e->ep_state |= ENTRY_STATE_NOTINCACHE;
PR_Unlock(cache->c_mutex);
@@ -1519,20 +1520,20 @@ int cache_lock_entry(struct cache *cache, struct backentry *e)
LOG("=> cache_lock_entry (%s)\n", backentry_get_ndn(e), 0, 0);
if (! e->ep_mutexp) {
- /* make sure only one thread does this */
- PR_Lock(cache->c_emutexalloc_mutex);
- if (! e->ep_mutexp) {
- e->ep_mutexp = PR_NewMonitor();
- if (!e->ep_mutexp) {
- LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0);
- LDAPDebug1Arg(LDAP_DEBUG_ANY,
- "cache_lock_entry: failed to create a lock for %s\n",
- backentry_get_ndn(e));
- LOG("<= cache_lock_entry (FAILED)\n", 0, 0, 0);
- return 1;
- }
- }
- PR_Unlock(cache->c_emutexalloc_mutex);
+ /* make sure only one thread does this */
+ PR_Lock(cache->c_emutexalloc_mutex);
+ if (! e->ep_mutexp) {
+ e->ep_mutexp = PR_NewMonitor();
+ if (!e->ep_mutexp) {
+ LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0);
+ LDAPDebug1Arg(LDAP_DEBUG_ANY,
+ "cache_lock_entry: failed to create a lock for %s\n",
+ backentry_get_ndn(e));
+ LOG("<= cache_lock_entry (FAILED)\n", 0, 0, 0);
+ return 1;
+ }
+ }
+ PR_Unlock(cache->c_emutexalloc_mutex);
}
/* wait on entry lock (done w/o holding the cache lock) */
@@ -2018,3 +2019,61 @@ dn_lru_verify(struct cache *cache, struct backdn *dn, int in)
ASSERT(is_in == in);
}
#endif
+
+#ifdef CACHE_DEBUG
+void
+check_entry_cache(struct cache *cache, struct backentry *e, int in_cache)
+{
+ Slapi_DN *sdn = slapi_entry_get_sdn(e->ep_entry);
+ struct backentry *debug_e = cache_find_dn(cache,
+ slapi_sdn_get_dn(sdn),
+ slapi_sdn_get_ndn_len(sdn));
+ if (in_cache) {
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "entry 0x%p is not in dn cache but 0x%p having the same dn %s is "
+ "although in_cache flag is set!!!\n",
+ e, debug_e, slapi_sdn_get_dn(sdn));
+ }
+ } else if (!(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "%s (id %d) is not in dn cache although in_cache flag is set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ debug_e = cache_find_id(cache, e->ep_id);
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "entry 0x%p is not in id cache but 0x%p having the same id %d is "
+ "although in_cache flag is set!!!\n",
+ e, debug_e, e->ep_id);
+ }
+ } else {
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "%s (id %d) is not in id cache although in_cache flag is set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ } else {
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if (e == debug_e) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "%s (id %d) is in dn cache although in_cache flag is not set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ }
+ debug_e = cache_find_id(cache, e->ep_id);
+ if (debug_e) { /* e is in cache: bad */
+ CACHE_RETURN(cache, &debug_e);
+ if (e == debug_e) {
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "%s (id %d) is in id cache although in_cache flag is not set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ }
+ }
+}
+#endif
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c
index 0a7d006..a22fce4 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_add.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c
@@ -119,7 +119,13 @@ ldbm_back_add( Slapi_PBlock *pb )
int not_an_error = 0;
int parent_switched = 0;
int noabort = 1;
-
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e );
slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot );
@@ -811,6 +817,9 @@ ldbm_back_add( Slapi_PBlock *pb )
retval = parent_update_on_childchange(&parent_modify_c,
is_resurect_operation?PARENTUPDATE_RESURECT:PARENTUPDATE_ADD,
NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
/* The modify context now contains info needed later */
if (retval) {
LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, "parent_update_on_childchange: %s, rc=%d\n",
@@ -970,6 +979,9 @@ ldbm_back_add( Slapi_PBlock *pb )
if (parent_found) {
/* Push out the db modifications from the parent entry */
retval = modify_update_all(be,pb,&parent_modify_c,&txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
LDAPDebug( LDAP_DEBUG_ARGS, "add 6 DEADLOCK\n", 0, 0, 0 );
@@ -1098,8 +1110,13 @@ ldbm_back_add( Slapi_PBlock *pb )
if (parent_found)
{
/* switch the parent entry copy into play */
- modify_switch_entries(&parent_modify_c,be);
- parent_switched = 1;
+ myrc = modify_switch_entries(&parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ if (0 == myrc) {
+ parent_switched = 1;
+ }
}
if (ruv_c_init) {
@@ -1179,13 +1196,16 @@ error_return:
} else if (0 == rc) {
rc = SLAPI_FAIL_GENERAL;
}
- if (parent_switched){
+ if (parent_switched) {
/*
* Restore the old parent entry, switch the new with the original.
* Otherwise the numsubordinate count will be off, and could later
* be written to disk.
*/
- modify_unswitch_entries( &parent_modify_c,be);
+ myrc = modify_unswitch_entries(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
}
diskfull_return:
if (disk_full) {
@@ -1282,7 +1302,10 @@ common_return:
if (ruv_c_init) {
modify_term(&ruv_c, be);
}
- modify_term(&parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry);
+ myrc = modify_term(&parent_modify_c,be);
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_DN_ENTRY);
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_UNIQUEID_ENTRY);
done_with_pblock_entry(pb,SLAPI_ADD_PARENT_ENTRY);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 3c29492..97c21eb 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -99,6 +99,14 @@ ldbm_back_delete( Slapi_PBlock *pb )
int opreturn = 0;
int free_delete_existing_entry = 0;
int not_an_error = 0;
+ int parent_switched = 0;
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
slapi_pblock_get( pb, SLAPI_BACKEND, &be);
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
@@ -292,8 +300,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
retval = slapi_entry_has_children(e->ep_entry);
if (retval) {
ldap_result_code= LDAP_NOT_ALLOWED_ON_NONLEAF;
- slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete", "Deleting entry %s has %d children.\n",
- slapi_entry_get_dn(e->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "conn=%lu op=%d Deleting entry %s has %d children.\n",
+ conn_id, op_id, slapi_entry_get_dn(e->ep_entry), retval);
retval = -1;
goto error_return;
}
@@ -539,6 +548,10 @@ ldbm_back_delete( Slapi_PBlock *pb )
op |= PARENTUPDATE_DELETE_TOMBSTONE;
}
retval = parent_update_on_childchange(&parent_modify_c, op, &haschildren);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
+
/* The modify context now contains info needed later */
if (0 != retval) {
ldap_result_code= LDAP_OPERATIONS_ERROR;
@@ -575,9 +588,11 @@ ldbm_back_delete( Slapi_PBlock *pb )
char *edn = slapi_entry_get_dn(e->ep_entry);
char *tombstone_dn;
Slapi_Value *tomb_value;
-
+
if (slapi_is_special_rdn(edn, RDN_IS_TOMBSTONE)) {
- LDAPDebug1Arg(LDAP_DEBUG_ANY, "Turning a tombstone into a tombstone! \"%s\"\n", edn);
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "conn=%lu op=%d Turning a tombstone into a tombstone! \"%s\"; e: 0x%p, cache_state: 0x%x, refcnt: %d\n",
+ conn_id, op_id, edn, e, e->ep_state, e->ep_refcnt);
ldap_result_code= LDAP_OPERATIONS_ERROR;
retval = -1;
goto error_return;
@@ -708,9 +723,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (0 == retval) {
tombstone_in_cache = 1;
} else {
- LDAPDebug2Args(LDAP_DEBUG_ANY,
- "tombstone entry %s failed to add to the cache: %d\n",
- slapi_entry_get_dn(tombstone->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "conn=%lu op=%d tombstone entry %s failed to add to the cache: %d\n",
+ conn_id, op_id, slapi_entry_get_dn(tombstone->ep_entry), retval);
tombstone_in_cache = 0;
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
DEL_SET_ERROR(ldap_result_code,
@@ -1107,6 +1122,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (parent_found) {
/* Push out the db modifications from the parent entry */
retval = modify_update_all(be,pb,&parent_modify_c,&txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
LDAPDebug( LDAP_DEBUG_BACKLDBM, "del 4 DEADLOCK\n", 0, 0, 0 );
@@ -1256,7 +1274,13 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (parent_found)
{
/* Replace the old parent entry with the newly modified one */
- modify_switch_entries( &parent_modify_c,be);
+ myrc = modify_switch_entries( &parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ if (myrc == 0) {
+ parent_switched = 1;
+ }
}
rc= 0;
@@ -1271,6 +1295,9 @@ error_return:
CACHE_RETURN(&inst->inst_dncache, &bdn);
}
}
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, tombstone, tombstone_in_cache);
+#endif
if (tombstone_in_cache) { /* successfully replaced */
CACHE_REMOVE( &inst->inst_cache, tombstone );
CACHE_RETURN( &inst->inst_cache, &tombstone );
@@ -1283,6 +1310,9 @@ error_return:
/* Need to return to cache after post op plugins are called */
if (e) {
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, e, e_in_cache);
+#endif
if (e_in_cache) {
if (remove_e_from_cache) {
/* The entry is already transformed to a tombstone. */
@@ -1346,7 +1376,17 @@ error_return:
/* txn is no longer valid - reset the txn pointer to the parent */
slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
}
-
+ if (parent_switched) {
+ /*
+ * Restore the old parent entry, switch the new with the original.
+ * Otherwise the numsubordinate count will be off, and could later
+ * be written to disk.
+ */
+ myrc = modify_unswitch_entries(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ }
common_return:
if (orig_entry) {
/* NOTE: #define SLAPI_DELETE_BEPREOP_ENTRY SLAPI_ENTRY_PRE_OP */
@@ -1374,6 +1414,9 @@ common_return:
}
}
}
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, tombstone, tombstone_in_cache);
+#endif
if (tombstone_in_cache) { /* successfully replaced */
CACHE_RETURN( &inst->inst_cache, &tombstone );
tombstone = NULL;
@@ -1408,7 +1451,10 @@ diskfull_return:
}
slapi_send_ldap_result( pb, ldap_result_code, NULL, ldap_result_message, 0, NULL );
}
- modify_term(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p, in_cache=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, parent_modify_c.new_entry_in_cache);
+ myrc = modify_term(&parent_modify_c, be);
if (rc == 0 && opcsn && !is_fixup_operation && !delete_tombstone_entry)
{
/* URP Naming Collision
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index 8791b45..6f2da15 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -140,7 +140,7 @@ modify_unswitch_entries(modify_context *mc,backend *be)
ldbm_instance *inst = (ldbm_instance *) be->be_instance_info;
int ret = 0;
- if (mc->old_entry!=NULL && mc->new_entry!=NULL) {
+ if (mc->old_entry && mc->new_entry && mc->new_entry_in_cache) {
/* switch the entries, and reset the new, new, entry */
tmp_be = mc->new_entry;
mc->new_entry = mc->old_entry;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index 57590cb..8b86a14 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -123,6 +123,13 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
int opreturn = 0;
int free_modrdn_existing_entry = 0;
int not_an_error = 0;
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
/* sdn & parentsdn need to be initialized before "goto *_return" */
slapi_sdn_init(&dn_newdn);
@@ -263,6 +270,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
slapi_sdn_free(&dn_newsuperiordn);
slapi_pblock_set(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, orig_dn_newsuperiordn);
orig_dn_newsuperiordn = slapi_sdn_dup(orig_dn_newsuperiordn);
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, ec, ec_in_cache);
+#endif
if (ec_in_cache) {
/* New entry 'ec' is in the entry cache.
* Remove it from the cache . */
@@ -747,7 +757,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
ldap_result_code= LDAP_ALREADY_EXISTS;
if (is_resurect_operation) {
slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_modrdn",
- "cache_add_tentative failed: %s\n", slapi_entry_get_dn(ec->ep_entry));
+ "conn=%lu op=%d cache_add_tentative failed: %s\n",
+ conn_id, op_id, slapi_entry_get_dn(ec->ep_entry));
}
goto error_return;
}
@@ -890,6 +901,10 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (parententry) {
retval = parent_update_on_childchange(&parent_modify_context,
PARENTUPDATE_DEL, NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
+
/* The parent modify context now contains info needed later */
if (retval) {
goto error_return;
@@ -898,6 +913,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (newparententry) {
retval = parent_update_on_childchange(&newparent_modify_context,
PARENTUPDATE_ADD, NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
/* The newparent modify context now contains info needed later */
if (retval) {
goto error_return;
@@ -908,9 +926,11 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (is_resurect_operation && parententry) {
retval = parent_update_on_childchange(&parent_modify_context, PARENTUPDATE_RESURECT, NULL);
if (retval) {
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "parent_update_on_childchange parent %s of %s failed, rc=%d\n",
- slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry),
- slapi_entry_get_dn_const(ec->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange parent %s of %s failed, rc=%d\n",
+ conn_id, op_id,
+ slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry),
+ slapi_entry_get_dn_const(ec->ep_entry), retval);
goto error_return;
}
}
@@ -1096,6 +1116,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
else /* retval == 0 */
{
retval = modify_update_all(be, pb, &newparent_modify_context, &txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
/* Retry txn */
@@ -1223,7 +1246,10 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
}
if(newparententry!=NULL)
{
- modify_switch_entries( &newparent_modify_context,be);
+ myrc = modify_switch_entries( &newparent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, myrc);
}
slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, postentry );
@@ -1446,6 +1472,9 @@ common_return:
}
/* remove the new entry from the cache if the op failed -
otherwise, leave it in */
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, ec, ec_in_cache);
+#endif
if (ec_in_cache && ec && inst) {
if (retval) {
CACHE_REMOVE( &inst->inst_cache, ec );
@@ -1467,7 +1496,7 @@ common_return:
if (inst->inst_ref_count) {
slapi_counter_decrement(inst->inst_ref_count);
}
- }
+ }
moddn_unlock_and_return_entry(be,&e);
@@ -1496,8 +1525,16 @@ common_return:
slapi_sdn_done(&dn_newdn);
slapi_sdn_done(&dn_newrdn);
slapi_sdn_done(&dn_parentdn);
- modify_term(&parent_modify_context,be);
- modify_term(&newparent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry);
+ myrc = modify_term(&parent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: rc=%d\n", conn_id, op_id, myrc);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, newparent_modify_context.old_entry, newparent_modify_context.new_entry);
+ myrc = modify_term(&newparent_modify_context,be);
if (free_modrdn_existing_entry) {
done_with_pblock_entry(pb,SLAPI_MODRDN_EXISTING_ENTRY);
} else { /* owned by original_entry */
@@ -1906,6 +1943,7 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm
retval= -1;
goto error_return;
}
+ *e_in_cache = 0;
if (orig_ec_in_cache) {
/* ec was already added to the cache via cache_add_tentative (to reserve its spot in the cache)
and/or id2entry_add - so it already had one refcount - cache_replace adds another refcount -
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index 0fc8025..240ece6 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -87,6 +87,9 @@ int cache_add_tentative(struct cache *cache, struct backentry *e,
int cache_lock_entry(struct cache *cache, struct backentry *e);
void cache_unlock_entry(struct cache *cache, struct backentry *e);
int cache_replace(struct cache *cache, void *oldptr, void *newptr);
+#ifdef CACHE_DEBUG
+void check_entry_cache(struct cache *cache, struct backentry *e, int in_cache);
+#endif
Hashtable *new_hash(u_long size, u_long offset, HashFn hfn,
HashTestFn tfn);
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index cea593b..d10715e 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -2481,6 +2481,12 @@ slapi_sdn_get_rdn(const Slapi_DN *sdn,Slapi_RDN *rdn)
slapi_rdn_set_dn(rdn, slapi_sdn_get_dn(sdn));
}
+void
+slapi_sdn_get_rdn_ext(const Slapi_DN *sdn, Slapi_RDN *rdn, int is_tombstone)
+{
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(sdn), is_tombstone);
+}
+
Slapi_DN *
slapi_sdn_dup(const Slapi_DN *sdn)
{
diff --git a/ldap/servers/slapd/rdn.c b/ldap/servers/slapd/rdn.c
index 6e40ed8..d56c143 100644
--- a/ldap/servers/slapd/rdn.c
+++ b/ldap/servers/slapd/rdn.c
@@ -324,15 +324,29 @@ slapi_rdn_init_rdn(Slapi_RDN *rdn,const Slapi_RDN *fromrdn)
rdn->rdn= slapi_ch_strdup(fromrdn->rdn);
}
+/*
+ * flags:
+ * SLAPI_RDN_SET_DN_SKIP_UNIQUEID -- strip uniqueid, and set to rdn
+ * SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID -- set <uniqueid,rdn> to rdn
+ */
void
-slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int skip_tombstone)
+slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int flags)
{
const char *mydn = dn;
slapi_rdn_done(rdn);
- if (skip_tombstone && slapi_is_special_rdn(dn, RDN_IS_TOMBSTONE)) {
- mydn = dn + slapi_uniqueIDRdnSize() + 1/*,*/;
+ if (flags && slapi_is_special_rdn(dn, RDN_IS_TOMBSTONE)) {
+ if (SLAPI_RDN_SET_DN_SKIP_UNIQUEID == flags) {
+ mydn = dn + slapi_uniqueIDRdnSize() + 1/*,*/;
+ slapi_rdn_init_dn(rdn, mydn);
+ } else if (SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID == flags) {
+ Slapi_DN sdn = {0};
+ slapi_sdn_set_dn_byval(&sdn, dn);
+ _slapi_rdn_init_all_dn_ext(rdn, (const Slapi_DN *)&sdn, 1);
+ slapi_sdn_done(&sdn);
+ }
+ } else {
+ slapi_rdn_init_dn(rdn, mydn);
}
- slapi_rdn_init_dn(rdn, mydn);
}
void
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index af4508f..d482dff 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -3137,7 +3137,9 @@ void slapi_rdn_init_rdn(Slapi_RDN *rdn,const Slapi_RDN *fromrdn);
* \see slapi_rdn_set_rdn()
*/
void slapi_rdn_set_dn(Slapi_RDN *rdn,const char *dn);
-void slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int skip_tombstone);
+#define SLAPI_RDN_SET_DN_SKIP_UNIQUEID 1
+#define SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID 2
+void slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int flags);
Slapi_RDN *slapi_rdn_new_all_dn(const char *dn);
int slapi_rdn_init_all_dn(Slapi_RDN *rdn, const char *dn);
int slapi_rdn_init_all_sdn(Slapi_RDN *rdn, const Slapi_DN *sdn);
9 years, 10 months
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/replication/urp.c | 3
ldap/servers/plugins/replication/urp.h | 2
ldap/servers/plugins/replication/urp_glue.c | 2
ldap/servers/plugins/replication/urp_tombstone.c | 59 +++++++++-----
ldap/servers/slapd/add.c | 2
ldap/servers/slapd/attrlist.c | 7 +
ldap/servers/slapd/back-ldbm/cache.c | 91 ++++++++++++++++++-----
ldap/servers/slapd/back-ldbm/ldbm_add.c | 35 +++++++-
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 66 ++++++++++++++--
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 2
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 54 +++++++++++--
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 3
ldap/servers/slapd/dn.c | 6 +
ldap/servers/slapd/rdn.c | 22 ++++-
ldap/servers/slapd/slapi-plugin.h | 4 -
15 files changed, 288 insertions(+), 70 deletions(-)
New commits:
commit 708a56b8d524131362e2d71b7fbc2eb257075e14
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 24 16:39:24 2014 -0700
Ticket #47834 - Tombstone_to_glue: if parents are also converted to glue, the target entry's DN must be adjusted.
Bug description: tombstone_to_glue resolves parents recursively if
they are also a tombstone entry, which may change the DN of the
target entry, but the DN change was not adjusted.
Fix description: Added a new argument newparentdn to tombstone_to_
glue_resolve_parent to return the new parent DN if it has been updated.
If a new parent DN is returned, set it to the target DN.
This patch also adds a cache debugging function: check_entry_cache,
which is disabled by default (in #ifdef CACHE_DEBUG)
Note: this bug is a left over of ticket #47750.
https://fedorahosted.org/389/ticket/47834
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
index cecf95c..032cc94 100644
--- a/ldap/servers/plugins/replication/urp.c
+++ b/ldap/servers/plugins/replication/urp.c
@@ -966,7 +966,8 @@ urp_add_resolve_parententry (Slapi_PBlock *pb, char *sessionid, Slapi_Entry *ent
if(is_tombstone_entry(parententry)) /* The parent is a tombstone */
{
/* The parent entry must be resurected from the dead. */
- ldap_rc = tombstone_to_glue (pb, sessionid, parententry, parentdn, REASON_RESURRECT_ENTRY, opcsn);
+ /* parentdn retrieved from entry is not tombstone dn. */
+ ldap_rc = tombstone_to_glue (pb, sessionid, parententry, parentdn, REASON_RESURRECT_ENTRY, opcsn, NULL);
if ( ldap_rc != LDAP_SUCCESS )
{
ldap_rc= LDAP_OPERATIONS_ERROR;
diff --git a/ldap/servers/plugins/replication/urp.h b/ldap/servers/plugins/replication/urp.h
index 8afd7d1..678a2cc 100644
--- a/ldap/servers/plugins/replication/urp.h
+++ b/ldap/servers/plugins/replication/urp.h
@@ -79,6 +79,6 @@ PRBool get_glue_csn(const Slapi_Entry *entry, const CSN **gluecsn);
* urp_tombstone.c
*/
int is_tombstone_entry(const Slapi_Entry* entry);
-int tombstone_to_glue(Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry, const Slapi_DN *parentdn, const char *reason, CSN *opcsn);
+int tombstone_to_glue(Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry, const Slapi_DN *parentdn, const char *reason, CSN *opcsn, Slapi_DN **newparentdn);
int entry_to_tombstone ( Slapi_PBlock *pb, Slapi_Entry *entry );
PRBool get_tombstone_csn(const Slapi_Entry *entry, const CSN **delcsn);
diff --git a/ldap/servers/plugins/replication/urp_glue.c b/ldap/servers/plugins/replication/urp_glue.c
index 199d4de..a13c0be 100644
--- a/ldap/servers/plugins/replication/urp_glue.c
+++ b/ldap/servers/plugins/replication/urp_glue.c
@@ -230,7 +230,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char
slapi_pblock_get( pb, SLAPI_BACKEND, &backend );
slapi_sdn_get_backend_parent ( dn, superiordn, backend );
- slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(dn), 1/* skip nsuniqeid=..., in dn */);
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(dn), SLAPI_RDN_SET_DN_SKIP_UNIQUEID);
while(!done)
{
diff --git a/ldap/servers/plugins/replication/urp_tombstone.c b/ldap/servers/plugins/replication/urp_tombstone.c
index 5a37ca8..db7fa00 100644
--- a/ldap/servers/plugins/replication/urp_tombstone.c
+++ b/ldap/servers/plugins/replication/urp_tombstone.c
@@ -87,17 +87,18 @@ tombstone_to_glue_resolve_parent (
char *sessionid,
const Slapi_DN *parentdn,
const char *parentuniqueid,
- CSN *opcsn)
+ CSN *opcsn,
+ Slapi_DN **newparentdn)
{
/* Let's have a look at the parent of this entry... */
if(!slapi_sdn_isempty(parentdn) && parentuniqueid!=NULL)
{
int op_result;
- Slapi_PBlock *newpb= slapi_pblock_new();
- slapi_search_internal_set_pb(
- newpb,
- slapi_sdn_get_dn(parentdn), /* JCM - This DN just identifies the backend to be searched. */
- LDAP_SCOPE_BASE,
+ Slapi_PBlock *newpb= slapi_pblock_new();
+ slapi_search_internal_set_pb(
+ newpb,
+ slapi_sdn_get_dn(parentdn), /* JCM - This DN just identifies the backend to be searched. */
+ LDAP_SCOPE_BASE,
"objectclass=*",
NULL, /*attrs*/
0, /*attrsonly*/
@@ -106,7 +107,7 @@ tombstone_to_glue_resolve_parent (
repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
0);
slapi_search_internal_pb(newpb);
- slapi_pblock_get(newpb, SLAPI_PLUGIN_INTOP_RESULT, &op_result);
+ slapi_pblock_get(newpb, SLAPI_PLUGIN_INTOP_RESULT, &op_result);
switch(op_result)
{
case LDAP_SUCCESS:
@@ -118,7 +119,8 @@ tombstone_to_glue_resolve_parent (
{
if(is_tombstone_entry(entries[0]))
{
- tombstone_to_glue (pb, sessionid, entries[0], parentdn, REASON_RESURRECT_ENTRY, opcsn);
+ tombstone_to_glue(pb, sessionid, entries[0], parentdn,
+ REASON_RESURRECT_ENTRY, opcsn, newparentdn);
}
}
else
@@ -146,14 +148,16 @@ tombstone_to_glue (
Slapi_PBlock *pb,
char *sessionid,
Slapi_Entry *tombstoneentry,
- const Slapi_DN *tombstonedn,
+ const Slapi_DN *gluedn, /* does not start with uniqueid= */
const char *reason,
- CSN *opcsn)
+ CSN *opcsn,
+ Slapi_DN **newparentdn)
{
Slapi_DN *parentdn;
char *parentuniqueid;
const char *tombstoneuniqueid;
- Slapi_Entry *addingentry;
+ Slapi_Entry *addingentry = NULL;
+ Slapi_Entry *addingentry_bakup = NULL;
const char *addingdn;
int op_result;
int rdn_is_conflict = 0;
@@ -164,23 +168,35 @@ tombstone_to_glue (
* must attach the entry to the Operation
*/
-
/* Resurrect the parent entry first */
/* JCM - This DN calculation is odd. It could resolve to NULL
* which won't help us identify the correct backend to search.
*/
- is_suffix_dn_ext (pb, tombstonedn, &parentdn, 1 /* is_tombstone */);
- parentuniqueid= slapi_entry_attr_get_charptr (tombstoneentry, SLAPI_ATTR_VALUE_PARENT_UNIQUEID); /* Allocated */
- tombstone_to_glue_resolve_parent (pb, sessionid, parentdn, parentuniqueid, opcsn);
+ is_suffix_dn_ext (pb, gluedn, &parentdn, 1 /* is_tombstone */);
+ parentuniqueid = slapi_entry_attr_get_charptr (tombstoneentry, SLAPI_ATTR_VALUE_PARENT_UNIQUEID); /* Allocated */
+ tombstone_to_glue_resolve_parent (pb, sessionid, parentdn, parentuniqueid, opcsn, newparentdn);
/* Submit an Add operation to turn the tombstone entry into glue. */
/*
* The tombstone is stored with an invalid DN, we must fix this.
*/
addingentry = slapi_entry_dup(tombstoneentry);
- addingdn = slapi_sdn_get_dn(tombstonedn);
- slapi_entry_set_sdn(addingentry, tombstonedn);
+
+ if (newparentdn && *newparentdn && slapi_sdn_compare(parentdn, *newparentdn)) {
+ /* If the parents are resolved, the tombstone's DN is going to be different... */
+ /* Update DN in addingentry */
+ Slapi_RDN *rdn = slapi_rdn_new();
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(gluedn), SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID);
+ addingdn = slapi_moddn_get_newdn(slapi_entry_get_sdn(addingentry), slapi_rdn_get_rdn(rdn),
+ slapi_sdn_get_dn(*newparentdn));
+ slapi_rdn_free(&rdn);
+ slapi_sdn_init_normdn_passin(*newparentdn, addingdn); /* to return the new parentdn to the caller */
+ } else {
+ slapi_sdn_free(newparentdn); /* no change in parentdn; returning NULL */
+ addingdn = slapi_sdn_get_dn(gluedn);
+ }
+ slapi_sdn_set_normdn_byval(slapi_entry_get_sdn(addingentry), addingdn);
/* not just e_sdn, e_rsdn needs to be updated. */
slapi_rdn_set_all_dn(slapi_entry_get_srdn(addingentry), slapi_entry_get_dn_const(addingentry));
rdn_is_conflict = slapi_rdn_is_conflict(slapi_entry_get_srdn(addingentry));
@@ -198,6 +214,7 @@ tombstone_to_glue (
* tombstoneentry from DB/entry cache is duplicated and turned to be a glue.
* This addingentry is freed in op_shared_add.
*/
+ addingentry_bakup = slapi_entry_dup(addingentry);
op_result = urp_fixup_add_entry (addingentry, tombstoneuniqueid, slapi_ch_strdup(parentuniqueid), opcsn, OP_FLAG_RESURECT_ENTRY);
if ((LDAP_ALREADY_EXISTS == op_result) && !rdn_is_conflict) {
/* conflict -- there's already the same named entry added.
@@ -207,7 +224,8 @@ tombstone_to_glue (
* */
char *conflictrdn = get_rdn_plus_uniqueid(sessionid, addingdn, tombstoneuniqueid);
if (conflictrdn) {
- addingentry = slapi_entry_dup(tombstoneentry);
+ addingentry = addingentry_bakup;
+ addingentry_bakup = NULL;
if (!slapi_entry_attr_hasvalue(addingentry, ATTR_NSDS5_REPLCONFLICT, reason)) {
/* Add the reason of turning it to glue - The backend code will use it*/
slapi_entry_add_string(addingentry, ATTR_NSDS5_REPLCONFLICT, reason);
@@ -223,15 +241,16 @@ tombstone_to_glue (
addingentry = NULL;
}
}
+ slapi_entry_free(addingentry_bakup);
slapi_ch_free_string(&parentuniqueid);
if (op_result == LDAP_SUCCESS)
{
- slapi_log_error (slapi_log_urp, repl_plugin_name,
+ slapi_log_error (/*slapi_log_urp*/SLAPI_LOG_FATAL, repl_plugin_name,
"%s: Resurrected tombstone %s to glue reason '%s'\n", sessionid, addingdn, reason);
}
else if (LDAP_ALREADY_EXISTS == op_result)
{
- slapi_log_error(slapi_log_urp, repl_plugin_name,
+ slapi_log_error(/*slapi_log_urp*/SLAPI_LOG_FATAL, repl_plugin_name,
"%s: No need to turn tombstone %s to glue; it was already resurrected.\n",
sessionid, addingdn);
op_result = LDAP_SUCCESS;
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 875ad22..170e28b 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -732,9 +732,9 @@ static void op_shared_add (Slapi_PBlock *pb)
if (be->be_add != NULL)
{
- rc = (*be->be_add)(pb);
/* backend may change this if errors and not consumed */
slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &save_e);
+ rc = (*be->be_add)(pb);
slapi_pblock_set(pb, SLAPI_ADD_ENTRY, ec);
if (rc == 0)
{
diff --git a/ldap/servers/slapd/attrlist.c b/ldap/servers/slapd/attrlist.c
index 8825e2b..6743bde 100644
--- a/ldap/servers/slapd/attrlist.c
+++ b/ldap/servers/slapd/attrlist.c
@@ -312,6 +312,13 @@ int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals)
(*a)->a_flags |= SLAPI_ATTR_FLAG_NORMALIZED_CES;
}
rc = attr_replace(*a, values);
+ if (rc) {
+ slapi_log_error(SLAPI_LOG_FATAL, "attrlist_replace",
+ "attr_replace (%s, %s) failed.\n",
+ type, vals[0]->bv_val);
+ valuearray_free(&values);
+ slapi_attr_free(a);
+ }
}
return rc;
}
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 0309fcf..0732415 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -47,6 +47,7 @@
#ifdef DEBUG
#define LDAP_CACHE_DEBUG
/* #define LDAP_CACHE_DEBUG_LRU * causes slowdown */
+/* #define CACHE_DEBUG * causes slowdown */
#endif
/* cache can't get any smaller than this (in bytes) */
@@ -1341,14 +1342,14 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state,
{
if (my_alt->ep_state & ENTRY_STATE_CREATING)
{
- LOG("the entry %s is reserved (ep_state: 0x%x, state: 0x%x\n", ndn, e->ep_state, state);
+ LOG("the entry %s is reserved (ep_state: 0x%x, state: 0x%x)\n", ndn, e->ep_state, state);
e->ep_state |= ENTRY_STATE_NOTINCACHE;
PR_Unlock(cache->c_mutex);
return -1;
}
else if (state != 0)
{
- LOG("the entry %s already exists. cannot reserve it. (ep_state: 0x%x, state: 0x%x\n",
+ LOG("the entry %s already exists. cannot reserve it. (ep_state: 0x%x, state: 0x%x)\n",
ndn, e->ep_state, state);
e->ep_state |= ENTRY_STATE_NOTINCACHE;
PR_Unlock(cache->c_mutex);
@@ -1519,20 +1520,20 @@ int cache_lock_entry(struct cache *cache, struct backentry *e)
LOG("=> cache_lock_entry (%s)\n", backentry_get_ndn(e), 0, 0);
if (! e->ep_mutexp) {
- /* make sure only one thread does this */
- PR_Lock(cache->c_emutexalloc_mutex);
- if (! e->ep_mutexp) {
- e->ep_mutexp = PR_NewMonitor();
- if (!e->ep_mutexp) {
- LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0);
- LDAPDebug1Arg(LDAP_DEBUG_ANY,
- "cache_lock_entry: failed to create a lock for %s\n",
- backentry_get_ndn(e));
- LOG("<= cache_lock_entry (FAILED)\n", 0, 0, 0);
- return 1;
- }
- }
- PR_Unlock(cache->c_emutexalloc_mutex);
+ /* make sure only one thread does this */
+ PR_Lock(cache->c_emutexalloc_mutex);
+ if (! e->ep_mutexp) {
+ e->ep_mutexp = PR_NewMonitor();
+ if (!e->ep_mutexp) {
+ LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0);
+ LDAPDebug1Arg(LDAP_DEBUG_ANY,
+ "cache_lock_entry: failed to create a lock for %s\n",
+ backentry_get_ndn(e));
+ LOG("<= cache_lock_entry (FAILED)\n", 0, 0, 0);
+ return 1;
+ }
+ }
+ PR_Unlock(cache->c_emutexalloc_mutex);
}
/* wait on entry lock (done w/o holding the cache lock) */
@@ -2018,3 +2019,61 @@ dn_lru_verify(struct cache *cache, struct backdn *dn, int in)
ASSERT(is_in == in);
}
#endif
+
+#ifdef CACHE_DEBUG
+void
+check_entry_cache(struct cache *cache, struct backentry *e, int in_cache)
+{
+ Slapi_DN *sdn = slapi_entry_get_sdn(e->ep_entry);
+ struct backentry *debug_e = cache_find_dn(cache,
+ slapi_sdn_get_dn(sdn),
+ slapi_sdn_get_ndn_len(sdn));
+ if (in_cache) {
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "entry 0x%p is not in dn cache but 0x%p having the same dn %s is "
+ "although in_cache flag is set!!!\n",
+ e, debug_e, slapi_sdn_get_dn(sdn));
+ }
+ } else if (!(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "%s (id %d) is not in dn cache although in_cache flag is set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ debug_e = cache_find_id(cache, e->ep_id);
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "entry 0x%p is not in id cache but 0x%p having the same id %d is "
+ "although in_cache flag is set!!!\n",
+ e, debug_e, e->ep_id);
+ }
+ } else {
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "%s (id %d) is not in id cache although in_cache flag is set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ } else {
+ if (debug_e) { /* e is in cache */
+ CACHE_RETURN(cache, &debug_e);
+ if (e == debug_e) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "%s (id %d) is in dn cache although in_cache flag is not set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ }
+ debug_e = cache_find_id(cache, e->ep_id);
+ if (debug_e) { /* e is in cache: bad */
+ CACHE_RETURN(cache, &debug_e);
+ if (e == debug_e) {
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "%s (id %d) is in id cache although in_cache flag is not set!!!\n",
+ slapi_sdn_get_dn(sdn), e->ep_id);
+ }
+ }
+ }
+}
+#endif
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c
index 63fccb1..598cd8e 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_add.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c
@@ -120,7 +120,13 @@ ldbm_back_add( Slapi_PBlock *pb )
int not_an_error = 0;
int parent_switched = 0;
int noabort = 1;
-
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e );
slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot );
@@ -813,6 +819,9 @@ ldbm_back_add( Slapi_PBlock *pb )
retval = parent_update_on_childchange(&parent_modify_c,
is_resurect_operation?PARENTUPDATE_RESURECT:PARENTUPDATE_ADD,
NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
/* The modify context now contains info needed later */
if (retval) {
LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, "parent_update_on_childchange: %s, rc=%d\n",
@@ -972,6 +981,9 @@ ldbm_back_add( Slapi_PBlock *pb )
if (parent_found) {
/* Push out the db modifications from the parent entry */
retval = modify_update_all(be,pb,&parent_modify_c,&txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
LDAPDebug( LDAP_DEBUG_ARGS, "add 6 DEADLOCK\n", 0, 0, 0 );
@@ -1100,8 +1112,13 @@ ldbm_back_add( Slapi_PBlock *pb )
if (parent_found)
{
/* switch the parent entry copy into play */
- modify_switch_entries(&parent_modify_c,be);
- parent_switched = 1;
+ myrc = modify_switch_entries(&parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ if (0 == myrc) {
+ parent_switched = 1;
+ }
}
if (ruv_c_init) {
@@ -1181,13 +1198,16 @@ error_return:
} else if (0 == rc) {
rc = SLAPI_FAIL_GENERAL;
}
- if (parent_switched){
+ if (parent_switched) {
/*
* Restore the old parent entry, switch the new with the original.
* Otherwise the numsubordinate count will be off, and could later
* be written to disk.
*/
- modify_unswitch_entries( &parent_modify_c,be);
+ myrc = modify_unswitch_entries(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
}
diskfull_return:
if (disk_full) {
@@ -1287,7 +1307,10 @@ common_return:
if (ruv_c_init) {
modify_term(&ruv_c, be);
}
- modify_term(&parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry);
+ myrc = modify_term(&parent_modify_c,be);
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_DN_ENTRY);
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_UNIQUEID_ENTRY);
done_with_pblock_entry(pb,SLAPI_ADD_PARENT_ENTRY);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 3c29492..97c21eb 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -99,6 +99,14 @@ ldbm_back_delete( Slapi_PBlock *pb )
int opreturn = 0;
int free_delete_existing_entry = 0;
int not_an_error = 0;
+ int parent_switched = 0;
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
slapi_pblock_get( pb, SLAPI_BACKEND, &be);
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
@@ -292,8 +300,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
retval = slapi_entry_has_children(e->ep_entry);
if (retval) {
ldap_result_code= LDAP_NOT_ALLOWED_ON_NONLEAF;
- slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete", "Deleting entry %s has %d children.\n",
- slapi_entry_get_dn(e->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "conn=%lu op=%d Deleting entry %s has %d children.\n",
+ conn_id, op_id, slapi_entry_get_dn(e->ep_entry), retval);
retval = -1;
goto error_return;
}
@@ -539,6 +548,10 @@ ldbm_back_delete( Slapi_PBlock *pb )
op |= PARENTUPDATE_DELETE_TOMBSTONE;
}
retval = parent_update_on_childchange(&parent_modify_c, op, &haschildren);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
+
/* The modify context now contains info needed later */
if (0 != retval) {
ldap_result_code= LDAP_OPERATIONS_ERROR;
@@ -575,9 +588,11 @@ ldbm_back_delete( Slapi_PBlock *pb )
char *edn = slapi_entry_get_dn(e->ep_entry);
char *tombstone_dn;
Slapi_Value *tomb_value;
-
+
if (slapi_is_special_rdn(edn, RDN_IS_TOMBSTONE)) {
- LDAPDebug1Arg(LDAP_DEBUG_ANY, "Turning a tombstone into a tombstone! \"%s\"\n", edn);
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "conn=%lu op=%d Turning a tombstone into a tombstone! \"%s\"; e: 0x%p, cache_state: 0x%x, refcnt: %d\n",
+ conn_id, op_id, edn, e, e->ep_state, e->ep_refcnt);
ldap_result_code= LDAP_OPERATIONS_ERROR;
retval = -1;
goto error_return;
@@ -708,9 +723,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (0 == retval) {
tombstone_in_cache = 1;
} else {
- LDAPDebug2Args(LDAP_DEBUG_ANY,
- "tombstone entry %s failed to add to the cache: %d\n",
- slapi_entry_get_dn(tombstone->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete",
+ "conn=%lu op=%d tombstone entry %s failed to add to the cache: %d\n",
+ conn_id, op_id, slapi_entry_get_dn(tombstone->ep_entry), retval);
tombstone_in_cache = 0;
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
DEL_SET_ERROR(ldap_result_code,
@@ -1107,6 +1122,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (parent_found) {
/* Push out the db modifications from the parent entry */
retval = modify_update_all(be,pb,&parent_modify_c,&txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
LDAPDebug( LDAP_DEBUG_BACKLDBM, "del 4 DEADLOCK\n", 0, 0, 0 );
@@ -1256,7 +1274,13 @@ ldbm_back_delete( Slapi_PBlock *pb )
if (parent_found)
{
/* Replace the old parent entry with the newly modified one */
- modify_switch_entries( &parent_modify_c,be);
+ myrc = modify_switch_entries( &parent_modify_c,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ if (myrc == 0) {
+ parent_switched = 1;
+ }
}
rc= 0;
@@ -1271,6 +1295,9 @@ error_return:
CACHE_RETURN(&inst->inst_dncache, &bdn);
}
}
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, tombstone, tombstone_in_cache);
+#endif
if (tombstone_in_cache) { /* successfully replaced */
CACHE_REMOVE( &inst->inst_cache, tombstone );
CACHE_RETURN( &inst->inst_cache, &tombstone );
@@ -1283,6 +1310,9 @@ error_return:
/* Need to return to cache after post op plugins are called */
if (e) {
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, e, e_in_cache);
+#endif
if (e_in_cache) {
if (remove_e_from_cache) {
/* The entry is already transformed to a tombstone. */
@@ -1346,7 +1376,17 @@ error_return:
/* txn is no longer valid - reset the txn pointer to the parent */
slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
}
-
+ if (parent_switched) {
+ /*
+ * Restore the old parent entry, switch the new with the original.
+ * Otherwise the numsubordinate count will be off, and could later
+ * be written to disk.
+ */
+ myrc = modify_unswitch_entries(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc);
+ }
common_return:
if (orig_entry) {
/* NOTE: #define SLAPI_DELETE_BEPREOP_ENTRY SLAPI_ENTRY_PRE_OP */
@@ -1374,6 +1414,9 @@ common_return:
}
}
}
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, tombstone, tombstone_in_cache);
+#endif
if (tombstone_in_cache) { /* successfully replaced */
CACHE_RETURN( &inst->inst_cache, &tombstone );
tombstone = NULL;
@@ -1408,7 +1451,10 @@ diskfull_return:
}
slapi_send_ldap_result( pb, ldap_result_code, NULL, ldap_result_message, 0, NULL );
}
- modify_term(&parent_modify_c, be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p, in_cache=%d\n",
+ conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, parent_modify_c.new_entry_in_cache);
+ myrc = modify_term(&parent_modify_c, be);
if (rc == 0 && opcsn && !is_fixup_operation && !delete_tombstone_entry)
{
/* URP Naming Collision
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index 8791b45..6f2da15 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -140,7 +140,7 @@ modify_unswitch_entries(modify_context *mc,backend *be)
ldbm_instance *inst = (ldbm_instance *) be->be_instance_info;
int ret = 0;
- if (mc->old_entry!=NULL && mc->new_entry!=NULL) {
+ if (mc->old_entry && mc->new_entry && mc->new_entry_in_cache) {
/* switch the entries, and reset the new, new, entry */
tmp_be = mc->new_entry;
mc->new_entry = mc->old_entry;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index 09a1fea..622ad7a 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -124,6 +124,13 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
int free_modrdn_existing_entry = 0;
int not_an_error = 0;
int support_moddn_aci;
+ int myrc = 0;
+ PRUint64 conn_id;
+ int op_id;
+ if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
+ conn_id = 0; /* connection is NULL */
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id);
/* sdn & parentsdn need to be initialized before "goto *_return" */
slapi_sdn_init(&dn_newdn);
@@ -269,6 +276,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
slapi_sdn_free(&dn_newsuperiordn);
slapi_pblock_set(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, orig_dn_newsuperiordn);
orig_dn_newsuperiordn = slapi_sdn_dup(orig_dn_newsuperiordn);
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, ec, ec_in_cache);
+#endif
if (ec_in_cache) {
/* New entry 'ec' is in the entry cache.
* Remove it from the cache . */
@@ -780,7 +790,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
ldap_result_code= LDAP_ALREADY_EXISTS;
if (is_resurect_operation) {
slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_modrdn",
- "cache_add_tentative failed: %s\n", slapi_entry_get_dn(ec->ep_entry));
+ "conn=%lu op=%d cache_add_tentative failed: %s\n",
+ conn_id, op_id, slapi_entry_get_dn(ec->ep_entry));
}
goto error_return;
}
@@ -923,6 +934,10 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (parententry) {
retval = parent_update_on_childchange(&parent_modify_context,
PARENTUPDATE_DEL, NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
+
/* The parent modify context now contains info needed later */
if (retval) {
goto error_return;
@@ -931,6 +946,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (newparententry) {
retval = parent_update_on_childchange(&newparent_modify_context,
PARENTUPDATE_ADD, NULL);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
/* The newparent modify context now contains info needed later */
if (retval) {
goto error_return;
@@ -941,9 +959,11 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
if (is_resurect_operation && parententry) {
retval = parent_update_on_childchange(&parent_modify_context, PARENTUPDATE_RESURECT, NULL);
if (retval) {
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "parent_update_on_childchange parent %s of %s failed, rc=%d\n",
- slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry),
- slapi_entry_get_dn_const(ec->ep_entry), retval);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d parent_update_on_childchange parent %s of %s failed, rc=%d\n",
+ conn_id, op_id,
+ slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry),
+ slapi_entry_get_dn_const(ec->ep_entry), retval);
goto error_return;
}
}
@@ -1129,6 +1149,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
else /* retval == 0 */
{
retval = modify_update_all(be, pb, &newparent_modify_context, &txn);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval);
if (DB_LOCK_DEADLOCK == retval)
{
/* Retry txn */
@@ -1256,7 +1279,10 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
}
if(newparententry!=NULL)
{
- modify_switch_entries( &newparent_modify_context,be);
+ myrc = modify_switch_entries( &newparent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, myrc);
}
slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, postentry );
@@ -1479,6 +1505,9 @@ common_return:
}
/* remove the new entry from the cache if the op failed -
otherwise, leave it in */
+#ifdef CACHE_DEBUG
+ check_entry_cache(&inst->inst_cache, ec, ec_in_cache);
+#endif
if (ec_in_cache && ec && inst) {
if (retval) {
CACHE_REMOVE( &inst->inst_cache, ec );
@@ -1500,7 +1529,7 @@ common_return:
if (inst->inst_ref_count) {
slapi_counter_decrement(inst->inst_ref_count);
}
- }
+ }
moddn_unlock_and_return_entry(be,&e);
@@ -1529,8 +1558,16 @@ common_return:
slapi_sdn_done(&dn_newdn);
slapi_sdn_done(&dn_newrdn);
slapi_sdn_done(&dn_parentdn);
- modify_term(&parent_modify_context,be);
- modify_term(&newparent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry);
+ myrc = modify_term(&parent_modify_context,be);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: rc=%d\n", conn_id, op_id, myrc);
+ slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn",
+ "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n",
+ conn_id, op_id, newparent_modify_context.old_entry, newparent_modify_context.new_entry);
+ myrc = modify_term(&newparent_modify_context,be);
if (free_modrdn_existing_entry) {
done_with_pblock_entry(pb,SLAPI_MODRDN_EXISTING_ENTRY);
} else { /* owned by original_entry */
@@ -1939,6 +1976,7 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm
retval= -1;
goto error_return;
}
+ *e_in_cache = 0;
if (orig_ec_in_cache) {
/* ec was already added to the cache via cache_add_tentative (to reserve its spot in the cache)
and/or id2entry_add - so it already had one refcount - cache_replace adds another refcount -
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index 0de0632..333179a 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -88,6 +88,9 @@ int cache_add_tentative(struct cache *cache, struct backentry *e,
int cache_lock_entry(struct cache *cache, struct backentry *e);
void cache_unlock_entry(struct cache *cache, struct backentry *e);
int cache_replace(struct cache *cache, void *oldptr, void *newptr);
+#ifdef CACHE_DEBUG
+void check_entry_cache(struct cache *cache, struct backentry *e, int in_cache);
+#endif
Hashtable *new_hash(u_long size, u_long offset, HashFn hfn,
HashTestFn tfn);
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index cea593b..d10715e 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -2481,6 +2481,12 @@ slapi_sdn_get_rdn(const Slapi_DN *sdn,Slapi_RDN *rdn)
slapi_rdn_set_dn(rdn, slapi_sdn_get_dn(sdn));
}
+void
+slapi_sdn_get_rdn_ext(const Slapi_DN *sdn, Slapi_RDN *rdn, int is_tombstone)
+{
+ slapi_rdn_set_dn_ext(rdn, slapi_sdn_get_dn(sdn), is_tombstone);
+}
+
Slapi_DN *
slapi_sdn_dup(const Slapi_DN *sdn)
{
diff --git a/ldap/servers/slapd/rdn.c b/ldap/servers/slapd/rdn.c
index a77d086..e80a33b 100644
--- a/ldap/servers/slapd/rdn.c
+++ b/ldap/servers/slapd/rdn.c
@@ -324,15 +324,29 @@ slapi_rdn_init_rdn(Slapi_RDN *rdn,const Slapi_RDN *fromrdn)
rdn->rdn= slapi_ch_strdup(fromrdn->rdn);
}
+/*
+ * flags:
+ * SLAPI_RDN_SET_DN_SKIP_UNIQUEID -- strip uniqueid, and set to rdn
+ * SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID -- set <uniqueid,rdn> to rdn
+ */
void
-slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int skip_tombstone)
+slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int flags)
{
const char *mydn = dn;
slapi_rdn_done(rdn);
- if (skip_tombstone && slapi_is_special_rdn(dn, RDN_IS_TOMBSTONE)) {
- mydn = dn + slapi_uniqueIDRdnSize() + 1/*,*/;
+ if (flags && slapi_is_special_rdn(dn, RDN_IS_TOMBSTONE)) {
+ if (SLAPI_RDN_SET_DN_SKIP_UNIQUEID == flags) {
+ mydn = dn + slapi_uniqueIDRdnSize() + 1/*,*/;
+ slapi_rdn_init_dn(rdn, mydn);
+ } else if (SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID == flags) {
+ Slapi_DN sdn = {0};
+ slapi_sdn_set_dn_byval(&sdn, dn);
+ _slapi_rdn_init_all_dn_ext(rdn, (const Slapi_DN *)&sdn, 1);
+ slapi_sdn_done(&sdn);
+ }
+ } else {
+ slapi_rdn_init_dn(rdn, mydn);
}
- slapi_rdn_init_dn(rdn, mydn);
}
void
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 71d239a..9a84e6f 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -3163,7 +3163,9 @@ void slapi_rdn_init_rdn(Slapi_RDN *rdn,const Slapi_RDN *fromrdn);
* \see slapi_rdn_set_rdn()
*/
void slapi_rdn_set_dn(Slapi_RDN *rdn,const char *dn);
-void slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int skip_tombstone);
+#define SLAPI_RDN_SET_DN_SKIP_UNIQUEID 1
+#define SLAPI_RDN_SET_DN_INCLUDE_UNIQUEID 2
+void slapi_rdn_set_dn_ext(Slapi_RDN *rdn,const char *dn, int flags);
Slapi_RDN *slapi_rdn_new_all_dn(const char *dn);
int slapi_rdn_init_all_dn(Slapi_RDN *rdn, const char *dn);
int slapi_rdn_init_all_sdn(Slapi_RDN *rdn, const Slapi_DN *sdn);
9 years, 10 months
man/man1 man/man8
by Noriko Hosoi
man/man1/ds-logpipe.py.1 | 12 ++++++------
man/man1/logconv.pl.1 | 6 +++---
man/man1/repl-monitor.1 | 2 +-
man/man8/bak2db.8 | 6 +++---
man/man8/bak2db.pl.8 | 6 +++---
man/man8/cleanallruv.pl.8 | 6 +++---
man/man8/db2bak.8 | 4 ++--
man/man8/db2bak.pl.8 | 4 ++--
man/man8/db2index.8 | 8 ++++----
man/man8/db2index.pl.8 | 8 ++++----
man/man8/db2ldif.8 | 10 +++++-----
man/man8/db2ldif.pl.8 | 10 +++++-----
man/man8/dbverify.8 | 4 ++--
man/man8/dn2rdn.8 | 4 ++--
man/man8/fixup-linkedattrs.pl.8 | 6 +++---
man/man8/fixup-memberof.pl.8 | 6 +++---
man/man8/ldif2db.8 | 12 ++++++------
man/man8/ldif2db.pl.8 | 14 +++++++-------
man/man8/ldif2ldap.8 | 4 ++--
man/man8/monitor.8 | 6 +++---
man/man8/ns-accountstatus.pl.8 | 6 +++---
man/man8/ns-activate.pl.8 | 6 +++---
man/man8/ns-inactivate.pl.8 | 6 +++---
man/man8/ns-newpwpolicy.pl.8 | 6 +++---
man/man8/restoreconfig.8 | 4 ++--
man/man8/saveconfig.8 | 4 ++--
man/man8/schema-reload.pl.8 | 6 +++---
man/man8/suffix2instance.8 | 6 +++---
man/man8/syntax-validate.pl.8 | 6 +++---
man/man8/upgradedb.8 | 4 ++--
man/man8/upgradednformat.8 | 4 ++--
man/man8/usn-tombstone-cleanup.pl.8 | 4 ++--
man/man8/verify-db.pl.8 | 4 ++--
man/man8/vlvindex.8 | 4 ++--
34 files changed, 104 insertions(+), 104 deletions(-)
New commits:
commit d897574606afd418d73277eade6d52dfdcf19eac
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jul 10 16:35:02 2014 -0700
Ticket #47844 - Fix hyphens used as minus signed and other manpage mistakes
Description: Fix hyphons used as minus signed and other manpage mistakes.
Author: Benjamin Drung <benjamin.drung(a)profitbricks.com>
https://fedorahosted.org/389/ticket/47844
Reviewed by nhosoi(a)redhat.com
diff --git a/man/man1/ds-logpipe.py.1 b/man/man1/ds-logpipe.py.1
index e8f14b0..5b2d422 100644
--- a/man/man1/ds-logpipe.py.1
+++ b/man/man1/ds-logpipe.py.1
@@ -40,7 +40,7 @@ The script is written in python, and allows plugins. By default, the script will
A summary of options is included below.
.TP
.B /full/path/to/namedpipe
-Required - full path and file name of the named pipe. If this does not exist, it will be created. If it exists and is a named pipe, the script will use it. If it exists and is not a pipe, the script will abort. The ownership will be the same as the user running the script (or see the -u option below).
+Required - full path and file name of the named pipe. If this does not exist, it will be created. If it exists and is a named pipe, the script will use it. If it exists and is not a pipe, the script will abort. The ownership will be the same as the user running the script (or see the \-u option below).
.TP
.B \-m|\-\-maxlines=N
Number of lines to buffer - default is 1000
@@ -52,7 +52,7 @@ The pipe and any other files created by the script will be chown()'d to this use
If you want the script to exit when a particular directory server exists, specify the full path to the file containing the server pid. The default is usually something like /var/run/dirsrv/slapd-<instancename>.pid where <instancename> is usually the hostname
.TP
.B \-t|\-\-servertimeout=N
-Since the serverpidfile may not exist yet when the script is run, the script will wait by default 60 seconds for the pid file to exist and the server to be started. Use this option to specify a different timeout. The -t option only applies when using -s or --serverpid - otherwise it does nothing.
+Since the serverpidfile may not exist yet when the script is run, the script will wait by default 60 seconds for the pid file to exist and the server to be started. Use this option to specify a different timeout. The \-t option only applies when using \-s or \-\-serverpid - otherwise it does nothing.
.TP
.B \-\-serverpid=P
IF the server you want to track is already running, you can specify it using this argument. If the specified pid is not valid, the script will abort.
@@ -61,7 +61,7 @@ IF the server you want to track is already running, you can specify it using thi
Specify a plugin to use. The plugin must be a python file and must end in \fI.py\fR. It must specify a function called \fIplugin\fR and may specify functions called \fIpre\fR and \fIpost\fR.
.TP
.B pluginname.arg1=value ... pluginname.argN=value
-You can specify arguments to plugins on the command line. If there is a plugin specified as --plugin=/full/path/to/pluginname.py, the arguments for that plugin are specified as \fIpluginname.argname=value\fR. The script parses these arguments and passes them to the plugin \fIpre\fR function as a python dict. IF there is more than one argument named \fIpluginname.argname\fR the values are passed as a python list.
+You can specify arguments to plugins on the command line. If there is a plugin specified as \-\-plugin=/full/path/to/pluginname.py, the arguments for that plugin are specified as \fIpluginname.argname=value\fR. The script parses these arguments and passes them to the plugin \fIpre\fR function as a python dict. IF there is more than one argument named \fIpluginname.argname\fR the values are passed as a python list.
.SH DIRECTORY SERVER NOTES
The directory server will usually need to be configured to log to the named pipe instead of the usual log file. For example, use the following LDIF to tell the server to use the file \fIaccess.pipe\fR for the access log:
dn: cn=config
@@ -70,10 +70,10 @@ The directory server will usually need to be configured to log to the named pipe
nsslapd-accesslog-maxlogsperdir: 1
-
replace: nsslapd-accesslog-logexpirationtime
- nsslapd-accesslog-logexpirationtime: -1
+ nsslapd-accesslog-logexpirationtime: \-1
-
replace: nsslapd-accesslog-logrotationtime
- nsslapd-accesslog-logrotationtime: -1
+ nsslapd-accesslog-logrotationtime: \-1
-
replace: nsslapd-accesslog
nsslapd-accesslog: /var/log/dirsrv/slapd-localhost/access.pipe
@@ -82,7 +82,7 @@ The directory server will usually need to be configured to log to the named pipe
nsslapd-accesslog-logbuffering: off
NOTE: Before doing this, you should save your current configuration so you can restore it later.
- ldapsearch ... -s base -b "cn=config" nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-logexpirationtime \
+ ldapsearch ... \-s base \-b "cn=config" nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-logexpirationtime \
nsslapd-accesslog-logrotationtime nsslapd-accesslog nsslapd-accesslog > savedaccesslog.ldif
The error log and audit log have similarly named configuration attributes e.g. nsslapd-errorlog, nsslapd-auditlog. Note that the audit log is disabled by default - use nsslapd-auditlog-logging-enabled: on to enable it.
diff --git a/man/man1/logconv.pl.1 b/man/man1/logconv.pl.1
index e9c6245..915c8af 100644
--- a/man/man1/logconv.pl.1
+++ b/man/man1/logconv.pl.1
@@ -40,7 +40,7 @@ DEFAULT \-> /tmp
.br
TIP \-> If there is not enough RAM, a RAM disk can be used instead:
- mkdir /dev/shm/logconv, and use this directory for the "-D" value.
+ mkdir /dev/shm/logconv, and use this directory for the "\-D" value.
.TP
.B \fB\-s, \-\-sizeLimit\fR <Number of results to return per category>
DEFAULT \-> 20
@@ -53,11 +53,11 @@ Print version of the tool
.TP
.B \fB\-S, \-\-startTime\fR <time to begin analyzing logfile from>
Time to begin analyzing logfile from
-E.g. [28/Mar/2002:13:14:22 \f \-0800]\fR
+E.g. [28/Mar/2002:13:14:22 \fB\-0800]\fR
.TP
.B \fB\-E, \-\-endTime\fR <time to stop analyzing logfile>
Time to stop analyzing logfile from
-E.g. [28/Mar/2002:13:24:62 \f \-0800]\fR
+E.g. [28/Mar/2002:13:24:62 \fB\-0800]\fR
.TP
.B \fB\-T, \-\-minEtime\fR <minimum etime to report unindexed searches>
The minimum etime that is required to record and report on an unindexed search. Default is zero.
diff --git a/man/man1/repl-monitor.1 b/man/man1/repl-monitor.1
index bd0ede1..ab65638 100644
--- a/man/man1/repl-monitor.1
+++ b/man/man1/repl-monitor.1
@@ -19,7 +19,7 @@
repl-monitor \- Directory Server replication monitor
.SH SYNOPSIS
.B repl\(hymonitor
-\ [-f configuration\(hyfile] [\fI\(hyh host\fR] [\fI\-p port\fR] [\fI\-r\fR]
+\ [\-f configuration\(hyfile] [\fI\(hyh host\fR] [\fI\-p port\fR] [\fI\-r\fR]
[\fI\-c connection\fR] [\fI\-a alias\fR] [\fI\-k color\fR] [\fI\-u refresh\(hyurl\fR]
[\fI\-s\fR] [\fI\-t refresh\(hyinterval\fR] [\fI\-v\fR]
diff --git a/man/man8/bak2db.8 b/man/man8/bak2db.8
index 2e930a6..0642ac7 100644
--- a/man/man8/bak2db.8
+++ b/man/man8/bak2db.8
@@ -18,7 +18,7 @@
.SH NAME
bak2db - Directory Server script for restoring a backup
.SH SYNOPSIS
-bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]
+bak2db archivedir [\-Z serverID] [\-n backendname] [\-q] | [\-h]
.SH DESCRIPTION
Restores the database from a archived backup. The Directory Server must be stopped prior to running this script.
.SH OPTIONS
@@ -42,9 +42,9 @@ Quiet mode. Reduces output of task.
.br
Display the usage.
.SH EXAMPLE
-bak2db /LDAP/backups/20130305/ -Z instance1 -n userRoot
+bak2db /LDAP/backups/20130305/ \-Z instance1 \-n userRoot
-bak2db /LDAP/backups/20130305/ -n example
+bak2db /LDAP/backups/20130305/ \-n example
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
diff --git a/man/man8/bak2db.pl.8 b/man/man8/bak2db.pl.8
index 92e4746..cbf8421 100644
--- a/man/man8/bak2db.pl.8
+++ b/man/man8/bak2db.pl.8
@@ -18,7 +18,7 @@
.SH NAME
bak2db.pl - Directory Server perl script for restoring a backup
.SH SYNOPSIS
-bak2db.pl -a archivedir [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-t dbtype] [-n backendname] [-P protocol] [-v] [-h]
+bak2db.pl \-a archivedir [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-t dbtype] [\-n backendname] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Restores a database from a backup. The Directory Server must be started prior to running this script.
.SH OPTIONS
@@ -65,11 +65,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-bak2db.pl -a /LDAP/backups/20130305/ -D 'cn=directory manager' -w password -n userRoot -P LDAPS
+bak2db.pl \-a /LDAP/backups/20130305/ \-D 'cn=directory manager' \-w password \-n userRoot \-P LDAPS
Note: security must be enabled to use protocol LDAPS. If LDAPS is not available it will default to next strongest/available protocol automatically.
.TP
-bak2db.pl -a /LDAP/backups/20130305/ -Z instance2 -w password -n example -P LDAPI
+bak2db.pl \-a /LDAP/backups/20130305/ \-Z instance2 \-w password \-n example \-P LDAPI
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/cleanallruv.pl.8 b/man/man8/cleanallruv.pl.8
index 241b799..10c647d 100644
--- a/man/man8/cleanallruv.pl.8
+++ b/man/man8/cleanallruv.pl.8
@@ -18,7 +18,7 @@
.SH NAME
cleanallruv.pl - Directory Server perl script for issuing a cleanAllRUV task
.SH SYNOPSIS
-cleanallruv.pl [-v] [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -b basedn -r rid [-A] [-P protocol] [-h]
+cleanallruv.pl [\-v] [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } \-b basedn \-r rid [\-A] [\-P protocol] [\-h]
.SH DESCRIPTION
Creates and adds a cleanAllRUV task to the Directory Server
.SH OPTIONS
@@ -68,11 +68,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-cleanallruv.pl -Z instance1 -D 'cn=directory manager' -j /tmp/pw.txt -b 'dc=example,dc=com' -r 87 -P STARTTLS
+cleanallruv.pl \-Z instance1 \-D 'cn=directory manager' \-j /tmp/pw.txt \-b 'dc=example,dc=com' \-r 87 \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.TP
-cleanallruv.pl -j /export/rootdnpw.txt -b 'dc=example,dc=com' -A -r 87
+cleanallruv.pl \-j /export/rootdnpw.txt \-b 'dc=example,dc=com' \-A \-r 87
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/db2bak.8 b/man/man8/db2bak.8
index fab587d..0c2f05b 100644
--- a/man/man8/db2bak.8
+++ b/man/man8/db2bak.8
@@ -18,7 +18,7 @@
.SH NAME
db2bak - Directory Server script for making a backup of the database
.SH SYNOPSIS
-db2bak [archivedir] [-Z serverID] [-q] [-h]
+db2bak [archivedir] [\-Z serverID] [\-q] [\-h]
.SH DESCRIPTION
Creates a backup of the database. This script can be executed while the server is running or stopped.
.SH OPTIONS
@@ -40,7 +40,7 @@ Quiet mode. Reduces output of task.
Display the usage.
.SH EXAMPLE
.TP
-db2bak -Z instance2
+db2bak \-Z instance2
Makes a backup of the entire database for 'instance2', and stores it in the default server instance backup directory.
.TP
diff --git a/man/man8/db2bak.pl.8 b/man/man8/db2bak.pl.8
index df6af3d..510c84d 100644
--- a/man/man8/db2bak.pl.8
+++ b/man/man8/db2bak.pl.8
@@ -18,7 +18,7 @@
.SH NAME
db2bak.pl - Directory Server perl script for creating a backup
.SH SYNOPSIS
-db2bak.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-t dbtype] [-a backupdir] [-P protocol] [-v] [-h]
+db2bak.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-t dbtype] [\-a backupdir] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Creates a backup of the Directory Server database. The
Directory Server must be started prior to running this script.
@@ -63,7 +63,7 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-db2bak.pl -Z instance1 -D 'cn=directory manager' -w password -a /LDAP/backups/20130305 -P LDAPI
+db2bak.pl \-Z instance1 \-D 'cn=directory manager' \-w password \-a /LDAP/backups/20130305 \-P LDAPI
Note: LDAPI must be enabled to use this protocol. If LDAPI is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/db2index.8 b/man/man8/db2index.8
index 369f2d9..2839b03 100644
--- a/man/man8/db2index.8
+++ b/man/man8/db2index.8
@@ -18,7 +18,7 @@
.SH NAME
db2index - Directory Server script for indexing attributes
.SH SYNOPSIS
-db2index [-Z serverID] [-n backend | {-s includeSuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvTag] [-h]
+db2index [\-Z serverID] [\-n backend | {\-s includeSuffix}* \-t attribute[:indextypes[:matchingrules]] \-T vlvTag] [\-h]
.SH DESCRIPTION
Reindexes the database index files. The Directory Server must be stopped prior to running this script.
.SH OPTIONS
@@ -46,11 +46,11 @@ This is the name of the vlv index entry under cn=config.
Display the usage.
.SH EXAMPLE
.TP
-db2index -n userRoot -t uid:eq,sub:1.3.6.1.4.1.42.2.27.9.4.76.1 -t cn:eq,pres
+db2index \-n userRoot \-t uid:eq,sub:1.3.6.1.4.1.42.2.27.9.4.76.1 \-t cn:eq,pres
.TP
-db2index -Z instance2 -s 'dc=example,dc=com' -t uid:eq:pres:sub -t sn
+db2index \-Z instance2 \-s 'dc=example,dc=com' \-t uid:eq:pres:sub \-t sn
.TP
-db2index -Z instance3
+db2index \-Z instance3
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/db2index.pl.8 b/man/man8/db2index.pl.8
index 3df7aba..f768947 100644
--- a/man/man8/db2index.pl.8
+++ b/man/man8/db2index.pl.8
@@ -18,7 +18,7 @@
.SH NAME
db2index.pl - Directory Server perl script for indexing a database
.SH SYNOPSIS
-db2index.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-n backendname] [-P protocol] [-t attributeName[:indextypes[:matchingrules]]] [-T vlvTag] [-v] [-h]
+db2index.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-n backendname] [\-P protocol] [\-t attributeName[:indextypes[:matchingrules]]] [\-T vlvTag] [\-v] [\-h]
.SH DESCRIPTION
Indexes attributes in the specified database. If no attributes are specified, then all the attribute indexes will be regenerated. The Directory Server must be started prior to running this script.
.SH OPTIONS
@@ -66,11 +66,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-db2index.pl -n userRoot -D 'cn=directory manager' -w password -t uid:eq,pres,sub:1.3.6.1.4.1.42.2.27.9.4.76.1 -t cn:eq,pres
+db2index.pl \-n userRoot \-D 'cn=directory manager' \-w password \-t uid:eq,pres,sub:1.3.6.1.4.1.42.2.27.9.4.76.1 \-t cn:eq,pres
.TP
-db2index.pl -Z instance3
+db2index.pl \-Z instance3
.TP
-db2index.pl -Z instance2 -w password -s 'dc=example,dc=com' -t uid:eq:pres:sub -t sn -P STARTTLS
+db2index.pl \-Z instance2 \-w password \-s 'dc=example,dc=com' \-t uid:eq:pres:sub \-t sn \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/db2ldif.8 b/man/man8/db2ldif.8
index cc19cf4..0c6d3e0 100644
--- a/man/man8/db2ldif.8
+++ b/man/man8/db2ldif.8
@@ -18,9 +18,9 @@
.SH NAME
db2ldif - Directory Server script for exporting the database
.SH SYNOPSIS
-db2ldif [-Z serverID] {-n backend_instance}* | {-s includeSuffix}* [{-x excludeSuffix}*] [-a outputFile] [-m] [-M] [-r] [-u] [-U] [-C] [-N] [-E] [-1] [-q] [-h]
+db2ldif [\-Z serverID] {\-n backend_instance}* | {\-s includeSuffix}* [{\-x excludeSuffix}*] [\-a outputFile] [\-m] [\-M] [\-r] [\-u] [\-U] [\-C] [\-N] [\-E] [\-1] [\-q] [\-h]
.SH DESCRIPTION
-Exports the contents of the database to a LDIF file. This script can be executed while the server is still running, except when using the -r option.
+Exports the contents of the database to a LDIF file. This script can be executed while the server is still running, except when using the \-r option.
.SH OPTIONS
A summary of options is included below:
.TP
@@ -48,7 +48,7 @@ Minimize the base64 encodings in the exported LDIF file.
.br
Exported ldif is stored in multiple files. These files are named : <instance>_<filename>
.br
-By default, all instances are stored in the filename specified by the -a option.
+By default, all instances are stored in the filename specified by the \-a option.
.TP
.B \fB\-r\fR
.br
@@ -87,9 +87,9 @@ Quiet mode. Suppresses output of the script.
Display the usage.
.SH EXAMPLE
.TP
-db2ldif -Z instance3 -n userRoot -a /LDAP/ldif/export.ldif
+db2ldif \-Z instance3 \-n userRoot \-a /LDAP/ldif/export.ldif
.TP
-db2ldif -s 'dc=example,dc=com' -a /LDAP/ldif/export.ldif -m -E -q
+db2ldif \-s 'dc=example,dc=com' \-a /LDAP/ldif/export.ldif \-m \-E \-q
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/db2ldif.pl.8 b/man/man8/db2ldif.pl.8
index 59f9b86..2ff27d0 100644
--- a/man/man8/db2ldif.pl.8
+++ b/man/man8/db2ldif.pl.8
@@ -18,8 +18,8 @@
.SH NAME
db2ldif.pl - Directory Server perl script for exporting a database to a LDIF file
.SH SYNOPSIS
-db2ldif.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j pwfilename } [-P protocol]
-{-n backendname}* | {-s includeSuffix}* [{-x excludeSuffix}*] [-m] [-M] [-r] [-u] [-C] [-N] [-E] [-1] [-U] [-a filename] [-v] [-h]
+db2ldif.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j pwfilename } [\-P protocol]
+{\-n backendname}* | {\-s includeSuffix}* [{\-x excludeSuffix}*] [\-m] [\-M] [\-r] [\-u] [\-C] [\-N] [\-E] [\-1] [\-U] [\-a filename] [\-v] [\-h]
.SH DESCRIPTION
Exports the contents of the database to LDIF. This script creates an entry in the directory that launches this dynamic task.
.SH OPTIONS
@@ -68,7 +68,7 @@ Minimize the base64 encodings in the exported LDIF file.
.br
Exported ldif is stored in multiple files. These files are named : <instance>_<filename>
.br
-By default, all instances are stored in the filename specified by the -a option.
+By default, all instances are stored in the filename specified by the \-a option.
.TP
.B \fB\-r\fR
.br
@@ -107,11 +107,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-db2ldif.pl -Z instance3 -n userRoot -a /LDAP/ldif/export.ldif -P STARTTLS
+db2ldif.pl \-Z instance3 \-n userRoot \-a /LDAP/ldif/export.ldif \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.TP
-db2ldif.pl -s 'dc=example,dc=com' -a /LDAP/ldif/export.ldif -m -E -q
+db2ldif.pl \-s 'dc=example,dc=com' \-a /LDAP/ldif/export.ldif \-m \-E \-q
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/dbverify.8 b/man/man8/dbverify.8
index b0fbce0..255b170 100644
--- a/man/man8/dbverify.8
+++ b/man/man8/dbverify.8
@@ -18,7 +18,7 @@
.SH NAME
dbverify - Directory Server script for indexing attributes
.SH SYNOPSIS
-dbverify [-Z serverID] [-n backend] [-V] [-v] [-d debuglevel] [-h]
+dbverify [\-Z serverID] [\-n backend] [\-V] [\-v] [\-d debuglevel] [\-h]
.SH DESCRIPTION
Verifies the backend database files. If the server crashes because of a corrupted database, this command can be used to verify the integrity of the different database files to help isolate any problems. This script should be run while the server instacne is stopped.
.SH OPTIONS
@@ -46,7 +46,7 @@ Display the version of the Directory Server.
.br
Display the usage.
.SH EXAMPLE
-dbverify -Z instance3 -n userRoot -V
+dbverify \-Z instance3 \-n userRoot \-V
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
diff --git a/man/man8/dn2rdn.8 b/man/man8/dn2rdn.8
index df0192a..8179d50 100644
--- a/man/man8/dn2rdn.8
+++ b/man/man8/dn2rdn.8
@@ -18,7 +18,7 @@
.SH NAME
dn2rdn - Directory Server script to check for outdated index versions
.SH SYNOPSIS
-dn2rdn [-Z serverID] [-h] [-f] [-v] [-d debuglevel]
+dn2rdn [\-Z serverID] [\-h] [\-f] [\-v] [\-d debuglevel]
.SH DESCRIPTION
Checks the database index version, and if it's in a old format, then it will rebuild the indexes. The server instance needs to be stopped prior to running this script.
.SH OPTIONS
@@ -45,7 +45,7 @@ Display the usage.
.SH EXAMPLE
dn2rdn
-dn2rdn -Z instance3 -f
+dn2rdn \-Z instance3 \-f
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/fixup-linkedattrs.pl.8 b/man/man8/fixup-linkedattrs.pl.8
index 82aa098..c8e0fa6 100644
--- a/man/man8/fixup-linkedattrs.pl.8
+++ b/man/man8/fixup-linkedattrs.pl.8
@@ -18,7 +18,7 @@
.SH NAME
fixup-linkedattrs.pl - Directory Server perl script for creating a "fixup" task for linked attributes.
.SH SYNOPSIS
-fixup-linkedattrs.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-l linkDN] [-P protocol] [-v] [-h]
+fixup-linkedattrs.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-l linkDN] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Creates the managed attributes in the user entries once the linking plug-in instance is created or updates the managed attributes to keep everything in sync after operations like replication or synchronization.
.SH OPTIONS
@@ -59,11 +59,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-fixup-linkedattrs.pl -Z instance1 -D 'cn=directory manager' -w password -P STARTTLS
+fixup-linkedattrs.pl \-Z instance1 \-D 'cn=directory manager' \-w password \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.TP
-fixup-linkedattrs.pl -w password -l 'ou=people,dc=example,dc=com'
+fixup-linkedattrs.pl \-w password \-l 'ou=people,dc=example,dc=com'
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/fixup-memberof.pl.8 b/man/man8/fixup-memberof.pl.8
index aa25043..198ce8c 100644
--- a/man/man8/fixup-memberof.pl.8
+++ b/man/man8/fixup-memberof.pl.8
@@ -18,7 +18,7 @@
.SH NAME
fixup-memberof.pl - Directory Server perl script for memberOf attributes.
.SH SYNOPSIS
-fixup-memberof.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -b baseDN [-f filter] [-P protocol] [-v] [-h]
+fixup-memberof.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } \-b baseDN [\-f filter] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Regenerates and updates memberOf on user entries to coordinate changes in group membership.
.SH OPTIONS
@@ -63,11 +63,11 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-fixup-memberof.pl -Z instance1 -D 'cn=directory manager' -w password -b 'dc=example,dc=com' -P STARTTLS
+fixup-memberof.pl \-Z instance1 \-D 'cn=directory manager' \-w password \-b 'dc=example,dc=com' \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.TP
-fixup-memberof.pl -w password -b 'dc=example,dc=com' -f 'uid=*'
+fixup-memberof.pl \-w password \-b 'dc=example,dc=com' \-f 'uid=*'
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/ldif2db.8 b/man/man8/ldif2db.8
index 7736bc2..9f3b3bc 100644
--- a/man/man8/ldif2db.8
+++ b/man/man8/ldif2db.8
@@ -18,9 +18,9 @@
.SH NAME
ldif2db - Directory Server script for importing a LDIF file
.SH SYNOPSIS
-ldif2db [-Z serverID] -n backendname {-s includesuffix}* [{-x excludesuffix}*] [-g [string] [-G namespace_id]] {-i ldiffile}* [-c chunksize] [-O] [-E] [-q] [-h]
+ldif2db [\-Z serverID] \-n backendname {\-s includesuffix}* [{\-x excludesuffix}*] [\-g [string] [\-G namespace_id]] {\-i ldiffile}* [\-c chunksize] [\-O] [\-E] [\-q] [\-h]
.SH DESCRIPTION
-Imports a LDIF file. Either the option '-n' or '-s' must be used. The server instance must be stopped prior to running this command.
+Imports a LDIF file. Either the option '\-n' or '\-s' must be used. The server instance must be stopped prior to running this command.
.SH OPTIONS
A summary of options is included below:
.TP
@@ -50,12 +50,12 @@ Requests that only the core database is created without attribute indexes.
.B \fB\-g\fR \fI[string]\fR
Generates a unique ID. Type none for no unique ID to be generated and deterministic for the generated unique ID to be name-based. By default, a time-based unique ID is generated. When using the deterministic generation to have a name-based unique ID, it is also possible to specify the namespace for the server to use, as follows:
--g deterministic namespaceId
+\-g deterministic namespaceId
namespaceId is a string of characters in the format 00-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx.
.TP
.B \fB\-G\fR \fInamespace_id\fR
-Generates a namespace ID as a name-based unique ID. This is the same as specifying the -g deterministic option.
+Generates a namespace ID as a name-based unique ID. This is the same as specifying the \-g deterministic option.
.TP
.B \fB\-E\fR
.br
@@ -70,9 +70,9 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-ldif2db -Z instance1 -n userRoot -i /LDAP/ldif/data.ldif
+ldif2db \-Z instance1 \-n userRoot \-i /LDAP/ldif/data.ldif
.TP
-ldif2db -s "dc=example,dc=com" -i /LDAP/ldif/data.ldif
+ldif2db \-s "dc=example,dc=com" \-i /LDAP/ldif/data.ldif
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/ldif2db.pl.8 b/man/man8/ldif2db.pl.8
index b6d9e8d..93e32d5 100644
--- a/man/man8/ldif2db.pl.8
+++ b/man/man8/ldif2db.pl.8
@@ -18,9 +18,9 @@
.SH NAME
ldif2db.pl - Directory Server perl script for importing a LDIF file
.SH SYNOPSIS
-ldif2db.pl -n backend [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol] {-s includeSuffix}* [{-x excludeSuffix}*] [-O] [-c chunksize] [-v] [-h] [-g [string]] [-G namespace_id] {-i filename}*
+ldif2db.pl \-n backend [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-P protocol] {\-s includeSuffix}* [{\-x excludeSuffix}*] [\-O] [\-c chunksize] [\-v] [\-h] [\-g [string]] [\-G namespace_id] {\-i filename}*
.SH DESCRIPTION
-Imports LDIF file(s) into the server. Either the option '-n' or '-s' must be used. This script creates an entry in the directory that launches this dynamic task.
+Imports LDIF file(s) into the server. Either the option '\-n' or '\-s' must be used. This script creates an entry in the directory that launches this dynamic task.
.SH OPTIONS
A summary of options is included below:
.TP
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -57,12 +57,12 @@ Name for the LDIF file to import.
.B \fB\-g\fR \fI[string]\fR
Generates a unique ID. Type none for no unique ID to be generated and deterministic for the generated unique ID to be name-based. By default, a time-based unique ID is generated. When using the deterministic generation to have a name-based unique ID, it is also possible to specify the namespace for the server to use, as follows:
--g deterministic namespaceId
+\-g deterministic namespaceId
namespaceId is a string of characters in the format 00-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx.
.TP
.B \fB\-G\fR \fInamespace_id\fR
-Generates a namespace ID as a name-based unique ID. This is the same as specifying the -g deterministic option.
+Generates a namespace ID as a name-based unique ID. This is the same as specifying the \-g deterministic option.
.TP
.B \fB\-P\fR \fIProtocol\fR
The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP.
@@ -85,9 +85,9 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-ldif2db.pl -Z instance1 -n userRoot -i /LDAP/ldif/data.ldif
+ldif2db.pl \-Z instance1 \-n userRoot \-i /LDAP/ldif/data.ldif
.TP
-ldif2db.pl -s "dc=example,dc=com" -i /LDAP/ldif/data.ldif -D 'cn=directory manager' -w password -P STARTTLS
+ldif2db.pl \-s "dc=example,dc=com" \-i /LDAP/ldif/data.ldif \-D 'cn=directory manager' \-w password \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/ldif2ldap.8 b/man/man8/ldif2ldap.8
index ac5b815..65f1ef8 100644
--- a/man/man8/ldif2ldap.8
+++ b/man/man8/ldif2ldap.8
@@ -18,7 +18,7 @@
.SH NAME
ldif2ldap - Directory Server script for adding entries
.SH SYNOPSIS
-ldif2ldap [-Z serverID] [-D <rootdn>] -w <password> -f <ldifFile> [-P protocol] [-h]
+ldif2ldap [\-Z serverID] [\-D <rootdn>] \-w <password> \-f <ldifFile> [\-P protocol] [\-h]
.SH DESCRIPTION
Performs an import operation over LDAP to the Directory Server. To run this script, the server must be running.
.SH OPTIONS
@@ -47,7 +47,7 @@ available for the root user.
.br
Display the usage.
.SH EXAMPLE
-ldif2ldap -Z instance3 -D 'cn=directory manager' -w password -f /LDAP/ldif/entries.ldif -P STARTTLS
+ldif2ldap \-Z instance3 \-D 'cn=directory manager' \-w password \-f /LDAP/ldif/entries.ldif \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/monitor.8 b/man/man8/monitor.8
index 0c49829..b970ed9 100644
--- a/man/man8/monitor.8
+++ b/man/man8/monitor.8
@@ -18,7 +18,7 @@
.SH NAME
monitor - Directory Server script for monitoring database performance
.SH SYNOPSIS
-monitor [ -Z serverID ] [ -D rootdn ] [ -w password ] [ -b basedn ] [-P protocol] [-h]
+monitor [ \-Z serverID ] [ \-D rootdn ] [ \-w password ] [ \-b basedn ] [\-P protocol] [\-h]
.SH DESCRIPTION
Retrieves performance monitoring information. To run this script, the server must be running.
.SH OPTIONS
@@ -48,11 +48,11 @@ available for the root user.
Display the usage.
.SH EXAMPLE
.TP
-monitor -P STARTTLS
+monitor \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.TP
-monitor -Z instance2 -D 'cn=directory manager' -w password -b 'cn=monitor,cn=userRoot,cn=ldbm database,cn=plugins,cn=config'
+monitor \-Z instance2 \-D 'cn=directory manager' \-w password \-b 'cn=monitor,cn=userRoot,cn=ldbm database,cn=plugins,cn=config'
Note: You only need to bind as the root DN if you want to look at a backend monitor.
.SH DIAGNOSTICS
diff --git a/man/man8/ns-accountstatus.pl.8 b/man/man8/ns-accountstatus.pl.8
index 8be6e69..f9c96b6 100644
--- a/man/man8/ns-accountstatus.pl.8
+++ b/man/man8/ns-accountstatus.pl.8
@@ -18,7 +18,7 @@
.SH NAME
ns-accountstatus.pl - Directory Server perl script for checking the status of entries.
.SH SYNOPSIS
-ns-accountstatus.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-p port] [-h host] [-P protocol] -I DN
+ns-accountstatus.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-p port] [\-h host] [\-P protocol] \-I DN
.SH DESCRIPTION
Provides account status information to establish whether an entry or group of entries is inactivated.
.SH OPTIONS
@@ -57,9 +57,9 @@ Host name of the Directory Server.
Port number of the Directory Server.
.SH EXAMPLE
.TP
-ns-accountstatus.pl -Z instance3 -D 'cn=directory manager' -w password -I 'uid=user,ou=people,dc=example,dc=com'
+ns-accountstatus.pl \-Z instance3 \-D 'cn=directory manager' \-w password \-I 'uid=user,ou=people,dc=example,dc=com'
.TP
-ns-accountstatus.pl -w password -I 'uid=user,ou=people,dc=example,dc=com' -P STARTTLS
+ns-accountstatus.pl \-w password \-I 'uid=user,ou=people,dc=example,dc=com' \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/ns-activate.pl.8 b/man/man8/ns-activate.pl.8
index b72ade5..19dca53 100644
--- a/man/man8/ns-activate.pl.8
+++ b/man/man8/ns-activate.pl.8
@@ -18,7 +18,7 @@
.SH NAME
ns-activate.pl - Directory Server perl script for activating entries.
.SH SYNOPSIS
-ns-activate.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-p port] [-h host] [-P protocol] -I DN
+ns-activate.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-p port] [\-h host] [\-P protocol] \-I DN
.SH DESCRIPTION
Activates an entry or group of entries.
.SH OPTIONS
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -57,7 +57,7 @@ Host name of the Directory Server.
Port number of the Directory Server.
.SH EXAMPLE
.TP
-ns-activate.pl -Z instance2 -D 'cn=directory manager' -j /tmp/passwd.txt -P STARTTLS -I 'uid=user,ou=people,dc=example,dc=com'
+ns-activate.pl \-Z instance2 \-D 'cn=directory manager' \-j /tmp/passwd.txt \-P STARTTLS \-I 'uid=user,ou=people,dc=example,dc=com'
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
diff --git a/man/man8/ns-inactivate.pl.8 b/man/man8/ns-inactivate.pl.8
index fad00a6..1e77772 100644
--- a/man/man8/ns-inactivate.pl.8
+++ b/man/man8/ns-inactivate.pl.8
@@ -18,7 +18,7 @@
.SH NAME
ns-inactivate.pl - Directory Server perl script for inactivating entries.
.SH SYNOPSIS
-ns-inactivate.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-p port] [-h host] [-P protocol] -I DN
+ns-inactivate.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-p port] [\-h host] [\-P protocol] \-I DN
.SH DESCRIPTION
Inactivates, and consequently locks, an entry or group of entries.
.SH OPTIONS
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -57,7 +57,7 @@ Host name of the Directory Server.
Port number of the Directory Server.
.SH EXAMPLE
.TP
-ns-inactivate.pl -Z instance2 -D 'cn=directory manager' -j /tmp/passwd.txt -P STARTTLS -I 'uid=user,ou=people,dc=example,dc=com'
+ns-inactivate.pl \-Z instance2 \-D 'cn=directory manager' \-j /tmp/passwd.txt \-P STARTTLS \-I 'uid=user,ou=people,dc=example,dc=com'
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/ns-newpwpolicy.pl.8 b/man/man8/ns-newpwpolicy.pl.8
index c31e75d..f2dae74 100644
--- a/man/man8/ns-newpwpolicy.pl.8
+++ b/man/man8/ns-newpwpolicy.pl.8
@@ -18,7 +18,7 @@
.SH NAME
ns-newpwpolicy.pl - Directory Server perl script for preparing new password policies.
.SH SYNOPSIS
-ns-newpwpolicy.pl [-Z serverID] [-v] [-D rootdn] { -w password | -j filename } [-P protocol] [-p port] [-h host] -U UserDN -S SuffixDN
+ns-newpwpolicy.pl [\-Z serverID] [\-v] [\-D rootdn] { \-w password | \-j filename } [\-P protocol] [\-p port] [\-h host] \-U UserDN \-S SuffixDN
.SH DESCRIPTION
Adds entries required for implementing the user- and subtree-level password policy.
.SH OPTIONS
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -64,7 +64,7 @@ Specifies the DN of the suffix entry that needs to be updated with subtree-level
Display verbose output
.SH EXAMPLE
.TP
-ns-newpwpolicy.pl -Z instance3 -D 'cn=directory manager' -w password -P STARTTLS -U 'uid=user,ou=people,dc=example,dc=com'
+ns-newpwpolicy.pl \-Z instance3 \-D 'cn=directory manager' \-w password \-P STARTTLS \-U 'uid=user,ou=people,dc=example,dc=com'
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/restoreconfig.8 b/man/man8/restoreconfig.8
index 9c98143..022cf44 100644
--- a/man/man8/restoreconfig.8
+++ b/man/man8/restoreconfig.8
@@ -18,7 +18,7 @@
.SH NAME
restoreconfig - Directory Server script for restoring the Admin Server configuration
.SH SYNOPSIS
-restoreconfig [ -Z serverID ] [-h]
+restoreconfig [ \-Z serverID ] [\-h]
.SH DESCRIPTION
Restores the most recently saved Admin Server configuration information to the NetscapeRoot partition under the /etc/dirsrv/slapd-instance_name/ directory.
.SH OPTIONS
@@ -35,7 +35,7 @@ Display the usage.
.TP
restoreconfig
.TP
-restoreconfig -Z instance2
+restoreconfig \-Z instance2
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/saveconfig.8 b/man/man8/saveconfig.8
index 7f5a5fa..cec4fbb 100644
--- a/man/man8/saveconfig.8
+++ b/man/man8/saveconfig.8
@@ -18,7 +18,7 @@
.SH NAME
saveconfig - Directory Server script for saving the Admin Server configuration
.SH SYNOPSIS
-saveconfig [ -Z serverID ] [-h]
+saveconfig [ \-Z serverID ] [\-h]
.SH DESCRIPTION
Makes a backup of the Admin Server configuration information and stores it in /var/lib/dirsrv/slapd-instance_name/bak.
.SH OPTIONS
@@ -35,7 +35,7 @@ Display the usage.
.TP
saveconfig
.TP
-saveconfig -Z instance3
+saveconfig \-Z instance3
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/schema-reload.pl.8 b/man/man8/schema-reload.pl.8
index bb21dd6..5e27acb 100644
--- a/man/man8/schema-reload.pl.8
+++ b/man/man8/schema-reload.pl.8
@@ -18,7 +18,7 @@
.SH NAME
schema-reload.pl - Directory Server perl script for updating the schema.
.SH SYNOPSIS
-schema-reload.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol] [-d schemadir] [-v] [-h]
+schema-reload.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } [\-P protocol] [\-d schemadir] [\-v] [\-h]
.SH DESCRIPTION
Manually reloads the schema files used by the Directory Server instance, either in the default location, or in user-specified locations.
.SH OPTIONS
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -59,7 +59,7 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-schema-reload.pl -Z instance3 -D 'cn=directory manager' -w password -P STARTTLS -d /LDAP/schema/
+schema-reload.pl \-Z instance3 \-D 'cn=directory manager' \-w password \-P STARTTLS \-d /LDAP/schema/
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/suffix2instance.8 b/man/man8/suffix2instance.8
index e4794c7..cb02826 100644
--- a/man/man8/suffix2instance.8
+++ b/man/man8/suffix2instance.8
@@ -18,7 +18,7 @@
.SH NAME
suffix2instance - Directory Server script for finding a backend name
.SH SYNOPSIS
-suffix2instance [-Z serverID] -s suffix [-h]
+suffix2instance [\-Z serverID] \-s suffix [\-h]
.SH DESCRIPTION
Maps a suffix to a backend name. This script can be run while the server is running, or stopped.
.SH OPTIONS
@@ -36,9 +36,9 @@ The suffix DN to be mapped to a backend name. Example: "dc=example,dc=com"
Display the usage.
.SH EXAMPLE
.TP
-suffix2instance -s 'dc=example,dc=com'
+suffix2instance \-s 'dc=example,dc=com'
.TP
-suffix2instance -Z instance3 -s 'dc=example,dc=com'
+suffix2instance \-Z instance3 \-s 'dc=example,dc=com'
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/syntax-validate.pl.8 b/man/man8/syntax-validate.pl.8
index 37c034b..ae0a265 100644
--- a/man/man8/syntax-validate.pl.8
+++ b/man/man8/syntax-validate.pl.8
@@ -18,7 +18,7 @@
.SH NAME
syntax-validate.pl - Directory Server perl script for validating attribute syntax.
.SH SYNOPSIS
-syntax-validate.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -b baseDN [-f filter] [-P protocol] [-v] [-h]
+syntax-validate.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } \-b baseDN [\-f filter] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Syntax validation checks every modification to attributes to make sure that the new value has the required syntax for that attribute type. All attribute syntaxes are validated against the definitions in RFC 4514.
.SH OPTIONS
@@ -35,7 +35,7 @@ search the server instance configuration for the value.
.B \fB\-w\fR \fIpassword\fR
The rootdn password.
.TP
-.B \fB\-w -\fR
+.B \fB\-w \-\fR
.br
Prompt for the rootdn password.
.TP
@@ -62,7 +62,7 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-syntax-validate.pl -Z instance2 -D 'cn=directory manager' -w password -b 'dc=example,dc=com' -f 'cn=*' -P STARTTLS
+syntax-validate.pl \-Z instance2 \-D 'cn=directory manager' \-w password \-b 'dc=example,dc=com' \-f 'cn=*' \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/upgradedb.8 b/man/man8/upgradedb.8
index 31519fa..a136a99 100644
--- a/man/man8/upgradedb.8
+++ b/man/man8/upgradedb.8
@@ -18,7 +18,7 @@
.SH NAME
upgradedb - Directory Server script for upgrading the database
.SH SYNOPSIS
-upgradedb [-a archivedir] [-Z serverID] [-f] [-v] [-d debuglevel] [-h]
+upgradedb [\-a archivedir] [\-Z serverID] [\-f] [\-v] [\-d debuglevel] [\-h]
.SH DESCRIPTION
Checks the DB version and if it has the old index formatting then it will rebuild the indexes. This is usually needed after migrating from older versions of Directory Server. This script must be run while the server is stopped.
.SH OPTIONS
@@ -42,7 +42,7 @@ Only checks whether any DNs in the database need to be updated.
Display the usage.
.SH EXAMPLE
.TP
-upgradedb -Z instance2
+upgradedb \-Z instance2
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/upgradednformat.8 b/man/man8/upgradednformat.8
index 40584f0..3b29238 100644
--- a/man/man8/upgradednformat.8
+++ b/man/man8/upgradednformat.8
@@ -18,7 +18,7 @@
.SH NAME
upgradednformat - Directory Server script for upgrading the DN format
.SH SYNOPSIS
-upgradednformat -n backendname -a database_directory [-Z serverID] [-N] [-h]
+upgradednformat \-n backendname \-a database_directory [\-Z serverID] [\-N] [\-h]
.SH DESCRIPTION
Updates older-style DN syntaxes to RFC 4514-style DN syntaxes for migrated databases. This is usually needed after migrating from an older version of Directory Server. This script must be run while the server is stopped.
.SH OPTIONS
@@ -42,7 +42,7 @@ Only checks whether any DNs in the database need to be updated.
Display the usage.
.SH EXAMPLE
.TP
-upgradednformat -n userRoot -a /var/lib/dirsrv/slapd-instance2/db -Z instance2
+upgradednformat \-n userRoot \-a /var/lib/dirsrv/slapd-instance2/db \-Z instance2
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/usn-tombstone-cleanup.pl.8 b/man/man8/usn-tombstone-cleanup.pl.8
index 6b31492..36bba7f 100644
--- a/man/man8/usn-tombstone-cleanup.pl.8
+++ b/man/man8/usn-tombstone-cleanup.pl.8
@@ -18,7 +18,7 @@
.SH NAME
usn-tombstone-cleanup.pl - Directory Server perl script for cleaning up tombstone entries.
.SH SYNOPSIS
-usn-tombstone-cleanup.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -s suffix -n backend [-m maxusn_to_delete] [-P protocol] [-v] [-h]
+usn-tombstone-cleanup.pl [\-Z serverID] [\-D rootdn] { \-w password | \-w \- | \-j filename } \-s suffix \-n backend [\-m maxusn_to_delete] [\-P protocol] [\-v] [\-h]
.SH DESCRIPTION
Deletes the tombstone entries maintained by the instance if the USN Plug-in is enabled.
.SH OPTIONS
@@ -65,7 +65,7 @@ Display verbose output
Display usage
.SH EXAMPLE
.TP
-usn-tombstone-cleanup.pl -Z instance2 -D 'cn=directory manager' -w password -n userRoot -s 'ou=people,dc=example,dc=com' -P STARTTLS
+usn-tombstone-cleanup.pl \-Z instance2 \-D 'cn=directory manager' \-w password \-n userRoot \-s 'ou=people,dc=example,dc=com' \-P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically.
.SH DIAGNOSTICS
diff --git a/man/man8/verify-db.pl.8 b/man/man8/verify-db.pl.8
index 07057a1..a96c8f5 100644
--- a/man/man8/verify-db.pl.8
+++ b/man/man8/verify-db.pl.8
@@ -18,7 +18,7 @@
.SH NAME
verify-db.pl - Directory Server perl script for verifying the database.
.SH SYNOPSIS
-verify-db.pl [-Z serverID] [ -a path ] [-h]
+verify-db.pl [\-Z serverID] [ \-a path ] [\-h]
.SH DESCRIPTION
Verifies the backend database files. If the server crashes because of a corrupted database, this script can be used to verify the integrity of the different database files to help isolate any problems.
.SH OPTIONS
@@ -36,7 +36,7 @@ Gives the path to the database directory. If this option is not passed with the
Display usage
.SH EXAMPLE
.TP
-verify-db.pl -Z instance2 -a /var/lib/dirsrv/slapd-instance2/db
+verify-db.pl \-Z instance2 \-a /var/lib/dirsrv/slapd-instance2/db
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
diff --git a/man/man8/vlvindex.8 b/man/man8/vlvindex.8
index a4eec93..4074d84 100644
--- a/man/man8/vlvindex.8
+++ b/man/man8/vlvindex.8
@@ -18,7 +18,7 @@
.SH NAME
vlvindex - Directory Server script for VLV indexing
.SH SYNOPSIS
-vlvindex [-Z serverID] -n backendname | {-s includesuffix}* -T vlvTag [-d debuglevel] [-h]
+vlvindex [\-Z serverID] \-n backendname | {\-s includesuffix}* \-T vlvTag [\-d debuglevel] [\-h]
.SH DESCRIPTION
Creates virtual list view (VLV) indexes, known in the Directory Server Console as browsing indexes. VLV indexes introduce flexibility in the way search results are viewed. VLV index configuration must already exist prior to running this script. The Directory Server must be stopped before running this script.
.SH OPTIONS
@@ -45,7 +45,7 @@ Settings the debugging level.
Display the usage.
.SH EXAMPLE
.TP
-vlvindex -n userRoot -T myVLVIndex -Z instance2
+vlvindex \-n userRoot \-T myVLVIndex \-Z instance2
.SH DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written
9 years, 10 months
ldap/servers lib/libaccess man/man8
by Noriko Hosoi
ldap/servers/plugins/acl/acllist.c | 8 ++++----
ldap/servers/plugins/distrib/Makefile | 2 +-
ldap/servers/plugins/posix-winsync/posix-winsync-config.c | 10 +++++-----
ldap/servers/plugins/replication/urp.c | 2 +-
ldap/servers/plugins/syntaxes/facsimile.c | 6 +++---
ldap/servers/slapd/passwd_extop.c | 2 +-
ldap/servers/slapd/slapi-plugin.h | 14 +++++++-------
ldap/servers/slapd/slapi-private.h | 2 +-
ldap/servers/slapd/slapi_counter.c | 2 +-
ldap/servers/slapd/test-plugins/Makefile.server | 2 +-
ldap/servers/slapd/tools/ldclt/data.c | 2 +-
ldap/servers/slapd/tools/ldclt/ldapfct.c | 2 +-
ldap/servers/slapd/tools/ldclt/ldclt.c | 8 ++++----
ldap/servers/slapd/tools/ldclt/ldclt.h | 4 ++--
ldap/servers/slapd/tools/ldclt/ldclt.man | 2 +-
ldap/servers/slapd/tools/ldclt/ldclt.use | 2 +-
ldap/servers/slapd/tools/ldclt/ldcltU.c | 4 ++--
ldap/servers/slapd/tools/ldclt/opCheck.c | 2 +-
ldap/servers/slapd/tools/ldclt/workarounds.c | 2 +-
lib/libaccess/acltools.cpp | 4 ++--
man/man8/bak2db.pl.8 | 2 +-
man/man8/cleanallruv.pl.8 | 2 +-
man/man8/db2bak.pl.8 | 2 +-
man/man8/db2index.pl.8 | 2 +-
man/man8/db2ldif.pl.8 | 2 +-
man/man8/fixup-linkedattrs.pl.8 | 2 +-
man/man8/fixup-memberof.pl.8 | 2 +-
man/man8/ldif2db.8 | 2 +-
man/man8/ldif2db.pl.8 | 2 +-
man/man8/ns-newpwpolicy.pl.8 | 2 +-
man/man8/schema-reload.pl.8 | 2 +-
man/man8/syntax-validate.pl.8 | 2 +-
man/man8/usn-tombstone-cleanup.pl.8 | 2 +-
33 files changed, 54 insertions(+), 54 deletions(-)
New commits:
commit 9382319e96f06eb941380adb36cfbae1927ecb08
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jul 10 15:10:29 2014 -0700
Ticket #47843 - Fix various typos in manpages & code
Description: Fix various typos
Author: Benjamin Drung <benjamin.drung(a)profitbricks.com>
https://fedorahosted.org/389/ticket/47843
Reviewed by nhosoi(a)redhat.com
diff --git a/ldap/servers/plugins/acl/acllist.c b/ldap/servers/plugins/acl/acllist.c
index 88ccb3a..668ef58 100644
--- a/ldap/servers/plugins/acl/acllist.c
+++ b/ldap/servers/plugins/acl/acllist.c
@@ -149,7 +149,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state,
if ( (be = slapi_be_select_by_instance_name( be_name )) == NULL) {
slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
- "Failed to retreive backend--NOT activating it's acis\n");
+ "Failed to retrieve backend--NOT activating it's acis\n");
return;
}
@@ -159,7 +159,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state,
if ( (sdn = slapi_be_getsuffix( be, 0)) == NULL ) {
slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
- "Failed to retreive backend--NOT activating it's acis\n");
+ "Failed to retrieve backend--NOT activating it's acis\n");
return;
}
@@ -176,7 +176,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state,
if ( (be = slapi_be_select_by_instance_name( be_name )) == NULL) {
slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
- "Failed to retreive backend--NOT activating it's acis\n");
+ "Failed to retrieve backend--NOT activating it's acis\n");
return;
}
@@ -186,7 +186,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state,
if ( (sdn = slapi_be_getsuffix( be, 0)) == NULL ) {
slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
- "Failed to retreive backend--NOT activating it's acis\n");
+ "Failed to retrieve backend--NOT activating it's acis\n");
return;
}
diff --git a/ldap/servers/plugins/distrib/Makefile b/ldap/servers/plugins/distrib/Makefile
index 4dd8367..60e9ad6 100644
--- a/ldap/servers/plugins/distrib/Makefile
+++ b/ldap/servers/plugins/distrib/Makefile
@@ -72,7 +72,7 @@ endif
# The sample distribution plugin is not part of DS.
# So we generate the shared library outside of $(LIBDIR)
-# so that it's not retreived by the packaging makefiles.
+# so that it's not retrieved by the packaging makefiles.
#LIBDIS = $(addprefix $(LIBDIR)/, $(DIS_DLL).$(DLL_SUFFIX))
LIBDIS = $(addprefix $(OBJDEST)/, $(DIS_DLL).$(DLL_SUFFIX))
diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
index 81f2b6d..4234080 100644
--- a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
+++ b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
@@ -263,7 +263,7 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent
if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MSSFU_SCHEMA, &testattr) && (NULL != testattr)) {
mssfuSchema = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MSSFU_SCHEMA);
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
- "_apply_config: Config paramter %s: %d\n", POSIX_WINSYNC_MSSFU_SCHEMA,
+ "_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MSSFU_SCHEMA,
mssfuSchema);
}
@@ -271,7 +271,7 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent
if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MAP_MEMBERUID, &testattr) && (NULL != testattr)) {
mapMemberUID = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MAP_MEMBERUID);
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
- "_apply_config: Config paramter %s: %d\n", POSIX_WINSYNC_MAP_MEMBERUID,
+ "_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MAP_MEMBERUID,
mapMemberUID);
}
/* get create task value */
@@ -279,21 +279,21 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent
!= testattr)) {
createMemberOfTask = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_CREATE_MEMBEROFTASK);
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
- "_apply_config: Config paramter %s: %d\n",
+ "_apply_config: Config parameter %s: %d\n",
POSIX_WINSYNC_CREATE_MEMBEROFTASK, createMemberOfTask);
}
/* get lower case UID in memberUID */
if (!slapi_entry_attr_find(e, POSIX_WINSYNC_LOWER_CASE, &testattr) && (NULL != testattr)) {
lowercase = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_LOWER_CASE);
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
- "_apply_config: Config paramter %s: %d\n", POSIX_WINSYNC_LOWER_CASE,
+ "_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_LOWER_CASE,
lowercase);
}
/* propogate memberuids in nested grouping */
if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MAP_NESTED_GROUPING, &testattr) && (NULL != testattr)) {
mapNestedGrouping = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MAP_NESTED_GROUPING);
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
- "_apply_config: Config paramter %s: %d\n", POSIX_WINSYNC_MAP_NESTED_GROUPING,
+ "_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MAP_NESTED_GROUPING,
mapNestedGrouping);
}
/* if we got here, we have valid values for everything
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
index d867274..cecf95c 100644
--- a/ldap/servers/plugins/replication/urp.c
+++ b/ldap/servers/plugins/replication/urp.c
@@ -1094,7 +1094,7 @@ urp_annotate_dn (char *sessionid, const Slapi_Entry *entry, CSN *opcsn, const ch
}
/*
- * An URP Naming Collision helper function. Retreives a list of entries
+ * An URP Naming Collision helper function. Retrieves a list of entries
* that have the given dn excluding the unique id of the entry. Any
* entries returned will be entries that have been added with the same
* dn, but caused a naming conflict when replicated. The URP to fix
diff --git a/ldap/servers/plugins/syntaxes/facsimile.c b/ldap/servers/plugins/syntaxes/facsimile.c
index cb57f1e..96200f1 100644
--- a/ldap/servers/plugins/syntaxes/facsimile.c
+++ b/ldap/servers/plugins/syntaxes/facsimile.c
@@ -241,7 +241,7 @@ facsimile_validate(
}
/* We're guaranteed to have at least one character
- * past p. This is where the fax-paramter should
+ * past p. This is where the fax-parameter should
* start. */
start = p + 1;
@@ -258,9 +258,9 @@ facsimile_validate(
}
/* We're guaranteed to have another character, which
- * should be the beginning of the next fax-paramter.
+ * should be the beginning of the next fax-parameter.
* Adjust the start pointer to point to the beginning
- * of this fax-paramter. */
+ * of this fax-parameter. */
start = p + 1;
}
}
diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c
index 999a7af..9b76e6d 100644
--- a/ldap/servers/slapd/passwd_extop.c
+++ b/ldap/servers/slapd/passwd_extop.c
@@ -187,7 +187,7 @@ passwd_apply_mods(Slapi_PBlock *pb_orig, const Slapi_DN *sdn, Slapi_Mods *mods,
slapi_pblock_get(&pb, SLAPI_PLUGIN_INTOP_RESULT, &ret);
- /* Retreive and duplicate the response controls since they will be
+ /* Retrieve and duplicate the response controls since they will be
* destroyed along with the pblock used for the internal operation. */
slapi_pblock_get(&pb, SLAPI_RESCONTROLS, &pb_resp_controls);
if (pb_resp_controls) {
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index b83b08a..71d239a 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -1644,9 +1644,9 @@ int slapi_entry_schema_check_ext( Slapi_PBlock *pb, Slapi_Entry *e, int check_re
* \return \c 1 if the entry has any attribute values that violate the syntax rules
* imposed by the associated attribute type. If the \c pb parameter was
* passed in, an error message describing the syntax violations will be
- * set in the #SLAPI_PB_RESULT_TEXT paramter.
+ * set in the #SLAPI_PB_RESULT_TEXT parameter.
* \warning The \c pb parameter can be \c NULL. It is used to store an error
- * message with details of any syntax violations. The \c pb paramter
+ * message with details of any syntax violations. The \c pb parameter
* is also used to check if the #SLAPI_IS_REPLICATED_OPERATION flag is
* set. If that flag is present, no syntax checking is performed.
*/
@@ -1665,7 +1665,7 @@ int slapi_entry_syntax_check( Slapi_PBlock *pb, Slapi_Entry *e, int override );
* parameter was passed in, an error message will be set in the
* #SLAPI_PB_RESULT_TEXT parameter.
* \warning The \c pb parameter can be \c NULL. It is used to store an error
- * message with details of any syntax violations. The \c pb paramter
+ * message with details of any syntax violations. The \c pb parameter
* is also used to check if the #SLAPI_IS_REPLICATED_OPERATION flag is
* set. If that flag is present, no syntax checking is performed.
*/
@@ -1684,9 +1684,9 @@ int slapi_dn_syntax_check( Slapi_PBlock *pb, const char *dn, int override );
* \return \c 1 if the mods are adding any new attribute values that violate the
* syntax rules imposed by the associated attribute type. If the \c pb
* parameter was passed in, an error message describing the syntax violations
- * will be set in the #SLAPI_PB_RESULT_TEXT paramter.
+ * will be set in the #SLAPI_PB_RESULT_TEXT parameter.
* \warning The \c pb parameter can be \c NULL. It is used to store an error
- * message with details of any syntax violations. The \c pb paramter
+ * message with details of any syntax violations. The \c pb parameter
* is also used to check if the #SLAPI_IS_REPLICATED_OPERATION flag is
* set. If that flag is present, no syntax checking is performed.
*/
@@ -2975,7 +2975,7 @@ int slapi_sdn_scope_test( const Slapi_DN *dn, const Slapi_DN *base, int scope );
int slapi_sdn_scope_test_ext( const Slapi_DN *dn, const Slapi_DN *base, int scope, int flags );
/**
- * Retreives the RDN from a given DN.
+ * Retrieves the RDN from a given DN.
*
* This function takes the DN stored in the \c Slapi_DN structure pointed to
* by \c sdn and fills in it's RDN within the \c Slapi_RDN structure pointed
@@ -4635,7 +4635,7 @@ Slapi_Value *slapi_value_set_berval( Slapi_Value *value, const struct berval *bv
* the value.
* \param vfrom Pointer to the \c Slapi_Value structure from which to
* get the value.
- * \return Pointer to the \c Slapi_Value structure passed as the \c value paramter.
+ * \return Pointer to the \c Slapi_Value structure passed as the \c value parameter.
* \return \c NULL if the \c value parameter was \c NULL.
* \warning The \c vfrom parameter must not be \c NULL.
* \warning If the pointer to the \c Slapi_Value structure is \c NULL,
diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h
index 3fbdb44..2347119 100644
--- a/ldap/servers/slapd/slapi-private.h
+++ b/ldap/servers/slapd/slapi-private.h
@@ -957,7 +957,7 @@ enum {UID_SUCCESS, /* operation was successfull */
/* Function: slapi_uniqueIDNew
Description: allocates new id
- Paramters: none
+ Parameters: none
Return: pointer to the newly allocated id if successful
NULL if the system is out of memory
*/
diff --git a/ldap/servers/slapd/slapi_counter.c b/ldap/servers/slapd/slapi_counter.c
index 4d2c5cf..fe14e2d 100644
--- a/ldap/servers/slapd/slapi_counter.c
+++ b/ldap/servers/slapd/slapi_counter.c
@@ -382,7 +382,7 @@ PRUint64 slapi_counter_get_value(Slapi_Counter *counter)
* replace *ptr with ECX:EBX */
" lock; cmpxchg8b %0;"
" jnz retryget;"
- /* Put retreived value into value */
+ /* Put retrieved value into value */
" movl %%ebx, %1;"
" movl %%ecx, 4%1;"
#ifdef CPU_x86
diff --git a/ldap/servers/slapd/test-plugins/Makefile.server b/ldap/servers/slapd/test-plugins/Makefile.server
index d055ddd..3e1ab7f 100644
--- a/ldap/servers/slapd/test-plugins/Makefile.server
+++ b/ldap/servers/slapd/test-plugins/Makefile.server
@@ -72,7 +72,7 @@ endif
# The sample distribution plugin is not part of DS.
# So we generate the shared library outside of $(LIBDIR)
-# so that it's not retreived by the packaging makefiles.
+# so that it's not retrieved by the packaging makefiles.
#LIBDIS = $(addprefix $(LIBDIR)/, $(DIS_DLL).$(DLL_SUFFIX))
LIBDIS = $(addprefix $(OBJDEST)/, $(TEST_PLUGIN_DLL).$(DLL_SUFFIX))
diff --git a/ldap/servers/slapd/tools/ldclt/data.c b/ldap/servers/slapd/tools/ldclt/data.c
index 45016d8..590f29a 100644
--- a/ldap/servers/slapd/tools/ldclt/data.c
+++ b/ldap/servers/slapd/tools/ldclt/data.c
@@ -51,7 +51,7 @@
DESCRIPTION :
This file implements the management of the data that
are manipulated by ldclt.
- It is targetted to contain all the functions needed for
+ It is targeted to contain all the functions needed for
the images, etc...
LOCAL : None.
HISTORY :
diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c
index c57f240..235e20c 100644
--- a/ldap/servers/slapd/tools/ldclt/ldapfct.c
+++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c
@@ -278,7 +278,7 @@ int ldclt_alloc_ber( LDAP *ld, BerElement **berp );
/* ****************************************************************************
FUNCTION : my_ldap_err2string
- PURPOSE : This function is targetted to encapsulate the standard
+ PURPOSE : This function is targeted to encapsulate the standard
function ldap_err2string(), that sometimes returns
a NULL pointer and thus crashes the appicaliton :-(
INPUT : err = error to decode
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c
index 4fb8b25..2ccba82 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.c
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.c
@@ -50,10 +50,10 @@
DATE : 03 December 1998
DESCRIPTION :
This file is the main file of the ldclt tool. This tool
- is targetted to be a multi-threaded ldap client,
+ is targeted to be a multi-threaded ldap client,
specially designed to ensure good reliability of both
the basic ldap server purpose, and the replication
- processes. It is *not* targetted against the
+ processes. It is *not* targeted against the
functionnality aspect of the product, but rather on the
stress and long-term operation.
LOCAL : None.
@@ -672,7 +672,7 @@ runThem (void)
/* New function */ /*JLS 17-11-00*/
/* ****************************************************************************
FUNCTION : shutdownThreads
- PURPOSE : This function is targetted to shutdown the threads.
+ PURPOSE : This function is targeted to shutdown the threads.
INPUT : None.
OUTPUT : None.
RETURN : -1 if error, 0 else.
@@ -1750,7 +1750,7 @@ basicInit (void)
/* ****************************************************************************
FUNCTION : printModeValues
- PURPOSE : This function is targetted to print the bits mask of
+ PURPOSE : This function is targeted to print the bits mask of
the mode field.
INPUT : None.
OUTPUT : None.
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.h b/ldap/servers/slapd/tools/ldclt/ldclt.h
index 71ff06d..d2c44b3 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.h
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.h
@@ -612,7 +612,7 @@ typedef struct main_context {
* This structure is aimed to ease the managing of asynchronous
* operations, keeping in memory the msgid returned by the library and
* a free string meaning something for the user.
- * It is targetted that this string is something like a DN, and is
+ * It is targeted that this string is something like a DN, and is
* locally managed by the list functions.
*/
typedef struct msgid_cell {
@@ -625,7 +625,7 @@ typedef struct msgid_cell {
/*
* This structure contain the context associated with each thread.
- * It is targetted to be initiated by the main thread, and maintained
+ * It is targeted to be initiated by the main thread, and maintained
* by each thread.
*/
typedef struct thread_context {
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.man b/ldap/servers/slapd/tools/ldclt/ldclt.man
index 088e904..8a3e1de 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.man
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.man
@@ -21,7 +21,7 @@ AVAILABILITY
SUNQAldap
DESCRIPTION
- ldclt is a multi-threaded test tool targetted to stress a
+ ldclt is a multi-threaded test tool targeted to stress a
ldap server with multiple simultaneous requests.
The tool automatically set its ulimit parameters to fit
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.use b/ldap/servers/slapd/tools/ldclt/ldclt.use
index 9613690..6933f2a 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.use
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.use
@@ -9,7 +9,7 @@ usage: ldclt [-qQvV] [-E <max errors>]
[-S <slave>] [-P<master port>]
[-W <waitsec>] [-Z <certfile>]
- This tool is a ldap client targetted to validate the reliability of
+ This tool is a ldap client targeted to validate the reliability of
the product under test under hard use.
The valid options are:
diff --git a/ldap/servers/slapd/tools/ldclt/ldcltU.c b/ldap/servers/slapd/tools/ldclt/ldcltU.c
index e436e18..67fa952 100644
--- a/ldap/servers/slapd/tools/ldclt/ldcltU.c
+++ b/ldap/servers/slapd/tools/ldclt/ldcltU.c
@@ -56,7 +56,7 @@
* [-S <slave>] [-P<master port>]
* [-W <waitsec>] [-Z <certfile>]
*
- * This tool is a ldap client targetted to validate the reliability of
+ * This tool is a ldap client targeted to validate the reliability of
* the product under test under hard use.
*
* The valid options are:
@@ -158,7 +158,7 @@ void usage ()
(void) printf (" [-S <slave>] [-P<master port>]\n");
(void) printf (" [-W <waitsec>] [-Z <certfile>]\n");
(void) printf ("\n");
- (void) printf (" This tool is a ldap client targetted to validate the reliability of\n");
+ (void) printf (" This tool is a ldap client targeted to validate the reliability of\n");
(void) printf (" the product under test under hard use.\n");
(void) printf ("\n");
(void) printf (" The valid options are:\n");
diff --git a/ldap/servers/slapd/tools/ldclt/opCheck.c b/ldap/servers/slapd/tools/ldclt/opCheck.c
index e41ba30..aa7f780 100644
--- a/ldap/servers/slapd/tools/ldclt/opCheck.c
+++ b/ldap/servers/slapd/tools/ldclt/opCheck.c
@@ -240,7 +240,7 @@ LDAPMod2attributes (
/* ****************************************************************************
FUNCTION : freeAttributesArray
- PURPOSE : This function is targetted to free an array of
+ PURPOSE : This function is targeted to free an array of
struct attribute. It does not free the array itself,
but only the types and values memorized in it.
INPUT : attribs = array to free.
diff --git a/ldap/servers/slapd/tools/ldclt/workarounds.c b/ldap/servers/slapd/tools/ldclt/workarounds.c
index 5275e6d..f0b8375 100644
--- a/ldap/servers/slapd/tools/ldclt/workarounds.c
+++ b/ldap/servers/slapd/tools/ldclt/workarounds.c
@@ -49,7 +49,7 @@
VERSION : 1.0
DATE : 15 December 1998
DESCRIPTION :
- This file contains special work-arounds targetted to
+ This file contains special work-arounds targeted to
fix, or work-around, the various bugs that may appear
in Solaris 2.7 libldap.
LOCAL : None.
diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp
index 3fa8a7d..21645fb 100644
--- a/lib/libaccess/acltools.cpp
+++ b/lib/libaccess/acltools.cpp
@@ -436,7 +436,7 @@ acl_comp_string( CmpOp_t cmp )
* attr_name Term Attribute name
* cmp Comparison operator
* attr_pattern Pattern for comparison
- * Ouput:
+ * Output:
* acl_expr New term added
* Returns:
* 0 Success
@@ -518,7 +518,7 @@ ACLExprRaw_t *raw_expr;
* Input:
* errp The error stack
* acl_expr The expression to negate
- * Ouput
+ * Output
* acl_expr The negated expression
* Returns:
* 0 Success
diff --git a/man/man8/bak2db.pl.8 b/man/man8/bak2db.pl.8
index 25c87db..92e4746 100644
--- a/man/man8/bak2db.pl.8
+++ b/man/man8/bak2db.pl.8
@@ -58,7 +58,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/cleanallruv.pl.8 b/man/man8/cleanallruv.pl.8
index dc49bad..241b799 100644
--- a/man/man8/cleanallruv.pl.8
+++ b/man/man8/cleanallruv.pl.8
@@ -61,7 +61,7 @@ Abort a cleanAllRUV task that is currently running.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/db2bak.pl.8 b/man/man8/db2bak.pl.8
index 6807292..df6af3d 100644
--- a/man/man8/db2bak.pl.8
+++ b/man/man8/db2bak.pl.8
@@ -56,7 +56,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/db2index.pl.8 b/man/man8/db2index.pl.8
index ebb5847..3df7aba 100644
--- a/man/man8/db2index.pl.8
+++ b/man/man8/db2index.pl.8
@@ -59,7 +59,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/db2ldif.pl.8 b/man/man8/db2ldif.pl.8
index 139ae8b..59f9b86 100644
--- a/man/man8/db2ldif.pl.8
+++ b/man/man8/db2ldif.pl.8
@@ -100,7 +100,7 @@ Deletes, for reasons of backward compatibility, the first line of the LDIF file
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/fixup-linkedattrs.pl.8 b/man/man8/fixup-linkedattrs.pl.8
index 1c77aba..82aa098 100644
--- a/man/man8/fixup-linkedattrs.pl.8
+++ b/man/man8/fixup-linkedattrs.pl.8
@@ -52,7 +52,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/fixup-memberof.pl.8 b/man/man8/fixup-memberof.pl.8
index 7716a58..aa25043 100644
--- a/man/man8/fixup-memberof.pl.8
+++ b/man/man8/fixup-memberof.pl.8
@@ -56,7 +56,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/ldif2db.8 b/man/man8/ldif2db.8
index 69aadb2..7736bc2 100644
--- a/man/man8/ldif2db.8
+++ b/man/man8/ldif2db.8
@@ -63,7 +63,7 @@ Encrypts data during import. This option is used only if database encryption is
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/ldif2db.pl.8 b/man/man8/ldif2db.pl.8
index 67e0d2d..b6d9e8d 100644
--- a/man/man8/ldif2db.pl.8
+++ b/man/man8/ldif2db.pl.8
@@ -78,7 +78,7 @@ The number of entries to process before starting a fresh pass during the import.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/ns-newpwpolicy.pl.8 b/man/man8/ns-newpwpolicy.pl.8
index 34cb15b..c31e75d 100644
--- a/man/man8/ns-newpwpolicy.pl.8
+++ b/man/man8/ns-newpwpolicy.pl.8
@@ -61,7 +61,7 @@ Specifies the DN of the suffix entry that needs to be updated with subtree-level
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.SH EXAMPLE
.TP
ns-newpwpolicy.pl -Z instance3 -D 'cn=directory manager' -w password -P STARTTLS -U 'uid=user,ou=people,dc=example,dc=com'
diff --git a/man/man8/schema-reload.pl.8 b/man/man8/schema-reload.pl.8
index d148685..bb21dd6 100644
--- a/man/man8/schema-reload.pl.8
+++ b/man/man8/schema-reload.pl.8
@@ -52,7 +52,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/syntax-validate.pl.8 b/man/man8/syntax-validate.pl.8
index 3bd0d10..37c034b 100644
--- a/man/man8/syntax-validate.pl.8
+++ b/man/man8/syntax-validate.pl.8
@@ -55,7 +55,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
diff --git a/man/man8/usn-tombstone-cleanup.pl.8 b/man/man8/usn-tombstone-cleanup.pl.8
index 175e973..6b31492 100644
--- a/man/man8/usn-tombstone-cleanup.pl.8
+++ b/man/man8/usn-tombstone-cleanup.pl.8
@@ -58,7 +58,7 @@ available for the root user.
.TP
.B \fB\-v\fR
.br
-Display verbose ouput
+Display verbose output
.TP
.B \fB\-h\fR
.br
9 years, 10 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit bc98362705bfef62e06d482b0f4622f2c48fda3b
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jul 10 13:54:35 2014 -0700
Ticket #47832 - attrcrypt_generate_key calls slapd_pk11_TokenKeyGenWithFlags with improper macro
Description: attrcrypt_generate_key was passing an improper macro
CKA_DECRYPT, which is a super set of the correct one CKF_DECRYPT.
Thanks to Bob Relyea (rrelyea(a)redhat.com) for finding it out.
https://fedorahosted.org/389/ticket/47832
Reviewed by nhosoi(a)redhat.com.
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
index f4a5d1a..41856d5 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
@@ -344,7 +344,7 @@ attrcrypt_generate_key(attrcrypt_cipher_state *acs,PK11SymKey **symmetric_key)
0 /*param*/,
acs->ace->key_size,
NULL /*keyid*/,
- CKA_DECRYPT/*op*/,
+ CKF_DECRYPT/*op*/,
CKF_ENCRYPT/*attr*/,
NULL);
if (new_symmetric_key) {
9 years, 10 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 60d8bf9f77c298197e4c8ecee585f8a2e6c0457c
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Jul 10 14:18:06 2014 -0600
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.2
Fix Description: Previous fix was incomplete - needed to move the
deleted attribute to the present attribute list.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 4b54366593e50d71239588343f532eab39ef56e0)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 5059457..5512b5b 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1402,6 +1402,8 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
*/
/* just remove the deleted value */
entry_deleted_value_to_zapped_value(a,pending_value);
+ /* move the attribute to the present attributes list */
+ entry_deleted_attribute_to_present_attribute(e,a);
pending_value = NULL;
attr_set_deletion_csn(a,NULL);
return; /* we are done - we are keeping the present value */
9 years, 10 months
Branch '389-ds-base-1.3.0' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit aead2be2a9cc5392713c7849c18a9bf218beb533
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Jul 10 14:18:06 2014 -0600
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: Previous fix was incomplete - needed to move the
deleted attribute to the present attribute list.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 4b54366593e50d71239588343f532eab39ef56e0)
(cherry picked from commit 60d8bf9f77c298197e4c8ecee585f8a2e6c0457c)
(cherry picked from commit 45dcda2425a865bf529ad0c8423664091392b865)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 6a4ec79..6788504 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1217,6 +1217,8 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
*/
/* just remove the deleted value */
entry_deleted_value_to_zapped_value(a,pending_value);
+ /* move the attribute to the present attributes list */
+ entry_deleted_attribute_to_present_attribute(e,a);
pending_value = NULL;
attr_set_deletion_csn(a,NULL);
return; /* we are done - we are keeping the present value */
9 years, 10 months