ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/back-ldbm/ldbm_config.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit ede5dec6304ef8beeb08bc2c7c9ba92484d29a7d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 29 16:34:39 2011 -0600
Bug 741744 - part2 - MOD operations with chained delete/add get back error 53 on backend config
https://bugzilla.redhat.com/show_bug.cgi?id=741744
Resolves: bug 741744
Bug Description: part2 - MOD operations with chained delete/add get back error 53 on backend config
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: If a value was specified with a mod delete, fail the entire
modify operation with LDAP_NO_SUCH_ATTRIBUTE if the specified value does not
match the current value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 44c7ff9..44cda4c 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1637,6 +1637,19 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc
return LDAP_OBJECT_CLASS_VIOLATION;
}
}
+
+ /* if delete, and a specific value was provided to delete, the existing value must
+ match that value, or return LDAP_NO_SUCH_ATTRIBUTE */
+ if (SLAPI_IS_MOD_DELETE(mod_op) && bval && bval->bv_len && bval->bv_val) {
+ char buf[BUFSIZ];
+ ldbm_config_get(arg, config, buf);
+ if (PL_strncmp(buf, bval->bv_val, bval->bv_len)) {
+ PR_snprintf(err_buf, SLAPI_DSE_RETURNTEXT_SIZE,
+ "value [%s] for attribute %s does not match existing value [%s].\n",
+ bval->bv_val, attr_name, buf);
+ return LDAP_NO_SUCH_ATTRIBUTE;
+ }
+ }
switch(config->config_type) {
case CONFIG_TYPE_INT:
12 years, 2 months
2 commits - ldap/schema ldap/servers
by Richard Allen Megginson
ldap/schema/02common.ldif | 1
ldap/servers/slapd/back-ldbm/ancestorid.c | 18 +-
ldap/servers/slapd/back-ldbm/back-ldbm.h | 3
ldap/servers/slapd/back-ldbm/filterindex.c | 142 +++++++++++---------
ldap/servers/slapd/back-ldbm/idl_new.c | 30 ++--
ldap/servers/slapd/back-ldbm/idl_shim.c | 17 +-
ldap/servers/slapd/back-ldbm/import-threads.c | 2
ldap/servers/slapd/back-ldbm/index.c | 49 ++++++
ldap/servers/slapd/back-ldbm/ldbm_config.c | 76 ++++++----
ldap/servers/slapd/back-ldbm/ldbm_config.h | 2
ldap/servers/slapd/back-ldbm/ldbm_instance_config.c | 20 --
ldap/servers/slapd/back-ldbm/ldbm_search.c | 26 +++
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 8 -
ldap/servers/slapd/back-ldbm/start.c | 12 +
14 files changed, 273 insertions(+), 133 deletions(-)
New commits:
commit c21515b1577d5e71fddc20b91bae7abfda6c90e1
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 29 11:36:20 2011 -0600
Bug 742324 - allow nsslapd-idlistscanlimit to be set dynamically and per-user
https://bugzilla.redhat.com/show_bug.cgi?id=742324
Resolves: bug 742324
Bug Description: allow nsslapd-idlistscanlimit to be set dynamically and per-user
Reviewed by: nhosoi, nkinder (Thanks!)
Branch: master
Fix Description: Changed the ldbm_config for idlistscanlimit to allow running
change. Added a new attribute nsIDListScanLimit that works just like
nsLookThroughLimit for user entries. For each search operation, calculate
the idlistscanlimit to use based on any nsIDListScanLimit or database config.
The biggest change was to extend the internal database API to allow the
idlistscanlimit (aka allidslimit) to be passed down into the lowest level of
the code where it is used.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: Yes - will need to document how nsIDListScanLimit and
nsslapd-idlistscanlimit work now
diff --git a/ldap/schema/02common.ldif b/ldap/schema/02common.ldif
index 52c837a..0193091 100644
--- a/ldap/schema/02common.ldif
+++ b/ldap/schema/02common.ldif
@@ -123,6 +123,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.570 NAME 'nsLookThroughLimit' DESC 'Bind
attributeTypes: ( 2.16.840.1.113730.3.1.571 NAME 'nsSizeLimit' DESC 'Binder-based search operation size limit (entries)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.572 NAME 'nsTimeLimit' DESC 'Binder-based search operation time limit (seconds)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.573 NAME 'nsIdleTimeout' DESC 'Binder-based connection idle timeout (seconds)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
+attributeTypes: ( 2.16.840.1.113730.3.1.2106 NAME 'nsIDListScanLimit' DESC 'Binder-based search operation ID list scan limit (candidate entries)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.574 NAME 'nsRole' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.575 NAME 'nsRoleDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.576 NAME 'nsRoleFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
diff --git a/ldap/servers/slapd/back-ldbm/ancestorid.c b/ldap/servers/slapd/back-ldbm/ancestorid.c
index 43a30b8..1e90871 100644
--- a/ldap/servers/slapd/back-ldbm/ancestorid.c
+++ b/ldap/servers/slapd/back-ldbm/ancestorid.c
@@ -643,7 +643,7 @@ static IDList *idl_union_allids(backend *be, struct attrinfo *ai, IDList *a, IDL
if (!idl_get_idl_new()) {
if (a != NULL && b != NULL) {
if (ALLIDS( a ) || ALLIDS( b ) ||
- (IDL_NIDS(a) + IDL_NIDS(b) > idl_get_allidslimit(ai))) {
+ (IDL_NIDS(a) + IDL_NIDS(b) > idl_get_allidslimit(ai, 0))) {
return( idl_allids( be ) );
}
}
@@ -975,11 +975,12 @@ int ldbm_ancestorid_move_subtree(
return ret;
}
-int ldbm_ancestorid_read(
+int ldbm_ancestorid_read_ext(
backend *be,
back_txn *txn,
ID id,
- IDList **idl
+ IDList **idl,
+ int allidslimit
)
{
int ret = 0;
@@ -989,8 +990,17 @@ int ldbm_ancestorid_read(
bv.bv_val = keybuf;
bv.bv_len = PR_snprintf(keybuf, sizeof(keybuf), "%lu", (u_long)id);
- *idl = index_read(be, LDBM_ANCESTORID_STR, indextype_EQUALITY, &bv, txn, &ret);
+ *idl = index_read_ext_allids(be, LDBM_ANCESTORID_STR, indextype_EQUALITY, &bv, txn, &ret, NULL, allidslimit);
return ret;
}
+int ldbm_ancestorid_read(
+ backend *be,
+ back_txn *txn,
+ ID id,
+ IDList **idl
+)
+{
+ return ldbm_ancestorid_read_ext(be, txn, id, idl, 0);
+}
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index f9939d4..e6cab21 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -634,6 +634,7 @@ struct ldbminfo {
int li_fat_lock; /* 608146 -- make this configurable, first */
int li_legacy_errcode; /* 615428 -- in case legacy err code is expected */
Slapi_Counter *li_global_usn_counter; /* global USN counter */
+ int li_reslimit_allids_handle; /* allids aka idlistscan */
};
/* li_flags could store these bits defined in ../slapi-plugin.h
@@ -801,6 +802,8 @@ typedef struct _back_search_result_set
/* Name of attribute type used for binder-based look through limit */
#define LDBM_LOOKTHROUGHLIMIT_AT "nsLookThroughLimit"
+/* Name of attribute type used for binder-based look through limit */
+#define LDBM_ALLIDSLIMIT_AT "nsIDListScanLimit"
/* OIDs for attribute types used internally */
#define LDBM_ENTRYDN_OID "2.16.840.1.113730.3.1.602"
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c
index eacb6ef..d214c54 100644
--- a/ldap/servers/slapd/back-ldbm/filterindex.c
+++ b/ldap/servers/slapd/back-ldbm/filterindex.c
@@ -50,11 +50,11 @@ extern const char *indextype_EQUALITY;
extern const char *indextype_APPROX;
extern const char *indextype_SUB;
-static IDList *ava_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int ftype, Slapi_Filter *nextf, int range, int *err);
-static IDList *presence_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err);
-static IDList *extensible_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err);
-static IDList *list_candidates(Slapi_PBlock *pb, backend *be, const char *base, Slapi_Filter *flist, int ftype, int *err);
-static IDList *substring_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err);
+static IDList *ava_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int ftype, Slapi_Filter *nextf, int range, int *err, int allidslimit);
+static IDList *presence_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err, int allidslimit);
+static IDList *extensible_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err, int allidslimit);
+static IDList *list_candidates(Slapi_PBlock *pb, backend *be, const char *base, Slapi_Filter *flist, int ftype, int *err, int allidslimit);
+static IDList *substring_candidates(Slapi_PBlock *pb, backend *be, Slapi_Filter *f, int *err, int allidslimit);
static IDList * range_candidates(
Slapi_PBlock *pb,
backend *be,
@@ -62,7 +62,8 @@ static IDList * range_candidates(
struct berval *low_val,
struct berval *high_val,
int *err,
- const Slapi_Attr *sattr
+ const Slapi_Attr *sattr,
+ int allidslimit
);
static IDList *
keys2idl(
@@ -72,18 +73,20 @@ keys2idl(
Slapi_Value **ivals,
int *err,
int *unindexed,
- back_txn *txn
+ back_txn *txn,
+ int allidslimit
);
IDList *
-filter_candidates(
+filter_candidates_ext(
Slapi_PBlock *pb,
backend *be,
const char *base,
Slapi_Filter *f,
Slapi_Filter *nextf,
int range,
- int *err
+ int *err,
+ int allidslimit
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_database->plg_private;
@@ -91,7 +94,11 @@ filter_candidates(
int ftype;
LDAPDebug( LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 );
-
+
+ if (!allidslimit) {
+ allidslimit = compute_allids_limit(pb, li);
+ }
+
/* check if this is to be serviced by a virtual index */
if(INDEX_FILTER_EVALUTED == index_subsys_evaluate_filter(f, (Slapi_DN*)slapi_be_getsuffix(be, 0), (IndexEntryList**)&result))
{
@@ -119,50 +126,50 @@ filter_candidates(
switch ( (ftype = slapi_filter_get_choice( f )) ) {
case LDAP_FILTER_EQUALITY:
LDAPDebug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
- result = ava_candidates( pb, be, f, LDAP_FILTER_EQUALITY, nextf, range, err );
+ result = ava_candidates( pb, be, f, LDAP_FILTER_EQUALITY, nextf, range, err, allidslimit );
break;
case LDAP_FILTER_SUBSTRINGS:
LDAPDebug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
- result = substring_candidates( pb, be, f, err );
+ result = substring_candidates( pb, be, f, err, allidslimit );
break;
case LDAP_FILTER_GE:
LDAPDebug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
result = ava_candidates( pb, be, f, LDAP_FILTER_GE, nextf, range,
- err );
+ err, allidslimit );
break;
case LDAP_FILTER_LE:
LDAPDebug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
result = ava_candidates( pb, be, f, LDAP_FILTER_LE, nextf, range,
- err );
+ err, allidslimit );
break;
case LDAP_FILTER_PRESENT:
LDAPDebug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
- result = presence_candidates( pb, be, f, err );
+ result = presence_candidates( pb, be, f, err, allidslimit );
break;
case LDAP_FILTER_APPROX:
LDAPDebug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
result = ava_candidates( pb, be, f, LDAP_FILTER_APPROX, nextf,
- range, err );
+ range, err, allidslimit );
break;
case LDAP_FILTER_EXTENDED:
LDAPDebug( LDAP_DEBUG_FILTER, "\tEXTENSIBLE\n", 0, 0, 0 );
- result = extensible_candidates( pb, be, f, err );
+ result = extensible_candidates( pb, be, f, err, allidslimit );
break;
case LDAP_FILTER_AND:
LDAPDebug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
- result = list_candidates( pb, be, base, f, LDAP_FILTER_AND, err );
+ result = list_candidates( pb, be, base, f, LDAP_FILTER_AND, err, allidslimit );
break;
case LDAP_FILTER_OR:
LDAPDebug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
- result = list_candidates( pb, be, base, f, LDAP_FILTER_OR, err );
+ result = list_candidates( pb, be, base, f, LDAP_FILTER_OR, err, allidslimit );
break;
case LDAP_FILTER_NOT:
@@ -182,6 +189,20 @@ filter_candidates(
return( result );
}
+IDList *
+filter_candidates(
+ Slapi_PBlock *pb,
+ backend *be,
+ const char *base,
+ Slapi_Filter *f,
+ Slapi_Filter *nextf,
+ int range,
+ int *err
+)
+{
+ return filter_candidates_ext(pb, be, base, f, nextf, range, err, 0);
+}
+
static IDList *
ava_candidates(
Slapi_PBlock *pb,
@@ -190,7 +211,8 @@ ava_candidates(
int ftype,
Slapi_Filter *nextf,
int range,
- int *err
+ int *err,
+ int allidslimit
)
{
char *type, *indextype = NULL;
@@ -238,13 +260,13 @@ ava_candidates(
switch ( ftype ) {
case LDAP_FILTER_GE:
- idl = range_candidates(pb, be, type, bval, NULL, err, &sattr);
+ idl = range_candidates(pb, be, type, bval, NULL, err, &sattr, allidslimit);
LDAPDebug( LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n",
(u_long)IDL_NIDS(idl), 0, 0 );
goto done;
break;
case LDAP_FILTER_LE:
- idl = range_candidates(pb, be, type, NULL, bval, err, &sattr);
+ idl = range_candidates(pb, be, type, NULL, bval, err, &sattr, allidslimit);
LDAPDebug( LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n",
(u_long)IDL_NIDS(idl), 0, 0 );
goto done;
@@ -288,7 +310,7 @@ ava_candidates(
ivals=ptr;
slapi_attr_assertion2keys_ava_sv( &sattr, &tmp, (Slapi_Value ***)&ivals, LDAP_FILTER_EQUALITY_FAST);
- idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn );
+ idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn, allidslimit );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
@@ -320,7 +342,7 @@ ava_candidates(
idl = idl_allids( be );
goto done;
}
- idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn );
+ idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn, allidslimit );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
@@ -340,7 +362,8 @@ presence_candidates(
Slapi_PBlock *pb,
backend *be,
Slapi_Filter *f,
- int *err
+ int *err,
+ int allidslimit
)
{
char *type;
@@ -356,8 +379,8 @@ presence_candidates(
return( NULL );
}
slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
- idl = index_read_ext( be, type, indextype_PRESENCE,
- NULL, &txn, err, &unindexed );
+ idl = index_read_ext_allids( be, type, indextype_PRESENCE,
+ NULL, &txn, err, &unindexed, allidslimit );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
@@ -371,9 +394,9 @@ presence_candidates(
"fallback to eq index as pres index gave allids\n",
0, 0, 0);
idl_free(idl);
- idl = index_range_read(pb, be, type, indextype_EQUALITY,
+ idl = index_range_read_ext(pb, be, type, indextype_EQUALITY,
SLAPI_OP_GREATER_OR_EQUAL,
- NULL, NULL, 0, &txn, err);
+ NULL, NULL, 0, &txn, err, allidslimit);
}
LDAPDebug( LDAP_DEBUG_TRACE, "<= presence_candidates %lu\n",
@@ -386,7 +409,8 @@ extensible_candidates(
Slapi_PBlock *glob_pb,
backend *be,
Slapi_Filter *f,
- int *err
+ int *err,
+ int allidslimit
)
{
IDList* idl = NULL;
@@ -462,10 +486,10 @@ extensible_candidates(
{
int unindexed = 0;
IDList* idl3 = (mrOP == SLAPI_OP_EQUAL) ?
- index_read_ext(be, mrTYPE, mrOID, *key, &txn,
- err, &unindexed) :
- index_range_read (pb, be, mrTYPE, mrOID, mrOP,
- *key, NULL, 0, &txn, err);
+ index_read_ext_allids(be, mrTYPE, mrOID, *key, &txn,
+ err, &unindexed, allidslimit) :
+ index_range_read_ext(pb, be, mrTYPE, mrOID, mrOP,
+ *key, NULL, 0, &txn, err, allidslimit);
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( glob_pb,
@@ -537,7 +561,8 @@ range_candidates(
struct berval *low_val,
struct berval *high_val,
int *err,
- const Slapi_Attr *sattr
+ const Slapi_Attr *sattr,
+ int allidslimit
)
{
IDList *idl = NULL;
@@ -572,17 +597,17 @@ range_candidates(
}
if (low == NULL) {
- idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
- SLAPI_OP_LESS_OR_EQUAL,
- high, NULL, 0, &txn, err);
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_LESS_OR_EQUAL,
+ high, NULL, 0, &txn, err, allidslimit);
} else if (high == NULL) {
- idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
- SLAPI_OP_GREATER_OR_EQUAL,
- low, NULL, 0, &txn, err);
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_GREATER_OR_EQUAL,
+ low, NULL, 0, &txn, err, allidslimit);
} else {
- idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
- SLAPI_OP_GREATER_OR_EQUAL,
- low, high, 1, &txn, err);
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_GREATER_OR_EQUAL,
+ low, high, 1, &txn, err, allidslimit);
}
done:
@@ -602,7 +627,8 @@ list_candidates(
const char *base,
Slapi_Filter *flist,
int ftype,
- int *err
+ int *err,
+ int allidslimit
)
{
IDList *idl, *tmp, *tmp2;
@@ -712,7 +738,7 @@ list_candidates(
Slapi_Attr sattr;
slapi_attr_init(&sattr, tpairs[0]);
- idl = range_candidates(pb, be, tpairs[0], vpairs[0], vpairs[1], err, &sattr);
+ idl = range_candidates(pb, be, tpairs[0], vpairs[0], vpairs[1], err, &sattr, allidslimit);
attr_done(&sattr);
LDAPDebug( LDAP_DEBUG_TRACE, "<= list_candidates %lu\n",
(u_long)IDL_NIDS(idl), 0, 0 );
@@ -741,7 +767,7 @@ list_candidates(
/* Fetch the IDL for foo */
/* Later we'll remember to call idl_notin() */
LDAPDebug( LDAP_DEBUG_TRACE,"NOT filter\n", 0, 0, 0 );
- tmp = ava_candidates( pb, be, slapi_filter_list_first(f), LDAP_FILTER_EQUALITY, nextf, range, err );
+ tmp = ava_candidates( pb, be, slapi_filter_list_first(f), LDAP_FILTER_EQUALITY, nextf, range, err, allidslimit );
} else {
if (fpairs[0] == f)
{
@@ -753,7 +779,7 @@ list_candidates(
slapi_attr_init(&sattr, tpairs[0]);
tmp = range_candidates(pb, be, tpairs[0],
- vpairs[0], vpairs[1], err, &sattr);
+ vpairs[0], vpairs[1], err, &sattr, allidslimit);
attr_done(&sattr);
if (tmp == NULL && ftype == LDAP_FILTER_AND)
{
@@ -765,7 +791,7 @@ list_candidates(
}
}
/* Proceed as normal */
- else if ( (tmp = filter_candidates( pb, be, base, f, nextf, range, err ))
+ else if ( (tmp = filter_candidates_ext( pb, be, base, f, nextf, range, err, allidslimit ))
== NULL && ftype == LDAP_FILTER_AND ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= list_candidates NULL\n", 0, 0, 0 );
@@ -802,9 +828,7 @@ list_candidates(
break;
} else {
Slapi_Operation *operation;
- struct ldbminfo *li;
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
- slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
idl = idl_union( be, idl, tmp );
idl_free( tmp );
@@ -812,13 +836,11 @@ list_candidates(
/* stop if we're already committed to an exhaustive
* search. :(
*/
- /* PAGED RESULTS: if not Directory Manager, we strictly limit
- * the idlist size by the lookthrough limit.
+ /* PAGED RESULTS: we strictly limit the idlist size by the allids (aka idlistscan) limit.
*/
if (operation->o_flags & OP_FLAG_PAGED_RESULTS) {
int nids = IDL_NIDS(idl);
- int lookthroughlimits = compute_lookthrough_limit( pb, li );
- if ( lookthroughlimits > 0 && nids > lookthroughlimits ) {
+ if ( allidslimit > 0 && nids > allidslimit ) {
idl_free( idl );
idl = idl_allids( be );
}
@@ -852,7 +874,8 @@ substring_candidates(
Slapi_PBlock *pb,
backend *be,
Slapi_Filter *f,
- int *err
+ int *err,
+ int allidslimit
)
{
char *type, *initial, *final;
@@ -892,7 +915,7 @@ substring_candidates(
* IDLists together.
*/
slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
- idl = keys2idl( be, type, indextype_SUB, ivals, err, &unindexed, &txn );
+ idl = keys2idl( be, type, indextype_SUB, ivals, err, &unindexed, &txn, allidslimit );
if ( unindexed ) {
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
pagedresults_set_unindexed( pb->pb_conn );
@@ -912,7 +935,8 @@ keys2idl(
Slapi_Value **ivals,
int *err,
int *unindexed,
- back_txn *txn
+ back_txn *txn,
+ int allidslimit
)
{
IDList *idl;
@@ -924,7 +948,7 @@ keys2idl(
for ( i = 0; ivals[i] != NULL; i++ ) {
IDList *idl2;
- idl2 = index_read_ext( be, type, indextype, slapi_value_get_berval(ivals[i]), txn, err, unindexed );
+ idl2 = index_read_ext_allids( be, type, indextype, slapi_value_get_berval(ivals[i]), txn, err, unindexed, allidslimit );
#ifdef LDAP_DEBUG
/* XXX if ( slapd_ldap_debug & LDAP_DEBUG_TRACE ) { XXX */
diff --git a/ldap/servers/slapd/back-ldbm/idl_new.c b/ldap/servers/slapd/back-ldbm/idl_new.c
index 298d5e8..aa69960 100644
--- a/ldap/servers/slapd/back-ldbm/idl_new.c
+++ b/ldap/servers/slapd/back-ldbm/idl_new.c
@@ -102,18 +102,29 @@ int idl_new_get_tune() {
return idl_tune;
}
-size_t idl_new_get_allidslimit(struct attrinfo *a)
+size_t idl_new_get_allidslimit(struct attrinfo *a, int allidslimit)
{
idl_private *priv = NULL;
+ if (allidslimit) {
+ return (size_t)allidslimit;
+ }
+
PR_ASSERT(NULL != a);
PR_ASSERT(NULL != a->ai_idl);
priv = a->ai_idl;
-
+
return priv->idl_allidslimit;
}
+int idl_new_exceeds_allidslimit(size_t count, struct attrinfo *a, int allidslimit)
+{
+ size_t limit = idl_new_get_allidslimit(a, allidslimit);
+ return (limit != (size_t)-1) && (count > limit);
+}
+
+
/* routine to initialize the private data used by the IDL code per-attribute */
int idl_new_init_private(backend *be,struct attrinfo *a)
{
@@ -127,7 +138,7 @@ int idl_new_init_private(backend *be,struct attrinfo *a)
if (NULL == priv) {
return -1; /* Memory allocation failure */
}
- priv->idl_allidslimit = li->li_allidsthreshold;
+ priv->idl_allidslimit = (size_t)li->li_allidsthreshold;
/* Initialize the structure */
a->ai_idl = (void*)priv;
return 0;
@@ -150,7 +161,8 @@ IDList * idl_new_fetch(
DBT *inkey,
DB_TXN *txn,
struct attrinfo *a,
- int *flag_err
+ int *flag_err,
+ int allidslimit
)
{
int ret = 0;
@@ -261,7 +273,7 @@ IDList * idl_new_fetch(
#if defined(DB_ALLIDS_ON_READ)
/* enforce the allids read limit */
if (NEW_IDL_NO_ALLID != *flag_err &&
- NULL != a && count > idl_new_get_allidslimit(a)) {
+ NULL != a && idl_new_exceeds_allidslimit(count, a, allidslimit)) {
idl->b_nids = 1;
idl->b_ids[0] = ALLID;
ret = DB_NOTFOUND; /* fool the code below into thinking that we finished the dups */
@@ -289,7 +301,7 @@ IDList * idl_new_fetch(
}
#if defined(DB_ALLIDS_ON_READ)
/* enforce the allids read limit */
- if (count > idl_new_get_allidslimit(a)) {
+ if (idl_new_exceeds_allidslimit(count, a, allidslimit)) {
idl->b_nids = 1;
idl->b_ids[0] = ALLID;
ret = DB_NOTFOUND; /* fool the code below into thinking that we finished the dups */
@@ -392,7 +404,7 @@ int idl_new_insert_key(
key->data, 0, 0);
goto error;
}
- if ((size_t)count > idl_new_get_allidslimit(a)) {
+ if ((size_t)count > idl_new_get_allidslimit(a, 0)) {
LDAPDebug(LDAP_DEBUG_TRACE, "allidslimit exceeded for key %s\n",
key->data, 0, 0);
cursor->c_close(cursor);
@@ -589,7 +601,7 @@ int idl_new_store_block(
#if defined(DB_ALLIDS_ON_WRITE)
/* allids check on input idl */
- if (ALLIDS(idl) || (idl->b_nids > (ID)idl_new_get_allidslimit(a))) {
+ if (ALLIDS(idl) || (idl->b_nids > (ID)idl_new_get_allidslimit(a, 0))) {
return idl_new_store_allids(be, db, key, txn);
}
#endif
@@ -638,7 +650,7 @@ int idl_new_store_block(
key->data, 0, 0);
goto error;
}
- if ((size_t)count > idl_new_get_allidslimit(a)) {
+ if ((size_t)count > idl_new_get_allidslimit(a, 0)) {
LDAPDebug(LDAP_DEBUG_TRACE, "allidslimit exceeded for key %s\n",
key->data, 0, 0);
cursor->c_close(cursor);
diff --git a/ldap/servers/slapd/back-ldbm/idl_shim.c b/ldap/servers/slapd/back-ldbm/idl_shim.c
index 10d8618..8d4d48a 100644
--- a/ldap/servers/slapd/back-ldbm/idl_shim.c
+++ b/ldap/servers/slapd/back-ldbm/idl_shim.c
@@ -62,8 +62,8 @@ void idl_new_set_tune(int val);
int idl_new_get_tune();
int idl_new_init_private(backend *be, struct attrinfo *a);
int idl_new_release_private(struct attrinfo *a);
-size_t idl_new_get_allidslimit(struct attrinfo *a);
-IDList * idl_new_fetch( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err );
+size_t idl_new_get_allidslimit(struct attrinfo *a, int allidslimit);
+IDList * idl_new_fetch( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err, int allidslimit );
int idl_new_insert_key( backend *be, DB* db, DBT *key, ID id, DB_TXN *txn, struct attrinfo *a,int *disposition );
int idl_new_delete_key( backend *be, DB *db, DBT *key, ID id, DB_TXN *txn, struct attrinfo *a );
int idl_new_store_block( backend *be,DB *db,DBT *key,IDList *idl,DB_TXN *txn,struct attrinfo *a);
@@ -115,24 +115,29 @@ int idl_release_private(struct attrinfo *a)
}
}
-size_t idl_get_allidslimit(struct attrinfo *a)
+size_t idl_get_allidslimit(struct attrinfo *a, int allidslimit)
{
if (idl_new) {
- return idl_new_get_allidslimit(a);
+ return idl_new_get_allidslimit(a, allidslimit);
} else {
return idl_old_get_allidslimit(a);
}
}
-IDList * idl_fetch( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err )
+IDList * idl_fetch_ext( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err, int allidslimit )
{
if (idl_new) {
- return idl_new_fetch(be,db,key,txn,a,err);
+ return idl_new_fetch(be,db,key,txn,a,err,allidslimit);
} else {
return idl_old_fetch(be,db,key,txn,a,err);
}
}
+IDList * idl_fetch( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err )
+{
+ return idl_fetch_ext(be, db, key, txn, a, err, 0);
+}
+
int idl_insert_key( backend *be, DB* db, DBT *key, ID id, DB_TXN *txn, struct attrinfo *a,int *disposition )
{
if (idl_new) {
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index 5e5c001..207c470 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -1931,7 +1931,7 @@ foreman_do_parentid(ImportJob *job, FifoItem *fi, struct attrinfo *parentid_ai)
if (idl_disposition == IDL_INSERT_NOW_ALLIDS) {
import_subcount_mother_init(job->mothers, parent_id,
- idl_get_allidslimit(parentid_ai)+1);
+ idl_get_allidslimit(parentid_ai, 0)+1);
} else if (idl_disposition == IDL_INSERT_ALLIDS) {
import_subcount_mother_count(job->mothers, parent_id);
}
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 67be28d..c8be27a 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -811,16 +811,21 @@ index_read(
* The unindexed flag can be used to distinguish between a
* return of allids due to the attr not being indexed or
* the value really being allids.
+ * You can pass in the value of the allidslimit (aka idlistscanlimit)
+ * with this version of the function
+ * if the value is 0, it will use the old method of getting the value
+ * from the attrinfo*.
*/
IDList *
-index_read_ext(
+index_read_ext_allids(
backend *be,
char *type,
const char *indextype,
const struct berval *val,
back_txn *txn,
int *err,
- int *unindexed
+ int *unindexed,
+ int allidslimit
)
{
DB *db = NULL;
@@ -945,7 +950,7 @@ index_read_ext(
}
for (retry_count = 0; retry_count < IDL_FETCH_RETRY_COUNT; retry_count++) {
*err = NEW_IDL_DEFAULT;
- idl = idl_fetch( be, db, &key, db_txn, ai, err );
+ idl = idl_fetch_ext( be, db, &key, db_txn, ai, err, allidslimit );
if(*err == DB_LOCK_DEADLOCK) {
ldbm_nasty("index read retrying transaction", 1045, *err);
continue;
@@ -974,6 +979,20 @@ index_read_ext(
return( idl );
}
+IDList *
+index_read_ext(
+ backend *be,
+ char *type,
+ const char *indextype,
+ const struct berval *val,
+ back_txn *txn,
+ int *err,
+ int *unindexed
+)
+{
+ return index_read_ext_allids(be, type, indextype, val, txn, err, unindexed, 0);
+}
+
/* This function compares two index keys. It is assumed
that the values are already normalized, since they should have
been when the index was created (by int_values2keys).
@@ -1101,7 +1120,7 @@ error:
}
IDList *
-index_range_read(
+index_range_read_ext(
Slapi_PBlock *pb,
backend *be,
char *type,
@@ -1111,7 +1130,8 @@ index_range_read(
struct berval *nextval,
int range,
back_txn *txn,
- int *err
+ int *err,
+ int allidslimit
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_database->plg_private;
@@ -1427,7 +1447,7 @@ index_range_read(
cur_key.flags = 0;
for (retry_count = 0; retry_count < IDL_FETCH_RETRY_COUNT; retry_count++) {
*err = NEW_IDL_DEFAULT;
- tmp = idl_fetch( be, db, &cur_key, NULL, ai, err );
+ tmp = idl_fetch_ext( be, db, &cur_key, NULL, ai, err, allidslimit );
if(*err == DB_LOCK_DEADLOCK) {
ldbm_nasty("index_range_read retrying transaction", 1090, *err);
continue;
@@ -1494,6 +1514,23 @@ error:
return( idl );
}
+IDList *
+index_range_read(
+ Slapi_PBlock *pb,
+ backend *be,
+ char *type,
+ const char *indextype,
+ int operator,
+ struct berval *val,
+ struct berval *nextval,
+ int range,
+ back_txn *txn,
+ int *err
+)
+{
+ return index_range_read_ext(pb, be, type, indextype, operator, val, nextval, range, txn, err, 0);
+}
+
/* DBDB: this function is never actually called */
#if 0
static int
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index e265eaf..44c7ff9 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -203,7 +203,7 @@ static int ldbm_config_allidsthreshold_set(void *arg, void *value, char *errorbu
/* Do whatever we can to make sure the data is ok. */
/* Catch attempts to configure a stupidly low allidsthreshold */
- if (val < 100) {
+ if ((val > -1) && (val < 100)) {
val = 100;
}
@@ -1231,7 +1231,7 @@ static int ldbm_config_db_tx_max_set(
static config_info ldbm_config[] = {
{CONFIG_LOOKTHROUGHLIMIT, CONFIG_TYPE_INT, "5000", &ldbm_config_lookthroughlimit_get, &ldbm_config_lookthroughlimit_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_MODE, CONFIG_TYPE_INT_OCTAL, "0600", &ldbm_config_mode_get, &ldbm_config_mode_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
- {CONFIG_IDLISTSCANLIMIT, CONFIG_TYPE_INT, "4000", &ldbm_config_allidsthreshold_get, &ldbm_config_allidsthreshold_set, CONFIG_FLAG_ALWAYS_SHOW},
+ {CONFIG_IDLISTSCANLIMIT, CONFIG_TYPE_INT, "4000", &ldbm_config_allidsthreshold_get, &ldbm_config_allidsthreshold_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_DIRECTORY, CONFIG_TYPE_STRING, "", &ldbm_config_directory_get, &ldbm_config_directory_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE|CONFIG_FLAG_SKIP_DEFAULT_SETTING},
{CONFIG_DBCACHESIZE, CONFIG_TYPE_SIZE_T, "10000000", &ldbm_config_dbcachesize_get, &ldbm_config_dbcachesize_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_DBNCACHE, CONFIG_TYPE_INT, "0", &ldbm_config_dbncache_get, &ldbm_config_dbncache_set, CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 43b4fab..94341c5 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -96,6 +96,26 @@ compute_lookthrough_limit( Slapi_PBlock *pb, struct ldbminfo *li )
return( limit );
}
+int
+compute_allids_limit( Slapi_PBlock *pb, struct ldbminfo *li )
+{
+ Slapi_Connection *conn = NULL;
+ int limit;
+
+ slapi_pblock_get( pb, SLAPI_CONNECTION, &conn);
+
+ if ( slapi_reslimit_get_integer_limit( conn,
+ li->li_reslimit_allids_handle, &limit )
+ != SLAPI_RESLIMIT_STATUS_SUCCESS ) {
+ PR_Lock(li->li_config_mutex);
+ limit = li->li_allidsthreshold;
+ PR_Unlock(li->li_config_mutex);
+ }
+
+ return( limit );
+}
+
+
/* don't free the berval, just clean it */
static void
berval_done(struct berval *val)
@@ -962,12 +982,14 @@ subtree_candidates(
IDList *candidates;
PRBool has_tombstone_filter;
int isroot = 0;
+ struct ldbminfo *li = (struct ldbminfo *) be->be_database->plg_private;
+ int allidslimit = compute_allids_limit(pb, li);
/* make (|(originalfilter)(objectclass=referral)) */
ftop= create_subtree_filter(filter, managedsait, &focref, &forr);
/* Fetch a candidate list for the original filter */
- candidates = filter_candidates( pb, be, base, ftop, NULL, 0, err );
+ candidates = filter_candidates_ext( pb, be, base, ftop, NULL, 0, err, allidslimit );
slapi_filter_free( forr, 0 );
slapi_filter_free( focref, 0 );
@@ -1000,7 +1022,7 @@ subtree_candidates(
idl_free(tmp);
idl_free(descendants);
} else if (!has_tombstone_filter) {
- *err = ldbm_ancestorid_read(be, &txn, e->ep_id, &descendants);
+ *err = ldbm_ancestorid_read_ext(be, &txn, e->ep_id, &descendants, allidslimit);
idl_insert(&descendants, e->ep_id);
candidates = idl_intersection(be, candidates, descendants);
idl_free(tmp);
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index a087a05..c30e987 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -198,6 +198,7 @@ struct backentry * uniqueid2entry(backend *be, const char *uniqueid,
* filterindex.c
*/
IDList * filter_candidates( Slapi_PBlock *pb, backend *be, const char *base, Slapi_Filter *f, Slapi_Filter *nextf, int range, int *err );
+IDList * filter_candidates_ext( Slapi_PBlock *pb, backend *be, const char *base, Slapi_Filter *f, Slapi_Filter *nextf, int range, int *err, int allidslimit );
/*
* findentry.c
@@ -242,6 +243,7 @@ void idl_insert(IDList **idl, ID id);
int idl_delete( IDList **idl, ID id );
IDList * idl_allids( backend *be );
IDList * idl_fetch( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err );
+IDList * idl_fetch_ext( backend *be, DB* db, DBT *key, DB_TXN *txn, struct attrinfo *a, int *err, int allidslimit );
int idl_insert_key( backend *be, DB* db, DBT *key, ID id, DB_TXN *txn, struct attrinfo *a,int *disposition );
int idl_delete_key( backend *be, DB *db, DBT *key, ID id, DB_TXN *txn, struct attrinfo *a );
IDList * idl_intersection( backend *be, IDList *a, IDList *b );
@@ -262,7 +264,7 @@ size_t idl_sizeof(IDList *idl);
int idl_store_block(backend *be,DB *db,DBT *key,IDList *idl,DB_TXN *txn,struct attrinfo *a);
void idl_set_tune(int val);
int idl_get_tune();
-size_t idl_get_allidslimit(struct attrinfo *a);
+size_t idl_get_allidslimit(struct attrinfo *a, int allidslimit);
int idl_get_idl_new();
int idl_new_compare_dups(
#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 3200
@@ -284,7 +286,9 @@ int id_array_init(Id_Array *new_guy, int size);
IDList* index_read( backend *be, char *type, const char* indextype, const struct berval* val, back_txn *txn, int *err );
IDList* index_read_ext( backend *be, char *type, const char* indextype, const struct berval* val, back_txn *txn, int *err, int *unindexed );
+IDList* index_read_ext_allids( backend *be, char *type, const char* indextype, const struct berval* val, back_txn *txn, int *err, int *unindexed, int allidslimit );
IDList* index_range_read( Slapi_PBlock *pb, backend *be, char *type, const char* indextype, int ftype, struct berval* val, struct berval* nextval, int range, back_txn *txn, int *err );
+IDList* index_range_read_ext( Slapi_PBlock *pb, backend *be, char *type, const char* indextype, int ftype, struct berval* val, struct berval* nextval, int range, back_txn *txn, int *err, int allidslimit );
const char *encode( const struct berval* data, char buf[BUFSIZ] );
extern const char* indextype_PRESENCE;
@@ -569,6 +573,7 @@ IDList* subtree_candidates(Slapi_PBlock *pb, backend *be, const char *base, cons
void search_set_tune(struct ldbminfo *li,int val);
int search_get_tune(struct ldbminfo *li);
int compute_lookthrough_limit( Slapi_PBlock *pb, struct ldbminfo *li );
+int compute_allids_limit( Slapi_PBlock *pb, struct ldbminfo *li );
/*
@@ -638,6 +643,7 @@ void replace_ldbm_config_value(char *conftype, char *val, struct ldbminfo *li);
int ldbm_ancestorid_create_index(backend *be);
int ldbm_ancestorid_index_entry(backend *be, struct backentry *e, int flags, back_txn *txn);
int ldbm_ancestorid_read(backend *be, back_txn *txn, ID id, IDList **idl);
+int ldbm_ancestorid_read_ext(backend *be, back_txn *txn, ID id, IDList **idl, int allidslimit);
int ldbm_ancestorid_move_subtree(
backend *be,
const Slapi_DN *olddn,
diff --git a/ldap/servers/slapd/back-ldbm/start.c b/ldap/servers/slapd/back-ldbm/start.c
index 6c19c76..9e18086 100644
--- a/ldap/servers/slapd/back-ldbm/start.c
+++ b/ldap/servers/slapd/back-ldbm/start.c
@@ -81,7 +81,17 @@ ldbm_back_start( Slapi_PBlock *pb )
if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT,
LDBM_LOOKTHROUGHLIMIT_AT, &li->li_reslimit_lookthrough_handle )
!= SLAPI_RESLIMIT_STATUS_SUCCESS ) {
- LDAPDebug( LDAP_DEBUG_ANY, "start: Resource limit registration failed\n",
+ LDAPDebug( LDAP_DEBUG_ANY, "start: Resource limit registration failed for lookthroughlimit\n",
+ 0, 0, 0 );
+ return SLAPI_FAIL_GENERAL;
+ }
+
+ /* register with the binder-based resource limit subsystem so that */
+ /* allidslimit (aka idlistscanlimit) can be supported on a per-connection basis. */
+ if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT,
+ LDBM_ALLIDSLIMIT_AT, &li->li_reslimit_allids_handle )
+ != SLAPI_RESLIMIT_STATUS_SUCCESS ) {
+ LDAPDebug( LDAP_DEBUG_ANY, "start: Resource limit registration failed for allidslimit\n",
0, 0, 0 );
return SLAPI_FAIL_GENERAL;
}
commit 015b31e7bc8e7072aa78ac33567c7873979cf622
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Sep 27 16:36:57 2011 -0600
Bug 741744 - MOD operations with chained delete/add get back error 53 on backend config
https://bugzilla.redhat.com/show_bug.cgi?id=741744
Resolves: bug 741744
Bug Description: MOD operations with chained delete/add get back error 53 on backend config
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: Allow ldbm config mods to use MOD_ADD and MOD_DELETE. The
purpose of this fix is to allow the specific sequence of
changetype: modify
delete: attrname
-
add: attrname
attrname: somevalue
-
Unfortunately, the way the DSE code works presents us with some quirks in
the behavior:
- There is an internal flag which keeps track of whether the value is the
default value or not
- Deleting an attribute resets the value to the default, but it will also
delete the attribute from the internal DSE representation, which means
if you attempt to delete an attribute which has already been deleted,
the server will return No such attribute (16) because the attribute has
already been deleted from the internal DSE - however, if you do an ldap
search for the value, you will see it in the entry with the default value.
- If the attribute gets in a weird state where it can't be deleted and it
can't be added, a mod_replace will get it back to normal
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index d8f60b2..e265eaf 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1288,7 +1288,7 @@ void ldbm_config_setup_default(struct ldbminfo *li)
char err_buf[SLAPI_DSE_RETURNTEXT_SIZE];
for (config = ldbm_config; config->config_name != NULL; config++) {
- ldbm_config_set((void *)li, config->config_name, ldbm_config, NULL /* use default */, err_buf, CONFIG_PHASE_INITIALIZATION, 1 /* apply */);
+ ldbm_config_set((void *)li, config->config_name, ldbm_config, NULL /* use default */, err_buf, CONFIG_PHASE_INITIALIZATION, 1 /* apply */, LDAP_MOD_REPLACE);
}
}
@@ -1583,7 +1583,7 @@ int ldbm_config_ignored_attr(char *attr_name)
}
/* Returns LDAP_SUCCESS on success */
-int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod)
+int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod, int mod_op)
{
config_info *config;
int use_default;
@@ -1617,20 +1617,25 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc
return LDAP_UNWILLING_TO_PERFORM;
}
- /* If the config phase is initialization or if bval is NULL, we will use
- * the default value for the attribute. */
- if (CONFIG_PHASE_INITIALIZATION == phase || NULL == bval) {
+ /* If the config phase is initialization or if bval is NULL or if we are deleting
+ the value, we will use the default value for the attribute. */
+ if ((CONFIG_PHASE_INITIALIZATION == phase) || (NULL == bval) || SLAPI_IS_MOD_DELETE(mod_op)) {
if (CONFIG_FLAG_SKIP_DEFAULT_SETTING & config->config_flags) {
return LDAP_SUCCESS; /* Skipping the default config setting */
}
use_default = 1;
} else {
use_default = 0;
-
- /* Since we are setting the value for the config attribute, we
- * need to turn on the CONFIG_FLAG_PREVIOUSLY_SET flag to make
- * sure this attribute is shown. */
- config->config_flags |= CONFIG_FLAG_PREVIOUSLY_SET;
+
+ /* cannot use mod add on a single valued attribute if the attribute was
+ previously set to a non-default value */
+ if (SLAPI_IS_MOD_ADD(mod_op) && apply_mod &&
+ (config->config_flags & CONFIG_FLAG_PREVIOUSLY_SET)) {
+ PR_snprintf(err_buf, SLAPI_DSE_RETURNTEXT_SIZE,
+ "cannot add a value to single valued attribute %s.\n",
+ attr_name);
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
}
switch(config->config_type) {
@@ -1745,6 +1750,20 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc
retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod);
break;
}
+
+ /* operation was successful and we applied the value? */
+ if (!retval && apply_mod) {
+ /* Since we are setting the value for the config attribute, we
+ * need to turn on the CONFIG_FLAG_PREVIOUSLY_SET flag to make
+ * sure this attribute is shown. */
+ if (use_default) {
+ /* attr deleted or we are using the default value */
+ config->config_flags &= ~CONFIG_FLAG_PREVIOUSLY_SET;
+ } else {
+ /* attr set explicitly */
+ config->config_flags |= CONFIG_FLAG_PREVIOUSLY_SET;
+ }
+ }
return retval;
}
@@ -1769,7 +1788,7 @@ static int parse_ldbm_config_entry(struct ldbminfo *li, Slapi_Entry *e, config_i
slapi_attr_first_value(attr, &sval);
bval = (struct berval *) slapi_value_get_berval(sval);
- if (ldbm_config_set(li, attr_name, config_array, bval, err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */) != LDAP_SUCCESS) {
+ if (ldbm_config_set(li, attr_name, config_array, bval, err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) {
LDAPDebug(LDAP_DEBUG_ANY, "Error with config attribute %s : %s\n", attr_name, err_buf, 0);
return 1;
}
@@ -1811,21 +1830,19 @@ int ldbm_config_modify_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore
if (ldbm_config_ignored_attr(attr_name)) {
continue;
}
-
- if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) ||
- SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
- rc= LDAP_UNWILLING_TO_PERFORM;
- PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed",
- (mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding");
- } else if (mods[i]->mod_op & LDAP_MOD_REPLACE) {
- /* This assumes there is only one bval for this mod. */
- rc = ldbm_config_set((void *) li, attr_name, ldbm_config,
- ( mods[i]->mod_bvalues == NULL ) ? NULL
- : mods[i]->mod_bvalues[0], returntext,
- ((li->li_flags&LI_FORCE_MOD_CONFIG)?
- CONFIG_PHASE_INTERNAL:CONFIG_PHASE_RUNNING),
- apply_mod);
- }
+
+ /* when deleting a value, and this is the last or only value, set
+ the config param to its default value
+ when adding a value, if the value is set to its default value, replace
+ it with the new value - otherwise, if it is single valued, reject the
+ operation with TYPE_OR_VALUE_EXISTS */
+ /* This assumes there is only one bval for this mod. */
+ rc = ldbm_config_set((void *) li, attr_name, ldbm_config,
+ ( mods[i]->mod_bvalues == NULL ) ? NULL
+ : mods[i]->mod_bvalues[0], returntext,
+ ((li->li_flags&LI_FORCE_MOD_CONFIG)?
+ CONFIG_PHASE_INTERNAL:CONFIG_PHASE_RUNNING),
+ apply_mod, mods[i]->mod_op);
}
}
@@ -1853,7 +1870,8 @@ void ldbm_config_internal_set(struct ldbminfo *li, char *attrname, char *value)
bval.bv_len = strlen(value);
if (ldbm_config_set((void *) li, attrname, ldbm_config, &bval,
- err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */) != LDAP_SUCCESS) {
+ err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */,
+ LDAP_MOD_REPLACE) != LDAP_SUCCESS) {
LDAPDebug(LDAP_DEBUG_ANY,
"Internal Error: Error setting instance config attr %s to %s: %s\n",
attrname, value, err_buf);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.h b/ldap/servers/slapd/back-ldbm/ldbm_config.h
index 5ba52a6..ffbc39f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.h
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.h
@@ -163,7 +163,7 @@ struct config_info {
int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *string1, char *string2, char *string3, int flags);
int ldbm_config_add_dse_entry(struct ldbminfo *li, char *entry, int flags);
void ldbm_config_get(void *arg, config_info *config, char *buf);
-int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod);
+int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod, int mod_op);
int ldbm_config_ignored_attr(char *attr_name);
/* Functions in ldbm_instance_config.c used in ldbm_config.c */
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
index 882f10a..7709cfb 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
@@ -303,7 +303,7 @@ ldbm_instance_config_setup_default(ldbm_instance *inst)
char err_buf[BUFSIZ];
for (config = ldbm_instance_config; config->config_name != NULL; config++) {
- ldbm_config_set((void *)inst, config->config_name, ldbm_instance_config, NULL /* use default */, err_buf, CONFIG_PHASE_INITIALIZATION, 1 /* apply */);
+ ldbm_config_set((void *)inst, config->config_name, ldbm_instance_config, NULL /* use default */, err_buf, CONFIG_PHASE_INITIALIZATION, 1 /* apply */, LDAP_MOD_REPLACE);
}
}
@@ -462,7 +462,7 @@ parse_ldbm_instance_config_entry(ldbm_instance *inst, Slapi_Entry *e, config_inf
bval = (struct berval *) slapi_value_get_berval(sval);
if (ldbm_config_set((void *) inst, attr_name, config_array, bval,
- err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */) != LDAP_SUCCESS) {
+ err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) {
LDAPDebug(LDAP_DEBUG_ANY, "Error with config attribute %s : %s\n",
attr_name, err_buf, 0);
return 1;
@@ -788,18 +788,10 @@ ldbm_instance_modify_config_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryB
continue;
}
- if ((mods[i]->mod_op & LDAP_MOD_DELETE) ||
- (mods[i]->mod_op & LDAP_MOD_ADD)) {
- rc= LDAP_UNWILLING_TO_PERFORM;
- PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed",
- (mods[i]->mod_op & LDAP_MOD_DELETE) ?
- "Deleting" : "Adding");
- } else if (mods[i]->mod_op & LDAP_MOD_REPLACE) {
/* This assumes there is only one bval for this mod. */
- rc = ldbm_config_set((void *) inst, attr_name,
- ldbm_instance_config, mods[i]->mod_bvalues[0], returntext,
- CONFIG_PHASE_RUNNING, apply_mod);
- }
+ rc = ldbm_config_set((void *) inst, attr_name,
+ ldbm_instance_config, mods[i]->mod_bvalues[0], returntext,
+ CONFIG_PHASE_RUNNING, apply_mod, mods[i]->mod_op);
}
}
@@ -827,7 +819,7 @@ ldbm_instance_config_internal_set(ldbm_instance *inst, char *attrname, char *val
bval.bv_len = strlen(value);
if (ldbm_config_set((void *) inst, attrname, ldbm_instance_config, &bval,
- err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */) != LDAP_SUCCESS) {
+ err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) {
LDAPDebug(LDAP_DEBUG_ANY,
"Internal Error: Error setting instance config attr %s to %s: %s\n",
attrname, value, err_buf);
12 years, 2 months
ldap/schema ldap/servers
by Nathan Kinder
ldap/schema/01core389.ldif | 3
ldap/servers/plugins/replication/repl5.h | 7
ldap/servers/plugins/replication/repl5_agmt.c | 143 +++++++++++++++++-
ldap/servers/plugins/replication/repl5_agmtlist.c | 32 +++-
ldap/servers/plugins/replication/repl5_tot_protocol.c | 2
ldap/servers/plugins/replication/repl_globals.c | 1
6 files changed, 179 insertions(+), 9 deletions(-)
New commits:
commit 0157534faae43bc95adda09edd7cd3f19dd32e50
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Fri Sep 16 10:01:08 2011 -0700
Bug 739172 - Allow separate fractional attrs for incremental and total protocols
This patch adds the ability to have a separate fractional attribute
list for the incremental and total update replication protocols.
A new nsDS5ReplicatedAttributeListTotal attribute can be added to a
replication agreement to list the attributes to exclude from the
total update protocol. This has the same format as the existing
nsDS5ReplicatedAttributeList attribute. If a separate total update
attribute list is not specified, the nsDS5ReplicatedAttributeList
value will be used for both incremental and total update. To use
a total update attribute list, an incremental list must be specified
as well.
diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif
index 90ca5cb..91bdb44 100644
--- a/ldap/schema/01core389.ldif
+++ b/ldap/schema/01core389.ldif
@@ -79,6 +79,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.582 NAME 'nsDS5ReplicaCredentials' DESC
attributeTypes: ( 2.16.840.1.113730.3.1.583 NAME 'nsDS5ReplicaBindMethod' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.584 NAME 'nsDS5ReplicaRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.585 NAME 'nsDS5ReplicatedAttributeList' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
+attributeTypes: ( 2.16.840.1.113730.3.1.594 NAME 'nsDS5ReplicatedAttributeListTotal' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.586 NAME 'nsDS5ReplicaUpdateSchedule' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.587 NAME 'nsds50ruv' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2027 NAME 'nsruvReplicaLastModified' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
@@ -138,7 +139,7 @@ objectClasses: ( 2.16.840.1.113730.3.2.110 NAME 'nsMappingTree' DESC 'Netscape d
objectClasses: ( 2.16.840.1.113730.3.2.104 NAME 'nsContainer' DESC 'Netscape defined objectclass' SUP top MUST ( CN ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.108 NAME 'nsDS5Replica' DESC 'Netscape defined objectclass' SUP top MUST ( nsDS5ReplicaRoot $ nsDS5ReplicaId ) MAY (cn $ nsDS5ReplicaType $ nsDS5ReplicaBindDN $ nsState $ nsDS5ReplicaName $ nsDS5Flags $ nsDS5Task $ nsDS5ReplicaReferral $ nsDS5ReplicaAutoReferral $ nsds5ReplicaPurgeDelay $ nsds5ReplicaTombstonePurgeInterval $ nsds5ReplicaChangeCount $ nsds5ReplicaLegacyConsumer) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.113 NAME 'nsTombstone' DESC 'Netscape defined objectclass' SUP top MAY ( nsParentUniqueId $ nscpEntryDN ) X-ORIGIN 'Netscape Directory Server' )
-objectClasses: ( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5ReplicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime ) X-ORIGIN 'Netscape Directory Server' )
+objectClasses: ( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicatedAttributeListTotal $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5ReplicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' )
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 79abb7a..79465e4 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -143,6 +143,7 @@ extern const char *type_nsds5ReplicaCredentials;
extern const char *type_nsds5ReplicaBindMethod;
extern const char *type_nsds5ReplicaRoot;
extern const char *type_nsds5ReplicatedAttributeList;
+extern const char *type_nsds5ReplicatedAttributeListTotal;
extern const char *type_nsds5ReplicaUpdateSchedule;
extern const char *type_nsds5ReplicaInitialize;
extern const char *type_nsds5ReplicaTimeout;
@@ -298,6 +299,7 @@ int agmt_get_bindmethod(const Repl_Agmt *ra);
Slapi_DN *agmt_get_replarea(const Repl_Agmt *ra);
int agmt_is_fractional(const Repl_Agmt *ra);
int agmt_is_fractional_attr(const Repl_Agmt *ra, const char *attrname);
+int agmt_is_fractional_attr_total(const Repl_Agmt *ra, const char *attrname);
int agmt_is_50_mm_protocol(const Repl_Agmt *ra);
int agmt_matches_name(const Repl_Agmt *ra, const Slapi_DN *name);
int agmt_replarea_matches(const Repl_Agmt *ra, const Slapi_DN *name);
@@ -332,9 +334,12 @@ void agmt_set_last_init_status (Repl_Agmt *ra, int ldaprc, int replrc, const cha
void agmt_inc_last_update_changecount (Repl_Agmt *ra, ReplicaId rid, int skipped);
void agmt_get_changecount_string (Repl_Agmt *ra, char *buf, int bufsize);
int agmt_set_replicated_attributes_from_entry(Repl_Agmt *ra, const Slapi_Entry *e);
+int agmt_set_replicated_attributes_total_from_entry(Repl_Agmt *ra, const Slapi_Entry *e);
int agmt_set_replicated_attributes_from_attr(Repl_Agmt *ra, Slapi_Attr *sattr);
+int agmt_set_replicated_attributes_total_from_attr(Repl_Agmt *ra, Slapi_Attr *sattr);
char **agmt_get_fractional_attrs(const Repl_Agmt *ra);
-char **agmt_validate_replicated_attributes(Repl_Agmt *ra);
+char **agmt_get_fractional_attrs_total(const Repl_Agmt *ra);
+char **agmt_validate_replicated_attributes(Repl_Agmt *ra, int total);
void* agmt_get_priv (const Repl_Agmt *agmt);
void agmt_set_priv (Repl_Agmt *agmt, void* priv);
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
index b5e66ee..61aa9ba 100644
--- a/ldap/servers/plugins/replication/repl5_agmt.c
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
@@ -104,6 +104,7 @@ typedef struct repl5agmt {
int bindmethod; /* Bind method - simple, SSL */
Slapi_DN *replarea; /* DN of replicated area */
char **frac_attrs; /* list of fractional attributes to be replicated */
+ char **frac_attrs_total; /* list of fractional attributes to be replicated for total update protocol */
Schedule *schedule; /* Scheduling information */
int auto_initialize; /* 1 = automatically re-initialize replica */
const Slapi_DN *dn; /* DN of replication agreement entry */
@@ -159,7 +160,8 @@ nsds5ReplicaBindDN
nsds5ReplicaCredentials
nsds5ReplicaBindMethod - "SIMPLE" or "SSLCLIENTAUTH".
nsds5ReplicaRoot - Replicated suffix
-nsds5ReplicatedAttributeList - Unused so far (meant for fractional repl).
+nsds5ReplicatedAttributeList - Fractional attrs for incremental update protocol (and total if not separately defined)
+nsds5ReplicatedAttributeListTotal - Fractional attrs for total update protocol
nsds5ReplicaUpdateSchedule
nsds5ReplicaTimeout - Outbound repl operations timeout
nsds50ruv - consumer's RUV
@@ -402,7 +404,7 @@ agmt_new_from_entry(Slapi_Entry *e)
agmt_get_long_name(ra));
}
/* Check that there are no verboten attributes in the exclude list */
- denied_attrs = agmt_validate_replicated_attributes(ra);
+ denied_attrs = agmt_validate_replicated_attributes(ra, 0 /* incremental */);
if (denied_attrs)
{
/* Report the error to the client */
@@ -414,6 +416,28 @@ agmt_new_from_entry(Slapi_Entry *e)
goto loser;
}
+ /* Total update fractional attributes */
+ slapi_entry_attr_find(e, type_nsds5ReplicatedAttributeListTotal, &sattr);
+ if (sattr && agmt_set_replicated_attributes_total_from_attr(ra, sattr) != 0)
+ {
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
+ "agmtlist_add_callback: failed to parse total "
+ "update replicated attributes for agreement %s\n",
+ agmt_get_long_name(ra));
+ }
+ /* Check that there are no verboten attributes in the exclude list */
+ denied_attrs = agmt_validate_replicated_attributes(ra, 1 /* total */);
+ if (denied_attrs)
+ {
+ /* Report the error to the client */
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
+ "WARNING: Attempt to exclude illegal attributes "
+ "from a fractional agreement for total update protocol\n");
+ /* Free the list */
+ slapi_ch_array_free(denied_attrs);
+ goto loser;
+ }
+
if (!agmt_is_valid(ra))
{
goto loser;
@@ -440,7 +464,6 @@ loser:
}
-
Repl_Agmt *
agmt_new_from_pblock(Slapi_PBlock *pb)
{
@@ -492,6 +515,7 @@ agmt_delete(void **rap)
slapi_ch_free((void **)&(ra->binddn));
slapi_ch_array_free(ra->frac_attrs);
+ slapi_ch_array_free(ra->frac_attrs_total);
if (NULL != ra->creds)
{
@@ -790,6 +814,23 @@ agmt_get_fractional_attrs(const Repl_Agmt *ra)
PR_Unlock(ra->lock);
return return_value;
}
+
+/* Returns a COPY of the attr list, remember to free it */
+char **
+agmt_get_fractional_attrs_total(const Repl_Agmt *ra)
+{
+ char ** return_value = NULL;
+ PR_ASSERT(NULL != ra);
+ if (NULL == ra->frac_attrs_total)
+ {
+ return agmt_get_fractional_attrs(ra);
+ }
+ PR_Lock(ra->lock);
+ return_value = charray_dup(ra->frac_attrs_total);
+ PR_Unlock(ra->lock);
+ return return_value;
+}
+
int
agmt_is_fractional_attr(const Repl_Agmt *ra, const char *attrname)
{
@@ -806,6 +847,21 @@ agmt_is_fractional_attr(const Repl_Agmt *ra, const char *attrname)
return return_value;
}
+int agmt_is_fractional_attr_total(const Repl_Agmt *ra, const char *attrname)
+{
+ int return_value;
+ PR_ASSERT(NULL != ra);
+ if (NULL == ra->frac_attrs_total)
+ {
+ return agmt_is_fractional_attr(ra, attrname);
+ }
+ PR_Lock(ra->lock);
+ /* Scan the list looking for a match */
+ return_value = charray_inlist(ra->frac_attrs_total,(char*)attrname);
+ PR_Unlock(ra->lock);
+ return return_value;
+}
+
int
agmt_get_auto_initialize(const Repl_Agmt *ra)
{
@@ -1258,6 +1314,40 @@ agmt_set_replicated_attributes_from_entry(Repl_Agmt *ra, const Slapi_Entry *e)
}
/*
+ * Set or reset the set of total update replicated attributes.
+ *
+ * Returns 0 if DN set, or -1 if an error occurred.
+ */
+int
+agmt_set_replicated_attributes_total_from_entry(Repl_Agmt *ra, const Slapi_Entry *e)
+{
+ Slapi_Attr *sattr = NULL;
+ int return_value = 0;
+
+ PR_ASSERT(NULL != ra);
+ slapi_entry_attr_find(e, type_nsds5ReplicatedAttributeListTotal, &sattr);
+ PR_Lock(ra->lock);
+ if (ra->frac_attrs_total)
+ {
+ slapi_ch_array_free(ra->frac_attrs_total);
+ ra->frac_attrs_total = NULL;
+ }
+ if (NULL != sattr)
+ {
+ Slapi_Value *sval = NULL;
+ slapi_attr_first_value(sattr, &sval);
+ if (NULL != sval)
+ {
+ const char *val = slapi_value_get_string(sval);
+ return_value = agmt_parse_excluded_attrs_config_attr(val,&(ra->frac_attrs_total));
+ }
+ }
+ PR_Unlock(ra->lock);
+ prot_notify_agmt_changed(ra->protocol, ra->long_name);
+ return return_value;
+}
+
+/*
* Set or reset the set of replicated attributes.
*
* Returns 0 if DN set, or -1 if an error occurred.
@@ -1289,8 +1379,39 @@ agmt_set_replicated_attributes_from_attr(Repl_Agmt *ra, Slapi_Attr *sattr)
return return_value;
}
+/*
+ * Set or reset the set of total update replicated attributes.
+ *
+ * Returns 0 if DN set, or -1 if an error occurred.
+ */
+int
+agmt_set_replicated_attributes_total_from_attr(Repl_Agmt *ra, Slapi_Attr *sattr)
+{
+ int return_value = 0;
+
+ PR_ASSERT(NULL != ra);
+ PR_Lock(ra->lock);
+ if (ra->frac_attrs_total)
+ {
+ slapi_ch_array_free(ra->frac_attrs_total);
+ ra->frac_attrs_total = NULL;
+ }
+ if (NULL != sattr)
+ {
+ Slapi_Value *sval = NULL;
+ slapi_attr_first_value(sattr, &sval);
+ if (NULL != sval)
+ {
+ const char *val = slapi_value_get_string(sval);
+ return_value = agmt_parse_excluded_attrs_config_attr(val,&(ra->frac_attrs_total));
+ }
+ }
+ PR_Unlock(ra->lock);
+ return return_value;
+}
+
char **
-agmt_validate_replicated_attributes(Repl_Agmt *ra)
+agmt_validate_replicated_attributes(Repl_Agmt *ra, int total)
{
static char* verbotten_attrs[] = {
@@ -1302,7 +1423,19 @@ agmt_validate_replicated_attributes(Repl_Agmt *ra)
};
char **retval = NULL;
- char **frac_attrs = ra->frac_attrs;
+ char **frac_attrs = NULL;
+
+ /* If checking for total update, use the total attr list
+ * if it exists. If oen is not set, use the incremental
+ * attr list. */
+ if (total && ra->frac_attrs_total)
+ {
+ frac_attrs = ra->frac_attrs_total;
+ }
+ else
+ {
+ frac_attrs = ra->frac_attrs;
+ }
/* Iterate over the frac attrs */
if (frac_attrs)
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
index 34da6d0..8cc2cc3 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -425,7 +425,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
rc = SLAPI_DSE_CALLBACK_ERROR;
}
/* Check that there are no verboten attributes in the exclude list */
- denied_attrs = agmt_validate_replicated_attributes(agmt);
+ denied_attrs = agmt_validate_replicated_attributes(agmt, 0 /* incremental */);
if (denied_attrs)
{
/* Report the error to the client */
@@ -441,6 +441,36 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
}
}
else if (slapi_attr_types_equivalent(mods[i]->mod_type,
+ type_nsds5ReplicatedAttributeListTotal))
+ {
+ char **denied_attrs = NULL;
+ /* New set of excluded attributes */
+ if (agmt_set_replicated_attributes_total_from_entry(agmt, e) != 0)
+ {
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: "
+ "failed to update total update replicated attributes for agreement %s\n",
+ agmt_get_long_name(agmt));
+ *returncode = LDAP_OPERATIONS_ERROR;
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ }
+ /* Check that there are no verboten attributes in the exclude list */
+ denied_attrs = agmt_validate_replicated_attributes(agmt, 1 /* total */);
+ if (denied_attrs)
+ {
+ /* Report the error to the client */
+ PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "attempt to exclude an illegal total update "
+ "attribute in a fractional agreement");
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: "
+ "attempt to exclude an illegal total update attribute in a fractional agreement\n");
+
+ *returncode = LDAP_UNWILLING_TO_PERFORM;
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ /* Free the deny list if we got one */
+ slapi_ch_array_free(denied_attrs);
+ break;
+ }
+ }
+ else if (slapi_attr_types_equivalent(mods[i]->mod_type,
"nsds5debugreplicatimeout"))
{
char *val = slapi_entry_attr_get_charptr(e, "nsds5debugreplicatimeout");
diff --git a/ldap/servers/plugins/replication/repl5_tot_protocol.c b/ldap/servers/plugins/replication/repl5_tot_protocol.c
index ca151bf..5eeef5d 100644
--- a/ldap/servers/plugins/replication/repl5_tot_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_tot_protocol.c
@@ -673,7 +673,7 @@ int send_entry (Slapi_Entry *e, void *cb_data)
if (agmt_is_fractional(prp->agmt))
{
- frac_excluded_attrs = agmt_get_fractional_attrs(prp->agmt);
+ frac_excluded_attrs = agmt_get_fractional_attrs_total(prp->agmt);
}
/* convert the entry to the on the wire format */
diff --git a/ldap/servers/plugins/replication/repl_globals.c b/ldap/servers/plugins/replication/repl_globals.c
index f409be6..f0aea12 100644
--- a/ldap/servers/plugins/replication/repl_globals.c
+++ b/ldap/servers/plugins/replication/repl_globals.c
@@ -120,6 +120,7 @@ const char *type_nsds5ReplicaCredentials = "nsds5ReplicaCredentials";
const char *type_nsds5ReplicaBindMethod = "nsds5ReplicaBindMethod";
const char *type_nsds5ReplicaRoot = "nsds5ReplicaRoot";
const char *type_nsds5ReplicatedAttributeList = "nsds5ReplicatedAttributeList";
+const char *type_nsds5ReplicatedAttributeListTotal = "nsds5ReplicatedAttributeListTotal";
const char *type_nsds5ReplicaUpdateSchedule = "nsds5ReplicaUpdateSchedule";
const char *type_nsds5ReplicaInitialize = "nsds5BeginReplicaRefresh";
const char *type_nsds5ReplicaTimeout = "nsds5ReplicaTimeout";
12 years, 2 months
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/back-ldbm/back-ldbm.h | 6 +-
ldap/servers/slapd/back-ldbm/dblayer.c | 6 +-
ldap/servers/slapd/back-ldbm/filterindex.c | 43 +++++++++++++------
ldap/servers/slapd/back-ldbm/instance.c | 6 +-
ldap/servers/slapd/back-ldbm/ldbm_add.c | 22 +++++++---
ldap/servers/slapd/back-ldbm/ldbm_bind.c | 4 +
ldap/servers/slapd/back-ldbm/ldbm_compare.c | 4 +
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 7 ++-
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 21 +++++++--
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 37 +++++++++++-----
ldap/servers/slapd/back-ldbm/ldbm_search.c | 28 ++++++++----
ldap/servers/slapd/back-ldbm/misc.c | 6 +-
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 3 +
ldap/servers/slapd/back-ldbm/sort.c | 6 +-
ldap/servers/slapd/back-ldbm/vlv.c | 55 +++++++++++++++++--------
ldap/servers/slapd/back-ldbm/vlv_srch.c | 4 +
16 files changed, 180 insertions(+), 78 deletions(-)
New commits:
commit 6120b3d50ad10b00e98e517e5947e3e3d5ea3652
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 15 14:16:12 2011 -0600
Make all backend operations transaction aware
All backend functions will use the parent transaction (if any) to perform
all database read/write operations, and for the creation of nested
transactions. The pseudocode looks like this:
begin operation
grab parent txn from pblock SLAPI_TXN and save to a local variable
use this parent txn to perform any searches or other ops before the
nested txn is created (if created - search ops do not do this)
create the nested txn (if a write op) using the parent_txn
stash the new txn in the pblock SLAPI_TXN
call the betxnpreop plugins
perform the backend ops inside the txn
call the betxnpostop plugins
commit the nested txn
restore the saved parent_txn to the pblock SLAPI_TXN
upon failure, abort the nested txn and restore the saved parent_txn
to the pblock SLAPI_TXN
There were a few api changes to allow the txn to be passed in wherever
it is needed.
The database lock was changed from a mutex to a monitor to allow plugins
to call other plugins inside the same parent transaction.
Reviewed by: nhosoi (Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index adf593e..f9939d4 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -729,8 +729,10 @@ typedef struct ldbm_instance {
* parent of the instance name dir */
char *inst_parent_dir_name; /* Absolute parent dir for this inst */
- PRLock *inst_db_mutex; /* Used to synchronize modify operations
- * on this instance. */
+ PRMonitor *inst_db_mutex; /* Used to synchronize write operations
+ * on this instance - the monitor is re-entrant
+ * which allows plugins in the same transaction
+ * to share the lock */
dblayer_handle *inst_handle_head; /* These are used to maintain a list */
dblayer_handle *inst_handle_tail; /* of open db handles for this instance */
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index b158311..0e5804c 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -639,7 +639,7 @@ int dblayer_terminate(struct ldbminfo *li)
inst_obj = objset_next_obj(li->li_instance_set, inst_obj)) {
inst = (ldbm_instance *)object_get_data(inst_obj);
if (NULL != inst->inst_db_mutex) {
- PR_DestroyLock(inst->inst_db_mutex);
+ PR_DestroyMonitor(inst->inst_db_mutex);
inst->inst_db_mutex = NULL;
}
if (NULL != inst->inst_handle_list_mutex) {
@@ -3564,7 +3564,7 @@ void dblayer_lock_backend(backend *be)
PR_ASSERT(NULL != inst);
if (NULL != inst->inst_db_mutex) {
- PR_Lock(inst->inst_db_mutex);
+ PR_EnterMonitor(inst->inst_db_mutex);
}
}
@@ -3577,7 +3577,7 @@ void dblayer_unlock_backend(backend *be)
PR_ASSERT(NULL != inst);
if (NULL != inst->inst_db_mutex) {
- PR_Unlock(inst->inst_db_mutex);
+ PR_ExitMonitor(inst->inst_db_mutex);
}
}
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c
index e237749..eacb6ef 100644
--- a/ldap/servers/slapd/back-ldbm/filterindex.c
+++ b/ldap/servers/slapd/back-ldbm/filterindex.c
@@ -71,7 +71,8 @@ keys2idl(
const char *indextype,
Slapi_Value **ivals,
int *err,
- int *unindexed
+ int *unindexed,
+ back_txn *txn
);
IDList *
@@ -100,11 +101,13 @@ filter_candidates(
}
if (li->li_use_vlv) {
+ back_txn txn = {NULL};
/* first, check to see if this particular filter node matches any
* vlv indexes we're keeping. if so, we can use that index
* instead.
*/
- result = vlv_find_index_by_filter(be, base, f);
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
+ result = vlv_find_index_by_filter_txn(be, base, f, &txn);
if (result) {
LDAPDebug( LDAP_DEBUG_TRACE, "<= filter_candidates %lu (vlv)\n",
(u_long)IDL_NIDS(result), 0, 0 );
@@ -197,6 +200,7 @@ ava_candidates(
IDList *idl = NULL;
int unindexed = 0;
Slapi_Attr sattr;
+ back_txn txn = {NULL};
LDAPDebug( LDAP_DEBUG_TRACE, "=> ava_candidates\n", 0, 0, 0 );
@@ -270,6 +274,7 @@ ava_candidates(
* reset ivals[0]->bv.bv_val) or alloc an entirely new ivals array.
*/
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
if(ftype==LDAP_FILTER_EQUALITY) {
Slapi_Value tmp, *ptr[2], fake;
char buf[1024];
@@ -283,7 +288,7 @@ ava_candidates(
ivals=ptr;
slapi_attr_assertion2keys_ava_sv( &sattr, &tmp, (Slapi_Value ***)&ivals, LDAP_FILTER_EQUALITY_FAST);
- idl = keys2idl( be, type, indextype, ivals, err, &unindexed );
+ idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
@@ -315,7 +320,7 @@ ava_candidates(
idl = idl_allids( be );
goto done;
}
- idl = keys2idl( be, type, indextype, ivals, err, &unindexed );
+ idl = keys2idl( be, type, indextype, ivals, err, &unindexed, &txn );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
@@ -341,6 +346,7 @@ presence_candidates(
char *type;
IDList *idl;
int unindexed = 0;
+ back_txn txn = {NULL};
LDAPDebug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
@@ -349,8 +355,9 @@ presence_candidates(
0, 0, 0 );
return( NULL );
}
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
idl = index_read_ext( be, type, indextype_PRESENCE,
- NULL, NULL, err, &unindexed );
+ NULL, &txn, err, &unindexed );
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
@@ -366,7 +373,7 @@ presence_candidates(
idl_free(idl);
idl = index_range_read(pb, be, type, indextype_EQUALITY,
SLAPI_OP_GREATER_OR_EQUAL,
- NULL, NULL, 0, NULL, err);
+ NULL, NULL, 0, &txn, err);
}
LDAPDebug( LDAP_DEBUG_TRACE, "<= presence_candidates %lu\n",
@@ -386,7 +393,9 @@ extensible_candidates(
Slapi_PBlock* pb = slapi_pblock_new();
int mrOP = 0;
Slapi_Operation *op = NULL;
+ back_txn txn = {NULL};
LDAPDebug (LDAP_DEBUG_TRACE, "=> extensible_candidates\n", 0, 0, 0);
+ slapi_pblock_get(glob_pb, SLAPI_TXN, &txn.back_txn_txn);
if ( ! slapi_mr_filter_index (f, pb) && !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_QUERY_OPERATOR, &mrOP))
{
switch (mrOP)
@@ -453,10 +462,10 @@ extensible_candidates(
{
int unindexed = 0;
IDList* idl3 = (mrOP == SLAPI_OP_EQUAL) ?
- index_read_ext(be, mrTYPE, mrOID, *key, NULL,
+ index_read_ext(be, mrTYPE, mrOID, *key, &txn,
err, &unindexed) :
index_range_read (pb, be, mrTYPE, mrOID, mrOP,
- *key, NULL, 0, NULL, err);
+ *key, NULL, 0, &txn, err);
if ( unindexed ) {
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
slapi_pblock_set( glob_pb,
@@ -534,9 +543,12 @@ range_candidates(
IDList *idl = NULL;
struct berval *low = NULL, *high = NULL;
struct berval **lows = NULL, **highs = NULL;
+ back_txn txn = {NULL};
LDAPDebug(LDAP_DEBUG_TRACE, "=> range_candidates attr=%s\n", type, 0, 0);
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
+
if (low_val != NULL) {
slapi_attr_assertion2keys_ava(sattr, low_val, &lows, LDAP_FILTER_EQUALITY);
if (lows == NULL || *lows == NULL) {
@@ -562,15 +574,15 @@ range_candidates(
if (low == NULL) {
idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
SLAPI_OP_LESS_OR_EQUAL,
- high, NULL, 0, NULL, err);
+ high, NULL, 0, &txn, err);
} else if (high == NULL) {
idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
SLAPI_OP_GREATER_OR_EQUAL,
- low, NULL, 0, NULL, err);
+ low, NULL, 0, &txn, err);
} else {
idl = index_range_read(pb, be, type, (char*)indextype_EQUALITY,
SLAPI_OP_GREATER_OR_EQUAL,
- low, high, 1, NULL, err);
+ low, high, 1, &txn, err);
}
done:
@@ -850,6 +862,7 @@ substring_candidates(
int unindexed = 0;
unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
Slapi_Attr sattr;
+ back_txn txn = {NULL};
LDAPDebug( LDAP_DEBUG_TRACE, "=> sub_candidates\n", 0, 0, 0 );
@@ -878,7 +891,8 @@ substring_candidates(
* look up each key in the index, ANDing the resulting
* IDLists together.
*/
- idl = keys2idl( be, type, indextype_SUB, ivals, err, &unindexed );
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
+ idl = keys2idl( be, type, indextype_SUB, ivals, err, &unindexed, &txn );
if ( unindexed ) {
slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
pagedresults_set_unindexed( pb->pb_conn );
@@ -897,7 +911,8 @@ keys2idl(
const char *indextype,
Slapi_Value **ivals,
int *err,
- int *unindexed
+ int *unindexed,
+ back_txn *txn
)
{
IDList *idl;
@@ -909,7 +924,7 @@ keys2idl(
for ( i = 0; ivals[i] != NULL; i++ ) {
IDList *idl2;
- idl2 = index_read_ext( be, type, indextype, slapi_value_get_berval(ivals[i]), NULL, err, unindexed );
+ idl2 = index_read_ext( be, type, indextype, slapi_value_get_berval(ivals[i]), txn, err, unindexed );
#ifdef LDAP_DEBUG
/* XXX if ( slapd_ldap_debug & LDAP_DEBUG_TRACE ) { XXX */
diff --git a/ldap/servers/slapd/back-ldbm/instance.c b/ldap/servers/slapd/back-ldbm/instance.c
index 7e5a4cd..74a01a8 100644
--- a/ldap/servers/slapd/back-ldbm/instance.c
+++ b/ldap/servers/slapd/back-ldbm/instance.c
@@ -95,9 +95,9 @@ int ldbm_instance_create(backend *be, char *name)
}
/* Lock used to synchronize modify operations. */
- inst->inst_db_mutex = PR_NewLock();
+ inst->inst_db_mutex = PR_NewMonitor();
if (NULL == inst->inst_db_mutex) {
- LDAPDebug(LDAP_DEBUG_ANY, "ldbm_instance_create: PR_NewLock failed\n",
+ LDAPDebug(LDAP_DEBUG_ANY, "ldbm_instance_create: PR_NewMonitor failed\n",
0, 0, 0);
rc = -1;
goto error;
@@ -385,7 +385,7 @@ ldbm_instance_destructor(void **arg)
PR_DestroyLock(inst->inst_config_mutex);
slapi_ch_free_string(&inst->inst_dir_name);
slapi_ch_free_string(&inst->inst_parent_dir_name);
- PR_DestroyLock(inst->inst_db_mutex);
+ PR_DestroyMonitor(inst->inst_db_mutex);
PR_DestroyLock(inst->inst_handle_list_mutex);
PR_DestroyLock(inst->inst_nextid_mutex);
PR_DestroyCondVar(inst->inst_indexer_cv);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c
index 274e3d7..5ade337 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_add.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c
@@ -121,7 +121,7 @@ ldbm_back_add( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e );
slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot );
slapi_pblock_get( pb, SLAPI_MANAGEDSAIT, &managedsait );
- slapi_pblock_get( pb, SLAPI_PARENT_TXN, (void**)&parent_txn );
+ slapi_pblock_get( pb, SLAPI_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation );
slapi_pblock_get( pb, SLAPI_BACKEND, &be);
@@ -142,6 +142,9 @@ ldbm_back_add( Slapi_PBlock *pb )
slapi_entry_delete_values( e, numsubordinates, NULL );
dblayer_txn_init(li,&txn);
+ /* the calls to get_copy_of_entry require the parent txn if any
+ so set txn to the parent_txn until we begin the child transaction */
+ txn.back_txn_txn = parent_txn;
/* The dblock serializes writes to the database,
* which reduces deadlocking in the db code,
@@ -354,7 +357,7 @@ ldbm_back_add( Slapi_PBlock *pb )
*/
addr.dn = addr.udn = NULL;
addr.uniqueid = (char *)slapi_entry_get_uniqueid(e); /* jcm - cast away const */
- tombstoneentry = find_entry2modify( pb, be, &addr, NULL );
+ tombstoneentry = find_entry2modify( pb, be, &addr, &txn );
if ( tombstoneentry==NULL )
{
ldap_result_code= -1;
@@ -647,10 +650,13 @@ ldbm_back_add( Slapi_PBlock *pb )
* So, we believe that no code up till here actually added anything
* to persistent store. From now on, we're transacted
*/
-
+ txn.back_txn_txn = NULL; /* ready to create the child transaction */
for (retry_count = 0; retry_count < RETRY_TIMES; retry_count++) {
if (retry_count > 0) {
dblayer_txn_abort(li,&txn);
+ /* txn is no longer valid - reset slapi_txn to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
/* We're re-trying */
LDAPDebug( LDAP_DEBUG_TRACE, "Add Retrying Transaction\n", 0, 0, 0 );
#ifndef LDBM_NO_BACKOFF_DELAY
@@ -672,8 +678,8 @@ ldbm_back_add( Slapi_PBlock *pb )
goto error_return;
}
- /* stash the transaction */
- slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+ /* stash the transaction for plugins */
+ slapi_pblock_set(pb, SLAPI_TXN, txn.back_txn_txn);
/* call the transaction pre add plugins just after creating the transaction */
if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN))) {
@@ -904,6 +910,9 @@ ldbm_back_add( Slapi_PBlock *pb )
}
retval = dblayer_txn_commit(li,&txn);
+ /* after commit - txn is no longer valid - replace SLAPI_TXN with parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
if (0 != retval)
{
ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count);
@@ -950,6 +959,9 @@ diskfull_return:
/* It is safer not to abort when the transaction is not started. */
if (retry_count > 0) {
dblayer_txn_abort(li,&txn); /* abort crashes in case disk full */
+ /* txn is no longer valid - reset the txn pointer to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
}
rc= SLAPI_FAIL_GENERAL;
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_bind.c b/ldap/servers/slapd/back-ldbm/ldbm_bind.c
index c9ba5db..49b2cca 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_bind.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_bind.c
@@ -210,6 +210,7 @@ ldbm_back_bind( Slapi_PBlock *pb )
Slapi_Attr *attr;
Slapi_Value **bvals;
entry_address *addr;
+ back_txn txn = {NULL};
/* get parameters */
slapi_pblock_get( pb, SLAPI_BACKEND, &be );
@@ -217,6 +218,7 @@ ldbm_back_bind( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_TARGET_ADDRESS, &addr );
slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method );
slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &cred );
+ slapi_pblock_get( pb, SLAPI_TXN, &txn.back_txn_txn );
inst = (ldbm_instance *) be->be_instance_info;
@@ -229,7 +231,7 @@ ldbm_back_bind( Slapi_PBlock *pb )
* find the target entry. find_entry() takes care of referrals
* and sending errors if the entry does not exist.
*/
- if (( e = find_entry( pb, be, addr, NULL /* no txn */ )) == NULL ) {
+ if (( e = find_entry( pb, be, addr, &txn )) == NULL ) {
return( SLAPI_BIND_FAIL );
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_compare.c b/ldap/servers/slapd/back-ldbm/ldbm_compare.c
index 5deb688..b510a08 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_compare.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_compare.c
@@ -59,6 +59,7 @@ ldbm_back_compare( Slapi_PBlock *pb )
int result;
int ret = 0;
Slapi_DN *namespace_dn;
+ back_txn txn = {NULL};
slapi_pblock_get( pb, SLAPI_BACKEND, &be );
@@ -66,12 +67,13 @@ ldbm_back_compare( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_TARGET_ADDRESS, &addr);
slapi_pblock_get( pb, SLAPI_COMPARE_TYPE, &type );
slapi_pblock_get( pb, SLAPI_COMPARE_VALUE, &bval );
+ slapi_pblock_get( pb, SLAPI_TXN, &txn.back_txn_txn );
inst = (ldbm_instance *) be->be_instance_info;
/* get the namespace dn */
namespace_dn = (Slapi_DN*)slapi_be_getsuffix(be, 0);
- if ( (e = find_entry( pb, be, addr, NULL )) == NULL ) {
+ if ( (e = find_entry( pb, be, addr, &txn )) == NULL ) {
return( -1 ); /* error result sent by find_entry() */
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 088d1b5..10f8f68 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -99,7 +99,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
slapi_pblock_get( pb, SLAPI_DELETE_TARGET, &dn );
slapi_pblock_get( pb, SLAPI_TARGET_ADDRESS, &addr);
- slapi_pblock_get( pb, SLAPI_PARENT_TXN, (void**)&parent_txn );
+ slapi_pblock_get( pb, SLAPI_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation );
@@ -108,6 +108,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
/* dblayer_txn_init needs to be called before "goto error_return" */
dblayer_txn_init(li,&txn);
+ /* the calls to perform searches require the parent txn if any
+ so set txn to the parent_txn until we begin the child transaction */
+ txn.back_txn_txn = parent_txn;
if (pb->pb_conn)
{
@@ -165,7 +168,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
}
/* find and lock the entry we are about to modify */
- if ( (e = find_entry2modify( pb, be, addr, NULL )) == NULL )
+ if ( (e = find_entry2modify( pb, be, addr, &txn )) == NULL )
{
ldap_result_code= LDAP_NO_SUCH_OBJECT;
/* retval is -1 */
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index 9dbf2b9..ff2fc97 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -223,7 +223,7 @@ ldbm_back_modify( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
slapi_pblock_get( pb, SLAPI_TARGET_ADDRESS, &addr );
slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
- slapi_pblock_get( pb, SLAPI_PARENT_TXN, (void**)&parent_txn );
+ slapi_pblock_get( pb, SLAPI_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
if (NULL == operation)
@@ -237,6 +237,9 @@ ldbm_back_modify( Slapi_PBlock *pb )
inst = (ldbm_instance *) be->be_instance_info;
dblayer_txn_init(li,&txn);
+ /* the calls to search for entries require the parent txn if any
+ so set txn to the parent_txn until we begin the child transaction */
+ txn.back_txn_txn = parent_txn;
if (NULL == addr)
{
goto error_return;
@@ -263,7 +266,7 @@ ldbm_back_modify( Slapi_PBlock *pb )
}
/* find and lock the entry we are about to modify */
- if ( (e = find_entry2modify( pb, be, addr, NULL )) == NULL ) {
+ if ( (e = find_entry2modify( pb, be, addr, &txn )) == NULL ) {
ldap_result_code= -1;
goto error_return; /* error result sent by find_entry2modify() */
}
@@ -399,10 +402,14 @@ ldbm_back_modify( Slapi_PBlock *pb )
}
}
+ txn.back_txn_txn = NULL; /* ready to create the child transaction */
for (retry_count = 0; retry_count < RETRY_TIMES; retry_count++) {
if (retry_count > 0) {
dblayer_txn_abort(li,&txn);
+ /* txn is no longer valid - reset slapi_txn to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
LDAPDebug( LDAP_DEBUG_TRACE, "Modify Retrying Transaction\n", 0, 0, 0 );
#ifndef LDBM_NO_BACKOFF_DELAY
{
@@ -422,8 +429,8 @@ ldbm_back_modify( Slapi_PBlock *pb )
goto error_return;
}
- /* stash the transaction */
- slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+ /* stash the transaction for plugins */
+ slapi_pblock_set(pb, SLAPI_TXN, txn.back_txn_txn);
/* call the transaction pre modify plugins just after creating the transaction */
if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN))) {
@@ -557,6 +564,9 @@ ldbm_back_modify( Slapi_PBlock *pb )
}
retval = dblayer_txn_commit(li,&txn);
+ /* after commit - txn is no longer valid - replace SLAPI_TXN with parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
if (0 != retval) {
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
ldap_result_code= LDAP_OPERATIONS_ERROR;
@@ -599,6 +609,9 @@ error_return:
if (retry_count > 0) {
/* It is safer not to abort when the transaction is not started. */
dblayer_txn_abort(li,&txn); /* abort crashes in case disk full */
+ /* txn is no longer valid - reset the txn pointer to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
}
rc= SLAPI_FAIL_GENERAL;
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index be5787a..4aa771f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -120,7 +120,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_MODRDN_TARGET, &dn );
slapi_pblock_get( pb, SLAPI_BACKEND, &be);
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
- slapi_pblock_get( pb, SLAPI_PARENT_TXN, (void**)&parent_txn );
+ slapi_pblock_get( pb, SLAPI_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation );
@@ -129,6 +129,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
/* dblayer_txn_init needs to be called before "goto error_return" */
dblayer_txn_init(li,&txn);
+ /* the calls to search for entries require the parent txn if any
+ so set txn to the parent_txn until we begin the child transaction */
+ txn.back_txn_txn = parent_txn;
if (pb->pb_conn)
{
@@ -313,7 +316,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
/* find and lock the entry we are about to modify */
/* JCMREPL - Argh, what happens about the stinking referrals? */
slapi_pblock_get (pb, SLAPI_TARGET_ADDRESS, &old_addr);
- e = find_entry2modify( pb, be, old_addr, NULL );
+ e = find_entry2modify( pb, be, old_addr, &txn );
if ( e == NULL )
{
ldap_result_code= -1;
@@ -336,14 +339,14 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
/* Fetch and lock the parent of the entry that is moving */
oldparent_addr.dn = (char*)slapi_sdn_get_dn (&dn_parentdn);
oldparent_addr.uniqueid = NULL;
- parententry = find_entry2modify_only( pb, be, &oldparent_addr, NULL );
+ parententry = find_entry2modify_only( pb, be, &oldparent_addr, &txn );
modify_init(&parent_modify_context,parententry);
/* Fetch and lock the new parent of the entry that is moving */
if(slapi_sdn_get_ndn(&dn_newsuperiordn)!=NULL)
{
slapi_pblock_get (pb, SLAPI_MODRDN_NEWSUPERIOR_ADDRESS, &newsuperior_addr);
- newparententry = find_entry2modify_only( pb, be, newsuperior_addr, NULL);
+ newparententry = find_entry2modify_only( pb, be, newsuperior_addr, &txn );
modify_init(&newparent_modify_context,newparententry);
}
@@ -680,11 +683,15 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
* So, we believe that no code up till here actually added anything
* to persistent store. From now on, we're transacted
*/
+ txn.back_txn_txn = NULL; /* ready to create the child transaction */
for (retry_count = 0; retry_count < RETRY_TIMES; retry_count++)
{
if (retry_count > 0)
{
dblayer_txn_abort(li,&txn);
+ /* txn is no longer valid - reset slapi_txn to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
/* We're re-trying */
LDAPDebug( LDAP_DEBUG_TRACE, "Modrdn Retrying Transaction\n", 0, 0, 0 );
}
@@ -909,15 +916,18 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
modify_switch_entries( &newparent_modify_context,be);
}
- /* call the transaction post modrdn plugins just before the commit */
- if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN))) {
- LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin "
- "returned error code %d\n", retval );
- slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
- goto error_return;
- }
+ /* call the transaction post modrdn plugins just before the commit */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
retval = dblayer_txn_commit(li,&txn);
+ /* after commit - txn is no longer valid - replace SLAPI_TXN with parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
if (0 != retval)
{
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
@@ -1047,6 +1057,9 @@ error_return:
/* It is safer not to abort when the transaction is not started. */
if (retry_count > 0) {
dblayer_txn_abort(li,&txn); /* abort crashes in case disk full */
+ /* txn is no longer valid - reset the txn pointer to the parent */
+ txn.back_txn_txn = NULL;
+ slapi_pblock_set(pb, SLAPI_TXN, parent_txn);
}
retval= SLAPI_FAIL_GENERAL;
}
@@ -1737,7 +1750,7 @@ moddn_get_children(back_txn *ptxn,
if ( id!=NOID )
{
int err= 0;
- e = id2entry( be, id, NULL, &err );
+ e = id2entry( be, id, ptxn, &err );
if (e!=NULL)
{
/* The subtree search will have included the parent
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index b204428..43b4fab 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -203,6 +203,7 @@ ldbm_back_search( Slapi_PBlock *pb )
int lookup_returned_allids = 0;
int backend_count = 1;
static int print_once = 1;
+ back_txn txn = {NULL};
slapi_pblock_get( pb, SLAPI_BACKEND, &be );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation);
@@ -212,7 +213,8 @@ ldbm_back_search( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, &scope );
slapi_pblock_get( pb, SLAPI_REQCONTROLS, &controls );
slapi_pblock_get( pb, SLAPI_BACKEND_COUNT, &backend_count );
-
+ slapi_pblock_get( pb, SLAPI_TXN, &txn.back_txn_txn );
+
inst = (ldbm_instance *) be->be_instance_info;
slapi_sdn_init_dn_ndn_byref(&basesdn,base); /* normalized by front end*/
@@ -401,7 +403,7 @@ ldbm_back_search( Slapi_PBlock *pb )
}
else
{
- if ( ( e = find_entry( pb, be, addr, NULL )) == NULL )
+ if ( ( e = find_entry( pb, be, addr, &txn )) == NULL )
{
/* error or referral sent by find_entry */
return ldbm_back_search_cleanup(pb, li, sort_control,
@@ -431,9 +433,9 @@ ldbm_back_search( Slapi_PBlock *pb )
if ((NULL != controls) && (sort) && (vlv)) {
/* This candidate list is for vlv, no need for sort only. */
switch (vlv_search_build_candidate_list(pb, &basesdn, &vlv_rc,
- sort_control,
- (vlv ? &vlv_request_control : NULL),
- &candidates, &vlv_response_control)) {
+ sort_control,
+ (vlv ? &vlv_request_control : NULL),
+ &candidates, &vlv_response_control)) {
case VLV_ACCESS_DENIED:
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_rc, "VLV Control",
@@ -638,9 +640,11 @@ ldbm_back_search( Slapi_PBlock *pb )
if (NULL != candidates && candidates->b_nids>0)
{
IDList *idl= NULL;
+ back_txn txn = {NULL};
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
vlv_response_control.result =
- vlv_trim_candidates(be, candidates, sort_control,
- &vlv_request_control, &idl, &vlv_response_control);
+ vlv_trim_candidates_txn(be, candidates, sort_control,
+ &vlv_request_control, &idl, &vlv_response_control, &txn);
if(vlv_response_control.result==0)
{
idl_free(candidates);
@@ -983,18 +987,20 @@ subtree_candidates(
*/
if(candidates!=NULL && (idl_length(candidates)>FILTER_TEST_THRESHOLD)) {
IDList *tmp = candidates, *descendants = NULL;
+ back_txn txn = {NULL};
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
if (entryrdn_get_noancestorid()) {
/* subtree-rename: on && no ancestorid */
*err = entryrdn_get_subordinates(be,
slapi_entry_get_sdn_const(e->ep_entry),
- e->ep_id, &descendants, NULL);
+ e->ep_id, &descendants, &txn);
idl_insert(&descendants, e->ep_id);
candidates = idl_intersection(be, candidates, descendants);
idl_free(tmp);
idl_free(descendants);
} else if (!has_tombstone_filter) {
- *err = ldbm_ancestorid_read(be, NULL, e->ep_id, &descendants);
+ *err = ldbm_ancestorid_read(be, &txn, e->ep_id, &descendants);
idl_insert(&descendants, e->ep_id);
candidates = idl_intersection(be, candidates, descendants);
idl_free(tmp);
@@ -1164,6 +1170,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
char *target_uniqueid;
int rc = 0;
int estimate = 0; /* estimated search result count */
+ back_txn txn = {NULL};
slapi_pblock_get( pb, SLAPI_BACKEND, &be );
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
@@ -1179,6 +1186,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
slapi_pblock_get( pb, SLAPI_SEARCH_REFERRALS, &urls );
slapi_pblock_get( pb, SLAPI_TARGET_UNIQUEID, &target_uniqueid );
slapi_pblock_get( pb, SLAPI_SEARCH_RESULT_SET, &sr );
+ slapi_pblock_get( pb, SLAPI_TXN, &txn.back_txn_txn );
if (NULL == sr) {
goto bail;
@@ -1297,7 +1305,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
++sr->sr_lookthroughcount; /* checked above */
/* get the entry */
- e = id2entry( be, id, NULL, &err );
+ e = id2entry( be, id, &txn, &err );
if ( e == NULL )
{
if ( err != 0 && err != DB_NOTFOUND )
diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c
index 9255ddb..6e350c9 100644
--- a/ldap/servers/slapd/back-ldbm/misc.c
+++ b/ldap/servers/slapd/back-ldbm/misc.c
@@ -405,9 +405,11 @@ ldbm_txn_ruv_modify_context( Slapi_PBlock *pb, modify_context *mc )
entry_address bentry_addr;
IFP fn = NULL;
int rc = 0;
+ back_txn txn = {NULL};
slapi_pblock_get(pb, SLAPI_TXN_RUV_MODS_FN, (void *)&fn);
-
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
+
if (NULL == fn) {
return (0);
}
@@ -428,7 +430,7 @@ ldbm_txn_ruv_modify_context( Slapi_PBlock *pb, modify_context *mc )
/* Note: if we find the bentry, it will stay locked until someone calls
* modify_term on the mc we'll be associating the bentry with */
- bentry = find_entry2modify_only( pb, be, &bentry_addr, NULL );
+ bentry = find_entry2modify_only( pb, be, &bentry_addr, &txn );
if (NULL == bentry) {
/* Uh oh, we couldn't find and lock the RUV entry! */
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index b2dce18..a087a05 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -527,6 +527,7 @@ int vlv_search_build_candidate_list(Slapi_PBlock *pb, const Slapi_DN *base, int
int vlv_update_index(struct vlvIndex* p, back_txn *txn, struct ldbminfo *li, Slapi_PBlock *pb, struct backentry* oldEntry, struct backentry* newEntry);
int vlv_update_all_indexes(back_txn *txn, backend *be, Slapi_PBlock *pb, struct backentry* oldEntry, struct backentry* newEntry);
int vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, const Slapi_DN *base, int scope, Slapi_Filter *filter, IDList** filteredCandidates,int lookthrough_limit, time_t time_up);
+int vlv_trim_candidates_txn(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** filteredCandidates,struct vlv_response *pResponse, back_txn *txn);
int vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** filteredCandidates,struct vlv_response *pResponse);
int vlv_parse_request_control(backend *be, struct berval *vlv_spec_ber, struct vlv_request* vlvp);
int vlv_make_response_control(Slapi_PBlock *pb, const struct vlv_response* vlvp);
@@ -535,6 +536,8 @@ void vlv_print_access_log(Slapi_PBlock *pb,struct vlv_request* vlvi, struct vlv_
void vlv_grok_new_import_entry(const struct backentry *e, backend *be);
IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
Slapi_Filter *f);
+IDList *vlv_find_index_by_filter_txn(struct backend *be, const char *base,
+ Slapi_Filter *f, back_txn *txn);
int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *inst);
void vlv_acquire_lock(backend *be);
void vlv_release_lock(backend *be);
diff --git a/ldap/servers/slapd/back-ldbm/sort.c b/ldap/servers/slapd/back-ldbm/sort.c
index ae3f3d6..501765c 100644
--- a/ldap/servers/slapd/back-ldbm/sort.c
+++ b/ldap/servers/slapd/back-ldbm/sort.c
@@ -625,9 +625,11 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier *
backend *be = bc->be;
ldbm_instance *inst = (ldbm_instance *) be->be_instance_info;
int err;
+ back_txn txn = {NULL};
+ slapi_pblock_get(bc->pb, SLAPI_TXN, &txn.back_txn_txn);
*error = 1;
- a = id2entry(be,*id_a,NULL,&err);
+ a = id2entry(be,*id_a,&txn,&err);
if (NULL == a) {
if (0 != err ) {
LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0);
@@ -636,7 +638,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier *
/* Best to log error and set some flag */
return 0;
}
- b = id2entry(be,*id_b,NULL,&err);
+ b = id2entry(be,*id_b,&txn,&err);
if (NULL == b) {
if (0 != err ) {
LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0);
diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c
index 4cda3d0..a953030 100644
--- a/ldap/servers/slapd/back-ldbm/vlv.c
+++ b/ldap/servers/slapd/back-ldbm/vlv.c
@@ -58,8 +58,8 @@
#include "vlv_key.h"
static PRUint32 vlv_trim_candidates_byindex(PRUint32 length, const struct vlv_request *vlv_request_control);
-static PRUint32 vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control);
-static int vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_request *vlv_request_control, IDList** candidates, struct vlv_response *vlv_response_control, int is_srchlist_locked);
+static PRUint32 vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, back_txn *txn);
+static int vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_request *vlv_request_control, IDList** candidates, struct vlv_response *vlv_response_control, int is_srchlist_locked, back_txn *txn);
/* New mutex for vlv locking
Slapi_RWLock * vlvSearchList_lock=NULL;
@@ -1150,7 +1150,9 @@ vlv_search_build_candidate_list(Slapi_PBlock *pb, const Slapi_DN *base, int *vlv
backend *be;
int scope, rc=LDAP_SUCCESS;
char *fstr;
+ back_txn txn = {NULL};
+ slapi_pblock_get( pb, SLAPI_TXN, &txn.back_txn_txn );
slapi_pblock_get( pb, SLAPI_BACKEND, &be );
slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, &scope );
slapi_pblock_get( pb, SLAPI_SEARCH_STRFILTER, &fstr );
@@ -1164,7 +1166,8 @@ vlv_search_build_candidate_list(Slapi_PBlock *pb, const Slapi_DN *base, int *vlv
} else if((*vlv_rc=vlvIndex_accessallowed(pi, pb)) != LDAP_SUCCESS) {
slapi_rwlock_unlock(be->vlvSearchList_lock);
rc = VLV_ACCESS_DENIED;
- } else if ((*vlv_rc=vlv_build_candidate_list(be,pi,vlv_request_control,candidates,vlv_response_control, 1)) != LDAP_SUCCESS) {
+ } else if ((*vlv_rc=vlv_build_candidate_list(be,pi,vlv_request_control,candidates,
+ vlv_response_control, 1, &txn)) != LDAP_SUCCESS) {
rc = VLV_BLD_LIST_FAILED;
vlv_response_control->result=*vlv_rc;
}
@@ -1187,7 +1190,7 @@ vlv_search_build_candidate_list(Slapi_PBlock *pb, const Slapi_DN *base, int *vlv
static int
-vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_request *vlv_request_control, IDList** candidates, struct vlv_response *vlv_response_control, int is_srchlist_locked)
+vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_request *vlv_request_control, IDList** candidates, struct vlv_response *vlv_response_control, int is_srchlist_locked, back_txn *txn)
{
int return_value = LDAP_SUCCESS;
DB *db = NULL;
@@ -1196,6 +1199,7 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ
PRUint32 si = 0; /* The Selected Index */
PRUint32 length;
int do_trim= 1;
+ DB_TXN *db_txn = NULL;
LDAPDebug(LDAP_DEBUG_TRACE,
"=> vlv_build_candidate_list: %s %s Using VLV Index %s\n",
@@ -1226,7 +1230,10 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ
if (is_srchlist_locked) {
slapi_rwlock_unlock(be->vlvSearchList_lock);
}
- err = db->cursor(db, 0 /* txn */, &dbc, 0);
+ if (txn) {
+ db_txn = txn->back_txn_txn;
+ }
+ err = db->cursor(db, db_txn, &dbc, 0);
if (err != 0) {
/* shouldn't happen */
LDAPDebug(LDAP_DEBUG_ANY, "VLV: couldn't get cursor (err %d)\n",
@@ -1241,8 +1248,7 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ
si = vlv_trim_candidates_byindex(length, vlv_request_control);
break;
case 1: /* byValue */
- si = vlv_build_candidate_list_byvalue(p, dbc, length,
- vlv_request_control);
+ si = vlv_build_candidate_list_byvalue(p, dbc, length, vlv_request_control);
if (si==length) {
do_trim = 0;
/* minimum idl_alloc size should be 1; 0 is considered ALLID */
@@ -1314,8 +1320,10 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c
int done= 0;
int counter= 0;
ID id = NOID;
+ back_txn txn = {NULL};
idl_iterator current = idl_iterator_init(candidates);
resultIdl= idl_alloc(candidates->b_nids);
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
do
{
id = idl_iterator_dereference_increment(¤t, candidates);
@@ -1323,7 +1331,7 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c
{
int err= 0;
struct backentry *e= NULL;
- e = id2entry( be, id, NULL, &err );
+ e = id2entry( be, id, &txn, &err );
if ( e == NULL )
{
/*
@@ -1393,7 +1401,7 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c
* other (80)
*/
int
-vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** trimmedCandidates,struct vlv_response *vlv_response_control)
+vlv_trim_candidates_txn(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** trimmedCandidates,struct vlv_response *vlv_response_control, back_txn *txn)
{
IDList* resultIdl= NULL;
int return_value= LDAP_SUCCESS;
@@ -1412,7 +1420,7 @@ vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort
si= vlv_trim_candidates_byindex(candidates->b_nids, vlv_request_control);
break;
case 1: /* byValue */
- si= vlv_trim_candidates_byvalue(be, candidates, sort_control, vlv_request_control);
+ si= vlv_trim_candidates_byvalue(be, candidates, sort_control, vlv_request_control, txn);
/* Don't bother sending results if the attribute value wasn't found */
if(si==candidates->b_nids)
{
@@ -1457,6 +1465,12 @@ vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort
return return_value;
}
+int
+vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** trimmedCandidates,struct vlv_response *vlv_response_control)
+{
+ return vlv_trim_candidates_txn(be, candidates, sort_control, vlv_request_control, trimmedCandidates, vlv_response_control, NULL);
+}
+
/*
* Work out the Selected Index given the length of the candidate list
* and the request control from the client.
@@ -1523,7 +1537,7 @@ vlv_trim_candidates_byindex(PRUint32 length, const struct vlv_request *vlv_reque
* Iterate over the Candidate ID List looking for an entry >= the provided attribute value.
*/
static PRUint32
-vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control)
+vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, back_txn *txn)
{
PRUint32 si= 0; /* The Selected Index */
PRUint32 low= 0;
@@ -1592,7 +1606,7 @@ retry:
current = (1 + low + high)/2;
}
id= candidates->b_ids[current];
- e = id2entry( be, id, NULL, &err );
+ e = id2entry( be, id, txn, &err );
if ( e == NULL )
{
int rval;
@@ -1942,8 +1956,8 @@ vlv_parse_request_control( backend *be, struct berval *vlv_spec_ber,struct vlv_r
* has the same search base and search filter.
* added read lock */
-IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
- Slapi_Filter *f)
+IDList *vlv_find_index_by_filter_txn(struct backend *be, const char *base,
+ Slapi_Filter *f, back_txn *txn)
{
struct vlvSearch *t = NULL;
struct vlvIndex *vi;
@@ -1954,6 +1968,11 @@ IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
DBC *dbc = NULL;
IDList *idl;
Slapi_Filter *vlv_f;
+ DB_TXN *db_txn = NULL;
+
+ if (txn) {
+ db_txn = txn->back_txn_txn;
+ }
slapi_sdn_init_dn_byref(&base_sdn, base);
slapi_rwlock_rdlock(be->vlvSearchList_lock);
@@ -1984,7 +2003,7 @@ IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
if (dblayer_get_index_file(be, vi->vlv_attrinfo, &db, 0) == 0) {
length = vlvIndex_get_indexlength(vi, db, 0 /* txn */);
slapi_rwlock_unlock(be->vlvSearchList_lock);
- err = db->cursor(db, 0 /* txn */, &dbc, 0);
+ err = db->cursor(db, db_txn, &dbc, 0);
if (err == 0) {
if (length == 0) /* 609377: index size could be 0 */
{
@@ -2015,7 +2034,11 @@ IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
return NULL;
}
-
+IDList *vlv_find_index_by_filter(struct backend *be, const char *base,
+ Slapi_Filter *f)
+{
+ return vlv_find_index_by_filter_txn(be, base, f, NULL);
+}
/* replace c with c2 in string -- probably exists somewhere but I can't find it slapi maybe? */
diff --git a/ldap/servers/slapd/back-ldbm/vlv_srch.c b/ldap/servers/slapd/back-ldbm/vlv_srch.c
index 9195b28..c160507 100644
--- a/ldap/servers/slapd/back-ldbm/vlv_srch.c
+++ b/ldap/servers/slapd/back-ldbm/vlv_srch.c
@@ -181,15 +181,17 @@ vlvSearch_init(struct vlvSearch* p, Slapi_PBlock *pb, const Slapi_Entry *e, ldbm
if ( !slapi_sdn_isempty(p->vlv_base)) {
Slapi_Backend *oldbe = NULL;
entry_address addr;
+ back_txn txn = {NULL};
/* switch context to the target backend */
slapi_pblock_get(pb, SLAPI_BACKEND, &oldbe);
slapi_pblock_set(pb, SLAPI_BACKEND, inst->inst_be);
slapi_pblock_set(pb, SLAPI_PLUGIN, inst->inst_be->be_database);
+ slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn);
addr.dn = (char*)slapi_sdn_get_ndn (p->vlv_base);
addr.uniqueid = NULL;
- e = find_entry( pb, inst->inst_be, &addr, NULL );
+ e = find_entry( pb, inst->inst_be, &addr, &txn );
/* Check to see if the entry is absent. If it is, mark this search
* as not initialized */
if (NULL == e) {
12 years, 2 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/cl5_api.c | 95 +++++++++++------
ldap/servers/plugins/replication/cl5_api.h | 19 +++
ldap/servers/plugins/replication/repl5.h | 4
ldap/servers/plugins/replication/repl5_init.c | 21 +++
ldap/servers/plugins/replication/repl5_plugins.c | 126 ++++++++++++++---------
ldap/servers/slapd/back-ldbm/ldbm_add.c | 20 +++
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 20 +++
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 19 +++
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 19 +++
ldap/servers/slapd/pblock.c | 104 ++++++++++++++++++
ldap/servers/slapd/plugin.c | 21 +++
ldap/servers/slapd/slap.h | 29 +++++
ldap/servers/slapd/slapi-plugin.h | 14 ++
13 files changed, 431 insertions(+), 80 deletions(-)
New commits:
commit 056cc3551f59b9724b10e8ff21ec43e49d947280
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Sep 12 09:48:17 2011 -0600
Add support for pre/post db transaction plugins
There are two new plugin types:
betxnpreoperation - these plugins are called just after the database
calls txn_begin - they are passed in SLAPI_TXN the DB_TXN* just created
- they can use this as a parent transaction in a nested transaction
if the plugin wishes to cause the parent to abort, the plugin should return
a non-zero return code, and set the ldap error code to a meaningful error
value
betxnpostoperation - called just before the database calls txn_commit
The changelog code uses the betxnpostoperation to create a nested
transaction for the changelog write
Reviewed by: nhosoi (Thanks!)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 4c88ee5..c360444 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -93,7 +93,9 @@
#define HASH_BACKETS_COUNT 16 /* number of buckets in a hash table */
#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100
-#define DEFAULT_DB_OP_FLAGS DB_AUTO_COMMIT
+#define USE_DB_TXN 1 /* use transactions */
+#define DEFAULT_DB_ENV_OP_FLAGS DB_AUTO_COMMIT
+#define DEFAULT_DB_OP_FLAGS 0
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
{ \
if (((oflags) & DB_INIT_TXN) && ((oflags) & DB_INIT_LOG)) \
@@ -303,6 +305,8 @@ static PRBool _cl5ReplicaInList (Object *replica, Object **replicas);
static int _cl5Entry2DBData (const CL5Entry *entry, char **data, PRUint32 *len);
static int _cl5WriteOperation(const char *replName, const char *replGen,
const slapi_operation_parameters *op, PRBool local);
+static int _cl5WriteOperationTxn(const char *replName, const char *replGen,
+ const slapi_operation_parameters *op, PRBool local, void *txn);
static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_TXN *txnid);
static int _cl5GetNextEntry (CL5Entry *entry, void *iterator);
static int _cl5CurrentDeleteEntry (void *iterator);
@@ -1376,7 +1380,7 @@ void cl5DestroyIterator (void *iterator)
slapi_ch_free ((void**)&it);
}
-/* Name: cl5WriteOperation
+/* Name: cl5WriteOperationTxn
Description: writes operation to changelog
Parameters: replName - name of the replica to which operation applies
replGen - replica generation for the operation
@@ -1385,14 +1389,15 @@ void cl5DestroyIterator (void *iterator)
is in progress (if the data is reloaded). !!!
op - operation to write
local - this is a non-replicated operation
+ txn - the transaction containing this operation
Return: CL5_SUCCESS if function is successfull;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_MEMORY_ERROR if memory allocation failed;
CL5_DB_ERROR if any other db error occured;
*/
-int cl5WriteOperation(const char *replName, const char *replGen,
- const slapi_operation_parameters *op, PRBool local)
+int cl5WriteOperationTxn(const char *replName, const char *replGen,
+ const slapi_operation_parameters *op, PRBool local, void *txn)
{
int rc;
@@ -1421,7 +1426,7 @@ int cl5WriteOperation(const char *replName, const char *replGen,
if (rc != CL5_SUCCESS)
return rc;
- rc = _cl5WriteOperation(replName, replGen, op, local);
+ rc = _cl5WriteOperationTxn(replName, replGen, op, local, txn);
/* update the upper bound ruv vector */
if (rc == CL5_SUCCESS)
@@ -1440,6 +1445,27 @@ int cl5WriteOperation(const char *replName, const char *replGen,
return rc;
}
+/* Name: cl5WriteOperation
+ Description: writes operation to changelog
+ Parameters: replName - name of the replica to which operation applies
+ replGen - replica generation for the operation
+ !!!Note that we pass name and generation rather than
+ replica object since generation can change while operation
+ is in progress (if the data is reloaded). !!!
+ op - operation to write
+ local - this is a non-replicated operation
+ Return: CL5_SUCCESS if function is successfull;
+ CL5_BAD_DATA if invalid op is passed;
+ CL5_BAD_STATE if db has not been initialized;
+ CL5_MEMORY_ERROR if memory allocation failed;
+ CL5_DB_ERROR if any other db error occured;
+ */
+int cl5WriteOperation(const char *replName, const char *replGen,
+ const slapi_operation_parameters *op, PRBool local)
+{
+ return cl5WriteOperationTxn(replName, replGen, op, local, NULL);
+}
+
/* Name: cl5CreateReplayIterator
Description: creates an iterator that allows to retireve changes that should
to be sent to the consumer identified by ruv. The iteration is peformed by
@@ -2050,7 +2076,7 @@ static int _cl5DBOpen ()
PR_snprintf(fullpathname, MAXPATHLEN, "%s/%s", s_cl5Desc.dbDir, entry->name);
rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv,
0, fullpathname, 0,
- DEFAULT_DB_OP_FLAGS);
+ DEFAULT_DB_ENV_OP_FLAGS);
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
@@ -3248,7 +3274,7 @@ static int _cl5Delete (const char *clDir, int rmDir)
} else {
/* DB files */
rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, 0, filename, 0,
- DEFAULT_DB_OP_FLAGS);
+ DEFAULT_DB_ENV_OP_FLAGS);
if (rc) {
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
"_cl5Delete: failed to remove \"%s\"; "
@@ -4450,8 +4476,8 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl
return rval;
}
-static int _cl5WriteOperation(const char *replName, const char *replGen,
- const slapi_operation_parameters *op, PRBool local)
+static int _cl5WriteOperationTxn(const char *replName, const char *replGen,
+ const slapi_operation_parameters *op, PRBool local, void *txn)
{
int rc;
int cnt;
@@ -4463,6 +4489,7 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
CL5DBFile *file = NULL;
Object *file_obj = NULL;
DB_TXN *txnid = NULL;
+ DB_TXN *parent_txnid = (DB_TXN *)txn;
rc = _cl5GetDBFileByReplicaName (replName, replGen, &file_obj);
if (rc == CL5_NOTFOUND)
@@ -4472,14 +4499,14 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
if (rc != CL5_SUCCESS)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to find or open DB object for replica %s\n", replName);
+ "_cl5WriteOperationTxn: failed to find or open DB object for replica %s\n", replName);
return rc;
}
}
else if (rc != CL5_SUCCESS)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to get db file for target dn (%s)",
+ "_cl5WriteOperationTxn: failed to get db file for target dn (%s)",
op->target_address.dn);
return CL5_OBJSET_ERROR;
}
@@ -4499,7 +4526,7 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
{
char s[CSN_STRSIZE];
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to convert entry with csn (%s) "
+ "_cl5WriteOperationTxn: failed to convert entry with csn (%s) "
"to db format\n", csn_as_string(op->csn,PR_FALSE,s));
goto done;
}
@@ -4514,7 +4541,7 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to write entry; db error - %d %s\n",
+ "_cl5WriteOperationTxn: failed to write entry; db error - %d %s\n",
rc, db_strerror(rc));
if (CL5_OS_ERR_IS_DISKFULL(rc))
{
@@ -4533,13 +4560,13 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
{
if (cnt != 0)
{
-#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100
+#if USE_DB_TXN
/* abort previous transaction */
- rc = txn_abort (txnid);
+ rc = TXN_ABORT (txnid);
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to abort transaction; db error - %d %s\n",
+ "_cl5WriteOperationTxn: failed to abort transaction; db error - %d %s\n",
rc, db_strerror(rc));
rc = CL5_DB_ERROR;
goto done;
@@ -4549,13 +4576,13 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
interval = PR_MillisecondsToInterval(slapi_rand() % 100);
DS_Sleep(interval);
}
-#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100
+#if USE_DB_TXN
/* begin transaction */
- rc = txn_begin(s_cl5Desc.dbEnv, NULL /*pid*/, &txnid, 0);
+ rc = TXN_BEGIN(s_cl5Desc.dbEnv, parent_txnid, &txnid, 0);
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to start transaction; db error - %d %s\n",
+ "_cl5WriteOperationTxn: failed to start transaction; db error - %d %s\n",
rc, db_strerror(rc));
rc = CL5_DB_ERROR;
goto done;
@@ -4574,7 +4601,7 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
if (CL5_OS_ERR_IS_DISKFULL(rc))
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: changelog (%s) DISK FULL; db error - %d %s\n",
+ "_cl5WriteOperationTxn: changelog (%s) DISK FULL; db error - %d %s\n",
s_cl5Desc.dbDir, rc, db_strerror(rc));
cl5_set_diskfull();
rc = CL5_DB_ERROR;
@@ -4584,11 +4611,11 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
{
if (rc == 0)
{
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5WriteOperation: retry (%d) the transaction (csn=%s) succeeded\n", cnt, (char*)key.data);
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5WriteOperationTxn: retry (%d) the transaction (csn=%s) succeeded\n", cnt, (char*)key.data);
}
else if ((cnt + 1) >= MAX_TRIALS)
{
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5WriteOperation: retry (%d) the transaction (csn=%s) failed (rc=%d (%s))\n", cnt, (char*)key.data, rc, db_strerror(rc));
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5WriteOperationTxn: retry (%d) the transaction (csn=%s) failed (rc=%d (%s))\n", cnt, (char*)key.data, rc, db_strerror(rc));
}
}
cnt ++;
@@ -4596,23 +4623,23 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
if (rc == 0) /* we successfully added entry */
{
-#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100
- rc = txn_commit (txnid, 0);
+#if USE_DB_TXN
+ rc = TXN_COMMIT (txnid, 0);
#endif
}
else
{
char s[CSN_STRSIZE];
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to write entry with csn (%s); "
+ "_cl5WriteOperationTxn: failed to write entry with csn (%s); "
"db error - %d %s\n", csn_as_string(op->csn,PR_FALSE,s),
rc, db_strerror(rc));
-#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100
- rc = txn_abort (txnid);
+#if USE_DB_TXN
+ rc = TXN_ABORT (txnid);
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5WriteOperation: failed to abort transaction; db error - %d %s\n",
+ "_cl5WriteOperationTxn: failed to abort transaction; db error - %d %s\n",
rc, db_strerror(rc));
}
#endif
@@ -4627,7 +4654,7 @@ static int _cl5WriteOperation(const char *replName, const char *replGen,
_cl5UpdateRUV (file_obj, op->csn, PR_TRUE, PR_TRUE);
slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl,
- "cl5WriteOperation: successfully written entry with csn (%s)\n", csnStr);
+ "cl5WriteOperationTxn: successfully written entry with csn (%s)\n", csnStr);
rc = CL5_SUCCESS;
done:
if (data->data)
@@ -4640,6 +4667,12 @@ done:
return rc;
}
+static int _cl5WriteOperation(const char *replName, const char *replGen,
+ const slapi_operation_parameters *op, PRBool local)
+{
+ return _cl5WriteOperationTxn(replName, replGen, op, local, NULL);
+}
+
static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_TXN *txnid)
{
int rc;
@@ -5861,9 +5894,9 @@ static void _cl5DBCloseFile (void **data)
* run into problems when we try to checkpoint transactions later. */
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: "
"removing the changelog %s (flag %d)\n",
- file->name, DEFAULT_DB_OP_FLAGS);
+ file->name, DEFAULT_DB_ENV_OP_FLAGS);
rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, 0, file->name, 0,
- DEFAULT_DB_OP_FLAGS);
+ DEFAULT_DB_ENV_OP_FLAGS);
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: "
diff --git a/ldap/servers/plugins/replication/cl5_api.h b/ldap/servers/plugins/replication/cl5_api.h
index 3a59111..6f2552f 100644
--- a/ldap/servers/plugins/replication/cl5_api.h
+++ b/ldap/servers/plugins/replication/cl5_api.h
@@ -321,6 +321,25 @@ int cl5GetNextOperation (slapi_operation_parameters *op, void *iterator);
*/
void cl5DestroyIterator (void *iterator);
+/* Name: cl5WriteOperationTxn
+ Description: writes operation to changelog as part of a containing transaction
+ Parameters: repl_name - name of the replica to which operation applies
+ repl_gen - replica generation for the operation
+ !!!Note that we pass name and generation rather than
+ replica object since generation can change while operation
+ is in progress (if the data is reloaded). !!!
+ op - operation to write
+ local - this is a non-replicated operation
+ txn - the containing transaction
+ Return: CL5_SUCCESS if function is successfull;
+ CL5_BAD_DATA if invalid op is passed;
+ CL5_BAD_STATE if db has not been initialized;
+ CL5_MEMORY_ERROR if memory allocation failed;
+ CL5_DB_ERROR if any other db error occured;
+ */
+int cl5WriteOperationTxn(const char *repl_name, const char *repl_gen,
+ const slapi_operation_parameters *op, PRBool local, void *txn);
+
/* Name: cl5WriteOperation
Description: writes operation to changelog
Parameters: repl_name - name of the replica to which operation applies
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 1a3672f..79abb7a 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -199,6 +199,10 @@ int multimaster_postop_add (Slapi_PBlock *pb);
int multimaster_postop_delete (Slapi_PBlock *pb);
int multimaster_postop_modify (Slapi_PBlock *pb);
int multimaster_postop_modrdn (Slapi_PBlock *pb);
+int multimaster_betxnpostop_modrdn (Slapi_PBlock *pb);
+int multimaster_betxnpostop_delete (Slapi_PBlock *pb);
+int multimaster_betxnpostop_add (Slapi_PBlock *pb);
+int multimaster_betxnpostop_modify (Slapi_PBlock *pb);
/* In repl5_init.c */
char* get_thread_private_agmtname ();
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 2b6ebdf..883c3e6 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -133,6 +133,7 @@ static Slapi_PluginDesc multimasterinternalpreopdesc = {"replication-multimaster
static Slapi_PluginDesc multimasterinternalpostopdesc = {"replication-multimaster-internalpostop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication internal post-operation plugin"};
static Slapi_PluginDesc multimasterbepreopdesc = {"replication-multimaster-bepreop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication bepre-operation plugin"};
static Slapi_PluginDesc multimasterbepostopdesc = {"replication-multimaster-bepostop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication bepost-operation plugin"};
+static Slapi_PluginDesc multimasterbetxnpostopdesc = {"replication-multimaster-betxnpostop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication be transaction post-operation plugin"};
static Slapi_PluginDesc multimasterextopdesc = { "replication-multimaster-extop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication extended-operation plugin" };
static int multimaster_stopped_flag; /* A flag which is set when all the plugin threads are to stop */
@@ -329,6 +330,25 @@ multimaster_bepostop_init( Slapi_PBlock *pb )
}
int
+multimaster_betxnpostop_init( Slapi_PBlock *pb )
+{
+ int rc= 0; /* OK */
+
+ if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&multimasterbetxnpostopdesc ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN, (void *) multimaster_betxnpostop_modrdn ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN, (void *) multimaster_betxnpostop_delete ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN, (void *) multimaster_betxnpostop_modrdn ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN, (void *) multimaster_betxnpostop_delete ) != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_betxnpostop_init failed\n" );
+ rc= -1;
+ }
+
+ return rc;
+}
+
+int
multimaster_start_extop_init( Slapi_PBlock *pb )
{
int rc= 0; /* OK */
@@ -591,6 +611,7 @@ int replication_multimaster_plugin_init(Slapi_PBlock *pb)
rc= slapi_register_plugin("postoperation", 1 /* Enabled */, "multimaster_postop_init", multimaster_postop_init, "Multimaster replication postoperation plugin", NULL, identity);
rc= slapi_register_plugin("bepreoperation", 1 /* Enabled */, "multimaster_bepreop_init", multimaster_bepreop_init, "Multimaster replication bepreoperation plugin", NULL, identity);
rc= slapi_register_plugin("bepostoperation", 1 /* Enabled */, "multimaster_bepostop_init", multimaster_bepostop_init, "Multimaster replication bepostoperation plugin", NULL, identity);
+ rc= slapi_register_plugin("betxnpostoperation", 1 /* Enabled */, "multimaster_betxnpostop_init", multimaster_betxnpostop_init, "Multimaster replication betxnpostoperation plugin", NULL, identity);
rc= slapi_register_plugin("internalpreoperation", 1 /* Enabled */, "multimaster_internalpreop_init", multimaster_internalpreop_init, "Multimaster replication internal preoperation plugin", NULL, identity);
rc= slapi_register_plugin("internalpostoperation", 1 /* Enabled */, "multimaster_internalpostop_init", multimaster_internalpostop_init, "Multimaster replication internal postoperation plugin", NULL, identity);
rc= slapi_register_plugin("extendedop", 1 /* Enabled */, "multimaster_start_extop_init", multimaster_start_extop_init, "Multimaster replication start extended operation plugin", NULL, identity);
diff --git a/ldap/servers/plugins/replication/repl5_plugins.c b/ldap/servers/plugins/replication/repl5_plugins.c
index 8b47011..a036b0a 100644
--- a/ldap/servers/plugins/replication/repl5_plugins.c
+++ b/ldap/servers/plugins/replication/repl5_plugins.c
@@ -851,6 +851,29 @@ multimaster_postop_modrdn (Slapi_PBlock *pb)
return process_postop(pb);
}
+int
+multimaster_betxnpostop_delete (Slapi_PBlock *pb)
+{
+ return write_changelog_and_ruv(pb);
+}
+
+int
+multimaster_betxnpostop_modrdn (Slapi_PBlock *pb)
+{
+ return write_changelog_and_ruv(pb);
+}
+
+int
+multimaster_betxnpostop_add (Slapi_PBlock *pb)
+{
+ return write_changelog_and_ruv(pb);
+}
+
+int
+multimaster_betxnpostop_modify (Slapi_PBlock *pb)
+{
+ return write_changelog_and_ruv(pb);
+}
/* Helper functions */
@@ -943,42 +966,63 @@ update_ruv_component(Replica *replica, CSN *opcsn, Slapi_PBlock *pb)
static int
write_changelog_and_ruv (Slapi_PBlock *pb)
{
+ Slapi_Operation *op = NULL;
int rc;
slapi_operation_parameters *op_params = NULL;
- Object *repl_obj;
+ Object *repl_obj;
int return_value = 0;
- Replica *r;
+ Replica *r;
+ Slapi_Backend *be;
+ int is_replicated_operation = 0;
- /* we only log changes for operations applied to a replica */
+ /* we just let fixup operations through */
+ slapi_pblock_get( pb, SLAPI_OPERATION, &op );
+ if ((operation_is_flag_set(op, OP_FLAG_REPL_FIXUP)) ||
+ (operation_is_flag_set(op, OP_FLAG_TOMBSTONE_ENTRY)))
+ {
+ return 0;
+ }
+
+ /* ignore operations intended for chaining backends - they will be
+ replicated back to us or should be ignored anyway
+ replicated operations should be processed normally, as they should
+ be going to a local backend */
+ is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
+ slapi_pblock_get(pb, SLAPI_BACKEND, &be);
+ if (!is_replicated_operation &&
+ slapi_be_is_flag_set(be,SLAPI_BE_FLAG_REMOTE_DATA))
+ {
+ return 0;
+ }
+
+ /* we only log changes for operations applied to a replica */
repl_obj = replica_get_replica_for_op (pb);
- if (repl_obj == NULL)
- return 0;
+ if (repl_obj == NULL)
+ return 0;
- r = (Replica*)object_get_data (repl_obj);
- PR_ASSERT (r);
+ r = (Replica*)object_get_data (repl_obj);
+ PR_ASSERT (r);
if (replica_is_flag_set (r, REPLICA_LOG_CHANGES) &&
(cl5GetState () == CL5_STATE_OPEN))
{
- supplier_operation_extension *opext = NULL;
- const char *repl_name;
- char *repl_gen;
- Slapi_Operation *op;
+ supplier_operation_extension *opext = NULL;
+ const char *repl_name;
+ char *repl_gen;
- slapi_pblock_get(pb, SLAPI_OPERATION, &op);
opext = (supplier_operation_extension*) repl_sup_get_ext (REPL_SUP_EXT_OP, op);
PR_ASSERT (opext);
- /* get replica generation and replica name to pass to the write function */
- repl_name = replica_get_name (r);
- repl_gen = opext->repl_gen;
- PR_ASSERT (repl_name && repl_gen);
+ /* get replica generation and replica name to pass to the write function */
+ repl_name = replica_get_name (r);
+ repl_gen = opext->repl_gen;
+ PR_ASSERT (repl_name && repl_gen);
/* for replicated operations, we log the original, non-urp data which is
saved in the operation extension */
if (operation_is_flag_set(op,OP_FLAG_REPLICATED))
{
- PR_ASSERT (opext->operation_parameters);
+ PR_ASSERT (opext->operation_parameters);
op_params = opext->operation_parameters;
}
else /* since client operations don't go through urp, we log the operation data in pblock */
@@ -1013,21 +1057,23 @@ write_changelog_and_ruv (Slapi_PBlock *pb)
op_params->target_address.uniqueid = slapi_ch_strdup (uniqueid);
}
- /* we might have stripped all the mods - in that case we do not
- log the operation */
- if (op_params->operation_type != SLAPI_OPERATION_MODIFY ||
- op_params->p.p_modify.modify_mods != NULL)
- {
+ /* we might have stripped all the mods - in that case we do not
+ log the operation */
+ if (op_params->operation_type != SLAPI_OPERATION_MODIFY ||
+ op_params->p.p_modify.modify_mods != NULL)
+ {
+ void *txn = NULL;
if (cl5_is_diskfull() && !cl5_diskspace_is_available())
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "write_changelog_and_ruv: Skipped due to DISKFULL\n");
+ "write_changelog_and_ruv: Skipped due to DISKFULL\n");
return 0;
}
- rc = cl5WriteOperation(repl_name, repl_gen, op_params,
- !operation_is_flag_set(op, OP_FLAG_REPLICATED));
- if (rc != CL5_SUCCESS)
- {
+ slapi_pblock_get(pb, SLAPI_TXN, &txn);
+ rc = cl5WriteOperationTxn(repl_name, repl_gen, op_params,
+ !operation_is_flag_set(op, OP_FLAG_REPLICATED), txn);
+ if (rc != CL5_SUCCESS)
+ {
char csn_str[CSN_STRSIZE];
/* ONREPL - log error */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
@@ -1036,10 +1082,10 @@ write_changelog_and_ruv (Slapi_PBlock *pb)
op_params->target_address.dn,
op_params->target_address.uniqueid,
op_params->operation_type,
- csn_as_string(op_params->csn, PR_FALSE, csn_str));
- return_value = 1;
- }
- }
+ csn_as_string(op_params->csn, PR_FALSE, csn_str));
+ return_value = 1;
+ }
+ }
if (!operation_is_flag_set(op,OP_FLAG_REPLICATED))
{
@@ -1056,7 +1102,6 @@ write_changelog_and_ruv (Slapi_PBlock *pb)
just read from the changelog in either the supplier or consumer ruv
*/
if (0 == return_value) {
- Slapi_Operation *op;
CSN *opcsn;
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
@@ -1107,24 +1152,9 @@ process_postop (Slapi_PBlock *pb)
get_repl_session_id (pb, sessionid, &opcsn);
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc);
- /*
- * Don't abandon writing changelog since we'd do everything
- * possible to keep the changelog in sync with the backend
- * db which was committed before this function was called.
- *
- * if (rc == LDAP_SUCCESS && !slapi_op_abandoned(pb))
- */
if (rc == LDAP_SUCCESS)
{
- rc = write_changelog_and_ruv(pb);
- if (rc == 0)
- {
- agmtlist_notify_all(pb);
- }
- else
- {
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s process postop: error writing changelog and ruv\n", sessionid);
- }
+ agmtlist_notify_all(pb);
}
else if (opcsn)
{
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c
index 20578ba..274e3d7 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_add.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c
@@ -671,6 +671,18 @@ ldbm_back_add( Slapi_PBlock *pb )
ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
+
+ /* stash the transaction */
+ slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+
+ /* call the transaction pre add plugins just after creating the transaction */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
retval = id2entry_add( be, addingentry, &txn );
if (DB_LOCK_DEADLOCK == retval)
{
@@ -883,6 +895,14 @@ ldbm_back_add( Slapi_PBlock *pb )
}
}
+ /* call the transaction post add plugins just before the commit */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_ADD_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
retval = dblayer_txn_commit(li,&txn);
if (0 != retval)
{
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index f2edf1e..088d1b5 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -467,6 +467,18 @@ ldbm_back_delete( Slapi_PBlock *pb )
ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
+
+ /* stash the transaction */
+ slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+
+ /* call the transaction pre delete plugins just after creating the transaction */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
if(create_tombstone_entry)
{
/*
@@ -868,6 +880,14 @@ ldbm_back_delete( Slapi_PBlock *pb )
goto error_return;
}
+ /* call the transaction post delete plugins just before the commit */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
retval = dblayer_txn_commit(li,&txn);
if (0 != retval)
{
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index f3b351f..9dbf2b9 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -422,6 +422,17 @@ ldbm_back_modify( Slapi_PBlock *pb )
goto error_return;
}
+ /* stash the transaction */
+ slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+
+ /* call the transaction pre modify plugins just after creating the transaction */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
/*
* Update the ID to Entry index.
* Note that id2entry_add replaces the entry, so the Entry ID stays the same.
@@ -537,6 +548,14 @@ ldbm_back_modify( Slapi_PBlock *pb )
*/
e = NULL;
+ /* call the transaction post modify plugins just before the commit */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
retval = dblayer_txn_commit(li,&txn);
if (0 != retval) {
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index 54b3125..be5787a 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -695,6 +695,17 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
goto error_return;
}
+ /* stash the transaction */
+ slapi_pblock_set(pb, SLAPI_TXN, (void *)txn.back_txn_txn);
+
+ /* call the transaction pre modrdn plugins just after creating the transaction */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
/*
* Update the indexes for the entry.
*/
@@ -898,6 +909,14 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
modify_switch_entries( &newparent_modify_context,be);
}
+ /* call the transaction post modrdn plugins just before the commit */
+ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN))) {
+ LDAPDebug1Arg( LDAP_DEBUG_ANY, "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin "
+ "returned error code %d\n", retval );
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ goto error_return;
+ }
+
retval = dblayer_txn_commit(li,&txn);
if (0 != retval)
{
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index 215b7df..d068132 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -1062,6 +1062,58 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
(*(IFP *)value) = pblock->pb_plugin->plg_internal_post_delete;
break;
+ /* backend pre txn operation plugin */
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpremodify;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpremodrdn;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpreadd;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpredelete;
+ break;
+
+ /* backend post txn operation plugin */
+ case SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpostmodify;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpostmodrdn;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_ADD_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpostadd;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_betxnpostdelete;
+ break;
+
/* target address & controls for all operations should be normalized */
case SLAPI_TARGET_ADDRESS:
if(pblock->pb_op!=NULL)
@@ -2497,6 +2549,58 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
pblock->pb_plugin->plg_internal_post_delete = (IFP) value;
break;
+ /* backend preoperation plugin - called just after creating transaction */
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpremodify = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpremodrdn = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpreadd = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPREOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpredelete = (IFP) value;
+ break;
+
+ /* backend postoperation plugin - called just before committing transaction */
+ case SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpostmodify = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpostmodrdn = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_ADD_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpostadd = (IFP) value;
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN:
+ if (pblock->pb_plugin->plg_type != SLAPI_PLUGIN_BETXNPOSTOPERATION) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_betxnpostdelete = (IFP) value;
+ break;
+
/* syntax plugin functions */
case SLAPI_PLUGIN_SYNTAX_FILTER_AVA:
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_SYNTAX ) {
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index a8a52cd..c145eff 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -373,6 +373,20 @@ plugin_call_plugins( Slapi_PBlock *pb, int whichfunction )
case SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN:
plugin_list_number= PLUGIN_LIST_INTERNAL_POSTOPERATION;
break;
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN:
+ case SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN:
+ case SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN:
+ case SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN:
+ plugin_list_number= PLUGIN_LIST_BETXNPREOPERATION;
+ do_op = 1; /* always allow backend callbacks (even during startup) */
+ break;
+ case SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN:
+ case SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN:
+ case SLAPI_PLUGIN_BE_TXN_POST_ADD_FN:
+ case SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN:
+ plugin_list_number= PLUGIN_LIST_BETXNPOSTOPERATION;
+ do_op = 1; /* always allow backend callbacks (even during startup) */
+ break;
}
if(plugin_list_number!=-1 && do_op)
{
@@ -1440,6 +1454,7 @@ plugin_call_func (struct slapdplugin *list, int operation, Slapi_PBlock *pb, int
{
if (SLAPI_PLUGIN_PREOPERATION == list->plg_type ||
SLAPI_PLUGIN_INTERNAL_PREOPERATION == list->plg_type ||
+ SLAPI_PLUGIN_BETXNPREOPERATION == list->plg_type ||
SLAPI_PLUGIN_START_FN == operation )
{
/*
@@ -1653,6 +1668,12 @@ plugin_get_type_and_list(
} else if ( strcasecmp( plugintype, "bepostoperation" ) == 0 ) {
*type = SLAPI_PLUGIN_BEPOSTOPERATION;
plugin_list_index= PLUGIN_LIST_BEPOSTOPERATION;
+ } else if ( strcasecmp( plugintype, "betxnpreoperation" ) == 0 ) {
+ *type = SLAPI_PLUGIN_BETXNPREOPERATION;
+ plugin_list_index= PLUGIN_LIST_BETXNPREOPERATION;
+ } else if ( strcasecmp( plugintype, "betxnpostoperation" ) == 0 ) {
+ *type = SLAPI_PLUGIN_BETXNPOSTOPERATION;
+ plugin_list_index= PLUGIN_LIST_BETXNPOSTOPERATION;
} else if ( strcasecmp( plugintype, "internalpreoperation" ) == 0 ) {
*type = SLAPI_PLUGIN_INTERNAL_PREOPERATION;
plugin_list_index= PLUGIN_LIST_INTERNAL_PREOPERATION;
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index ce95b1b..4dce915 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -702,7 +702,9 @@ struct matchingRuleList {
#define PLUGIN_LIST_REVER_PWD_STORAGE_SCHEME 16
#define PLUGIN_LIST_LDBM_ENTRY_FETCH_STORE 17
#define PLUGIN_LIST_INDEX 18
-#define PLUGIN_LIST_GLOBAL_MAX 19
+#define PLUGIN_LIST_BETXNPREOPERATION 19
+#define PLUGIN_LIST_BETXNPOSTOPERATION 20
+#define PLUGIN_LIST_GLOBAL_MAX 21
/* plugin configuration attributes */
#define ATTR_PLUGIN_PATH "nsslapd-pluginPath"
@@ -1108,6 +1110,31 @@ struct slapdplugin {
} plg_un_entry_fetch_store;
#define plg_entryfetchfunc plg_un.plg_un_entry_fetch_store.plg_un_entry_fetch_func
#define plg_entrystorefunc plg_un.plg_un_entry_fetch_store.plg_un_entry_store_func
+
+ /* backend txn pre-operation plugin structure */
+ struct plg_un_betxnpre_operation {
+ IFP plg_un_betxnpre_modify; /* modify */
+ IFP plg_un_betxnpre_modrdn; /* modrdn */
+ IFP plg_un_betxnpre_add; /* add */
+ IFP plg_un_betxnpre_delete; /* delete */
+ } plg_un_betxnpre;
+#define plg_betxnpremodify plg_un.plg_un_betxnpre.plg_un_betxnpre_modify
+#define plg_betxnpremodrdn plg_un.plg_un_betxnpre.plg_un_betxnpre_modrdn
+#define plg_betxnpreadd plg_un.plg_un_betxnpre.plg_un_betxnpre_add
+#define plg_betxnpredelete plg_un.plg_un_betxnpre.plg_un_betxnpre_delete
+
+ /* backend txn post-operation plugin structure */
+ struct plg_un_betxnpost_operation {
+ IFP plg_un_betxnpost_modify; /* modify */
+ IFP plg_un_betxnpost_modrdn; /* modrdn */
+ IFP plg_un_betxnpost_add; /* add */
+ IFP plg_un_betxnpost_delete; /* delete */
+ } plg_un_betxnpost;
+#define plg_betxnpostmodify plg_un.plg_un_betxnpost.plg_un_betxnpost_modify
+#define plg_betxnpostmodrdn plg_un.plg_un_betxnpost.plg_un_betxnpost_modrdn
+#define plg_betxnpostadd plg_un.plg_un_betxnpost.plg_un_betxnpost_add
+#define plg_betxnpostdelete plg_un.plg_un_betxnpost.plg_un_betxnpost_delete
+
} plg_un;
};
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 1c7cc7d..4764e50 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -5778,6 +5778,8 @@ time_t slapi_current_time( void );
#define SLAPI_PLUGIN_REVER_PWD_STORAGE_SCHEME 16
#define SLAPI_PLUGIN_LDBM_ENTRY_FETCH_STORE 17
#define SLAPI_PLUGIN_INDEX 18
+#define SLAPI_PLUGIN_BETXNPREOPERATION 19
+#define SLAPI_PLUGIN_BETXNPOSTOPERATION 20
/*
* special return values for extended operation plugins (zero or positive
@@ -5926,6 +5928,12 @@ typedef struct slapi_plugindesc {
#define SLAPI_PLUGIN_BE_PRE_CLOSE_FN 454
#define SLAPI_PLUGIN_BE_PRE_BACKUP_FN 455
+/* preoperation plugin to the backend - just after transaction creation */
+#define SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN 460
+#define SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN 461
+#define SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN 462
+#define SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN 463
+
/* postoperation plugin functions */
#define SLAPI_PLUGIN_POST_BIND_FN 501
#define SLAPI_PLUGIN_POST_UNBIND_FN 502
@@ -5955,6 +5963,12 @@ typedef struct slapi_plugindesc {
#define SLAPI_PLUGIN_BE_POST_OPEN_FN 554
#define SLAPI_PLUGIN_BE_POST_BACKUP_FN 555
+/* postoperation plugin to the backend - just before transaction commit */
+#define SLAPI_PLUGIN_BE_TXN_POST_ADD_FN 560
+#define SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN 561
+#define SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN 562
+#define SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN 563
+
/* matching rule plugin functions */
#define SLAPI_PLUGIN_MR_FILTER_CREATE_FN 600
#define SLAPI_PLUGIN_MR_INDEXER_CREATE_FN 601
12 years, 3 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/repl5_replica.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 37a2a4d4d823d2dc4211ef57165ad5daf42c63a0
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Sep 9 12:48:31 2011 -0600
Bug 736712 - Modifying ruv entry deadlocks server
https://bugzilla.redhat.com/show_bug.cgi?id=736712
Resolves: bug 736712
Bug Description: Modifying ruv entry deadlocks server
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: Disallow modifying the RUV entry directly. Server returns
OPERATIONS_ERROR. Error log says to use CLEANRUV task instead.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 92322ee..2a24f3e 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2391,6 +2391,19 @@ replica_ruv_smods_for_op( Slapi_PBlock *pb, char **uniqueid, Slapi_Mods **smods
Slapi_Mod smod;
Slapi_Mod smod_last_modified;
Slapi_Operation *op;
+ Slapi_Entry *target_entry = NULL;
+
+ slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &target_entry);
+ if (target_entry && is_ruv_tombstone_entry(target_entry)) {
+ char ebuf[BUFSIZ];
+ /* disallow direct modification of the RUV tombstone entry
+ must use the CLEANRUV task instead */
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
+ "replica_ruv_smods_for_op: attempted to directly modify the tombstone RUV "
+ "entry [%s] - use the CLEANRUV task instead\n",
+ escape_string(slapi_entry_get_dn_const(target_entry),ebuf));
+ return (-1);
+ }
replica_obj = replica_get_replica_for_op (pb);
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
12 years, 3 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/repl5_replica.c | 44 ++----
ldap/servers/plugins/replication/repl5_ruv.c | 147 +++++++++++++++++++----
ldap/servers/plugins/replication/repl5_ruv.h | 16 ++
3 files changed, 158 insertions(+), 49 deletions(-)
New commits:
commit 6bac1a7876ddd2a1fe986505f16aa0330ab4a671
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 8 20:03:14 2011 -0600
Bug 590826 - Reloading database from ldif causes changelog to emit "data no longer matches" errors
https://bugzilla.redhat.com/show_bug.cgi?id=590826
Resolves: bug 590826
Bug Description: Reloading database from ldif causes changelog to emit "data no longer matches" errors
Reviewed by: nkinder, nhosoi (Thanks!)
Branch: master
Fix Description: When there are obsolete or decommissioned masters in the
RUV, this should not invalidate the changelog. Instead, warn the user that
there are replicas in the database RUV that are not in the changelog
max RUV. In this case, the CLEANRUV task can be used to remove the
obsolete masters from the database RUV. I had to add a function to
generate a string representation of the replica RUVElement* for logging
purposes, and used that function elsewhere. The new function
ruv_compare_ruv should be used instead of ruv_contains_ruv since it gives
more flexibility about logging and handling different cases.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index b2ebf93..92322ee 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -1431,7 +1431,6 @@ int replica_check_for_data_reload (Replica *r, void *arg)
RUV *upper_bound_ruv = NULL;
RUV *r_ruv = NULL;
Object *r_obj, *ruv_obj;
- int cl_cover_be, be_cover_cl;
PR_ASSERT (r);
@@ -1452,6 +1451,7 @@ int replica_check_for_data_reload (Replica *r, void *arg)
if (upper_bound_ruv)
{
+ char ebuf[BUFSIZ];
ruv_obj = replica_get_ruv (r);
r_ruv = object_get_data (ruv_obj);
PR_ASSERT (r_ruv);
@@ -1474,40 +1474,19 @@ int replica_check_for_data_reload (Replica *r, void *arg)
* sessions.
*/
- be_cover_cl = ruv_covers_ruv (r_ruv, upper_bound_ruv);
- cl_cover_be = ruv_covers_ruv (upper_bound_ruv, r_ruv);
- if (!cl_cover_be)
+ rc = ruv_compare_ruv(upper_bound_ruv, "changelog max RUV", r_ruv, "database RUV", 0, SLAPI_LOG_FATAL);
+ if (RUV_COMP_IS_FATAL(rc))
{
- /* the data was reloaded, or we had disorderly shutdown between
- * writing RUV and CL, and we can no longer use existing CL */
- char ebuf[BUFSIZ];
- char cl_csn_str[CSN_STRSIZE] = {0};
- char be_csn_str[CSN_STRSIZE] = {0};
- CSN *cl_csn = NULL;
- CSN *be_csn = NULL;
-
- if (ruv_get_max_csn( r_ruv, &be_csn ) == RUV_SUCCESS) {
- csn_as_string( be_csn, PR_FALSE, be_csn_str );
- csn_free( &be_csn );
- }
-
- if (ruv_get_max_csn( upper_bound_ruv, &cl_csn ) == RUV_SUCCESS) {
- csn_as_string( cl_csn, PR_FALSE, cl_csn_str );
- csn_free( &cl_csn );
- }
-
/* create a temporary replica object to conform to the interface */
r_obj = object_new (r, NULL);
/* We can't use existing changelog - remove existing file */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "replica_check_for_data_reload: "
- "Warning: data for replica %s does not match the data in the changelog "
- "(replica data (%s) %s changelog (%s)). Recreating the changelog file. "
+ "Warning: data for replica %s does not match the data in the changelog. "
+ "Recreating the changelog file. "
"This could affect replication with replica's consumers in which case the "
"consumers should be reinitialized.\n",
- escape_string(slapi_sdn_get_dn(r->repl_root),ebuf),
- (*be_csn_str=='\0' ? "unknown" : be_csn_str),
- ((!be_cover_cl) ? "<>" : ">"), (*cl_csn_str=='\0' ? "unknown" : cl_csn_str));
+ escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
rc = cl5DeleteDBSync (r_obj);
@@ -1519,6 +1498,17 @@ int replica_check_for_data_reload (Replica *r, void *arg)
rc = replica_log_ruv_elements (r);
}
}
+ else if (rc)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "replica_check_for_data_reload: "
+ "Warning: for replica %s there were some differences between the changelog max RUV and the "
+ "database RUV. If there are obsolete elements in the database RUV, you "
+ "should remove them using CLEANRUV task. If they are not obsolete, "
+ "you should check their status to see why there are no changes from those "
+ "servers in the changelog.\n",
+ escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
+ rc = 0;
+ }
object_release (ruv_obj);
}
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index ce0da4d..2e4af87 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -1006,6 +1006,34 @@ ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg)
return rc;
}
+void
+ruv_element_to_string(RUVElement *ruvelem, struct berval *bv, char *buf, size_t bufsize)
+{
+ char csnStr1[CSN_STRSIZE];
+ char csnStr2[CSN_STRSIZE];
+ const char *fmtstr = "%s%d%s%s}%s%s%s%s";
+ if (buf && bufsize) {
+ PR_snprintf(buf, bufsize, fmtstr,
+ prefix_ruvcsn, ruvelem->rid,
+ ruvelem->replica_purl == NULL ? "" : " ",
+ ruvelem->replica_purl == NULL ? "" : ruvelem->replica_purl,
+ ruvelem->min_csn == NULL ? "" : " ",
+ ruvelem->min_csn == NULL ? "" : csn_as_string (ruvelem->min_csn, PR_FALSE, csnStr1),
+ ruvelem->csn == NULL ? "" : " ",
+ ruvelem->csn == NULL ? "" : csn_as_string (ruvelem->csn, PR_FALSE, csnStr2));
+ } else {
+ bv->bv_val = slapi_ch_smprintf(fmtstr,
+ prefix_ruvcsn, ruvelem->rid,
+ ruvelem->replica_purl == NULL ? "" : " ",
+ ruvelem->replica_purl == NULL ? "" : ruvelem->replica_purl,
+ ruvelem->min_csn == NULL ? "" : " ",
+ ruvelem->min_csn == NULL ? "" : csn_as_string (ruvelem->min_csn, PR_FALSE, csnStr1),
+ ruvelem->csn == NULL ? "" : " ",
+ ruvelem->csn == NULL ? "" : csn_as_string (ruvelem->csn, PR_FALSE, csnStr2));
+ bv->bv_len = strlen(bv->bv_val);
+ }
+}
+
/*
* Convert a replica update vector to a NULL-terminated array
* of bervals. The caller is responsible for freeing the bervals.
@@ -1025,8 +1053,6 @@ ruv_to_bervals(const RUV *ruv, struct berval ***bvals)
int count;
int i;
RUVElement *replica;
- char csnStr1 [CSN_STRSIZE];
- char csnStr2 [CSN_STRSIZE];
int cookie;
slapi_rwlock_rdlock (ruv->lock);
count = dl_get_count (ruv->elements) + 2;
@@ -1040,15 +1066,7 @@ ruv_to_bervals(const RUV *ruv, struct berval ***bvals)
i++, replica = dl_get_next (ruv->elements, &cookie))
{
returned_bervals[i] = (struct berval *)slapi_ch_malloc(sizeof(struct berval));
- returned_bervals[i]->bv_val = slapi_ch_smprintf("%s%d%s%s}%s%s%s%s",
- prefix_ruvcsn, replica->rid,
- replica->replica_purl == NULL ? "" : " ",
- replica->replica_purl == NULL ? "" : replica->replica_purl,
- replica->min_csn == NULL ? "" : " ",
- replica->min_csn == NULL ? "" : csn_as_string (replica->min_csn, PR_FALSE, csnStr1),
- replica->csn == NULL ? "" : " ",
- replica->csn == NULL ? "" : csn_as_string (replica->csn, PR_FALSE, csnStr2));
- returned_bervals[i]->bv_len = strlen(returned_bervals[i]->bv_val);
+ ruv_element_to_string(replica, returned_bervals[i], NULL, 0);
}
slapi_rwlock_unlock (ruv->lock);
return_value = RUV_SUCCESS;
@@ -1072,29 +1090,21 @@ ruv_to_smod(const RUV *ruv, Slapi_Mod *smod)
struct berval val;
RUVElement *replica;
int cookie;
- char csnStr1 [CSN_STRSIZE];
- char csnStr2 [CSN_STRSIZE];
#define B_SIZ 1024
char buf[B_SIZ];
slapi_rwlock_rdlock (ruv->lock);
slapi_mod_init (smod, dl_get_count (ruv->elements) + 1);
slapi_mod_set_type (smod, type_ruvElement);
slapi_mod_set_operation (smod, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES);
- PR_snprintf(buf, B_SIZ, "%s %s", prefix_replicageneration, ruv->replGen);
+ PR_snprintf(buf, sizeof(buf), "%s %s", prefix_replicageneration, ruv->replGen);
val.bv_val = buf;
val.bv_len = strlen(buf);
slapi_mod_add_value(smod, &val);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
{
-
- PR_snprintf(buf, B_SIZ, "%s%d%s%s}%s%s%s%s", prefix_ruvcsn, replica->rid,
- replica->replica_purl == NULL ? "" : " ",
- replica->replica_purl == NULL ? "" : replica->replica_purl,
- replica->min_csn == NULL ? "" : " ",
- replica->min_csn == NULL ? "" : csn_as_string (replica->min_csn, PR_FALSE, csnStr1),
- replica->csn == NULL ? "" : " ",
- replica->csn == NULL ? "" : csn_as_string (replica->csn, PR_FALSE, csnStr2));
+ ruv_element_to_string(replica, NULL, buf, sizeof(buf));
+ val.bv_val = buf;
val.bv_len = strlen(buf);
slapi_mod_add_value(smod, &val);
}
@@ -1172,6 +1182,99 @@ ruv_covers_ruv(const RUV *covering_ruv, const RUV *covered_ruv)
return return_value;
}
+/*
+ * This compares two ruvs to see if they are compatible. This is
+ * used, for example, when the data is reloaded, to see if the ruv
+ * from the database is compatible with the ruv from the changelog.
+ * If the replica generation is empty or does not match, the data
+ * is not compatible.
+ * If the maxcsns are not compatible, the ruvs are not compatible.
+ * However, if the first ruv has replica IDs that the second RUV
+ * does not have, and this is the only difference, the application
+ * may allow that with a warning.
+ */
+int
+ruv_compare_ruv(const RUV *ruv1, const char *ruv1name, const RUV *ruv2, const char *ruv2name, int strict, int loglevel)
+{
+ int rc = 0;
+ int ii = 0;
+ const RUV *ruvalist[] = {ruv1, ruv2};
+ const RUV *ruvblist[] = {ruv2, ruv1};
+ int missinglist[2] = {0, 0};
+ const char *ruvanames[] = {ruv1name, ruv2name};
+ const char *ruvbnames[] = {ruv2name, ruv1name};
+ const int nitems = 2;
+
+ /* compare replica generations first */
+ if (ruv1->replGen == NULL || ruv2->replGen == NULL) {
+ slapi_log_error(loglevel, repl_plugin_name,
+ "ruv_compare_ruv: RUV [%s] is missing the replica generation\n",
+ ruv1->replGen ? ruv2name : ruv1name);
+ return RUV_COMP_NO_GENERATION;
+ }
+
+ if (strcasecmp (ruv1->replGen, ruv2->replGen)) {
+ slapi_log_error(loglevel, repl_plugin_name,
+ "ruv_compare_ruv: RUV [%s] replica generation [%s] does not match RUV [%s] [%s]\n",
+ ruv1name, ruv1->replGen, ruv2name, ruv2->replGen);
+ return RUV_COMP_GENERATION_DIFFERS;
+ }
+
+ /* replica generation is the same, now compare element by element */
+ for (ii = 0; ii < nitems; ++ii) {
+ int cookie;
+ const RUV *ruva = ruvalist[ii];
+ const RUV *ruvb = ruvblist[ii];
+ int *missing = &missinglist[ii];
+ const char *ruvaname = ruvanames[ii];
+ const char *ruvbname = ruvbnames[ii];
+ RUVElement *replicab;
+
+ for (replicab = dl_get_first (ruvb->elements, &cookie);
+ NULL != replicab;
+ replicab = dl_get_next (ruvb->elements, &cookie)) {
+ if (replicab->csn) {
+ ReplicaId rid = csn_get_replicaid(replicab->csn);
+ RUVElement *replicaa = ruvGetReplica(ruva, rid);
+ char csnstra[CSN_STRSIZE];
+ char csnstrb[CSN_STRSIZE];
+ char ruvelem[1024];
+ ruv_element_to_string(replicab, NULL, ruvelem, sizeof(ruvelem));
+ csn_as_string(replicab->csn, PR_FALSE, csnstrb);
+ if (replicaa == NULL) {
+ (*missing)++;
+ slapi_log_error(loglevel, repl_plugin_name,
+ "ruv_compare_ruv: RUV [%s] does not contain element [%s] "
+ "which is present in RUV [%s]\n",
+ ruvaname, ruvelem, ruvbname);
+ } else if (strict && (csn_compare (replicab->csn, replicaa->csn) >= 0)) {
+ csn_as_string(replicaa->csn, PR_FALSE, csnstra);
+ slapi_log_error(loglevel, repl_plugin_name,
+ "ruv_compare_ruv: the max CSN [%s] from RUV [%s] is larger "
+ "than or equal to the max CSN [%s] from RUV [%s] for element [%s]\n",
+ csnstrb, ruvbname, csnstra, ruvaname, ruvelem);
+ rc = RUV_COMP_CSN_DIFFERS;
+ } else if (csn_compare (replicab->csn, replicaa->csn) > 0) {
+ csn_as_string(replicaa->csn, PR_FALSE, csnstra);
+ slapi_log_error(loglevel, repl_plugin_name,
+ "ruv_compare_ruv: the max CSN [%s] from RUV [%s] is larger "
+ "than the max CSN [%s] from RUV [%s] for element [%s]\n",
+ csnstrb, ruvbname, csnstra, ruvaname, ruvelem);
+ rc = RUV_COMP_CSN_DIFFERS;
+ }
+ }
+ }
+ }
+ if (!rc) {
+ if (missinglist[0]) {
+ rc = RUV_COMP_RUV1_MISSING;
+ } else if (missinglist[1]) {
+ rc = RUV_COMP_RUV2_MISSING;
+ }
+ }
+ return rc;
+}
+
PRInt32
ruv_replica_count (const RUV *ruv)
{
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index 0a0777e..d329dc3 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -69,6 +69,21 @@ enum
RUV_COVERS_CSN
};
+/* return values from ruv_compare_ruv */
+enum
+{
+ RUV_COMP_SUCCESS=0,
+ RUV_COMP_NO_GENERATION, /* one or both of the RUVs is missing the replica generation */
+ RUV_COMP_GENERATION_DIFFERS, /* the RUVs have different replica generations */
+ /* one of the maxcsns in one of the RUVs is out of date with respect to the
+ corresponding maxcsn in the corresponding replica in the other RUV */
+ RUV_COMP_CSN_DIFFERS,
+ RUV_COMP_RUV1_MISSING, /* ruv2 contains replicas not in ruv1 - CLEANRUV */
+ RUV_COMP_RUV2_MISSING /* ruv1 contains replicas not in ruv2 */
+};
+
+#define RUV_COMP_IS_FATAL(ruvcomp) (ruvcomp && (ruvcomp < RUV_COMP_RUV1_MISSING))
+
typedef struct ruv_enum_data
{
CSN *csn;
@@ -122,6 +137,7 @@ PRBool ruv_has_both_csns(const RUV *ruv);
PRBool ruv_is_newer (Object *sruv, Object *cruv);
void ruv_force_csn_update (RUV *ruv, CSN *csn);
void ruv_insert_dummy_min_csn (RUV *ruv);
+int ruv_compare_ruv(const RUV *ruv1, const char *ruv1name, const RUV *ruv2, const char *ruv2name, int strict, int loglevel);
#ifdef __cplusplus
}
#endif
12 years, 3 months
Changes to 'refs/tags/389-ds-base-1.2.9.10'
by Richard Allen Megginson
Changes since 389-ds-base-1.2.6.a1:
Endi S. Dewata (168):
Bug 545620 - Password cannot start with minus sign
Bug 538525 - Ability to create instance as non-root user
Bug 570542 - Root password cannot contain matching curly braces
Bug 470684 - Pam_passthru plugin doesn't verify account activation
Bug 573375 - MODRDN operation not logged
Bug 520151 - Error when modifying userPassword with proxy user
Bug 455489 - Address compiler warnings about strict-aliasing rules
Bug 566320 - RFE: add exception to removal of attributes in cn=config for aci
Bug 566043 - startpid file is only cleaned by initscript runs
Bug 584109 - Slapd crashes while parsing DNA configuration
Bug 542570 - Directory Server port number is not validated in the beginning.
Bug 145181 - Plugin target/bind subtrees only take 1 value.
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 628096 - spurious error message from /sbin/service when doing a stop on no instances
Bug 573889 - Migration does not remove deprecated schema
Bug 606545 - core schema should include numSubordinates
Bug 643979 - Strange byte sequence for attribute with no values (nsslapd-referral)
Endi Sukma Dewata (16):
Bug 630092 - Coverity #12117: Resource leaks issues
Bug 630092 - Coverity #15478: Resource leaks issues
Bug 630092 - Coverity #15479: Resource leaks issues
Bug 630092 - Coverity #15481: Resource leaks issues
Bug 630092 - Coverity #15482: Resource leaks issues
Bug 630092 - Coverity #15483: Resource leaks issues
Bug 630092 - Coverity #15484: Resource leaks issues
Bug 630092 - Coverity #15485: Resource leaks issues
Bug 630092 - Coverity #15487: Resource leaks issues
Bug 630092 - Coverity #15490: Resource leaks issues
Bug 630092 - Coverity #15497: Resource leaks issues
Bug 630092 - Coverity #11991: Resource leaks issues
Bug 630092 - Coverity #12000: Resource leaks issues
Bug 630092 - Coverity #12003: Resource leaks issues
Bug 630092 - Coverity #11985: Resource leaks issues
Bug 630092 - Coverity #11992,11993: Resource leaks issues
Nathan Kinder (181):
Bug 549554 - Trim single-valued attributes before sending to AD
Improve search for pcre header file
Bug 434735 - Allow SASL ANONYMOUS mech to work
Bug 570912 - Avoid selinux context conflict with httpd
Allow instance name to be parsed from start-slapd
Add managed entries plug-in
Bug 572355 - Label instance files and ports during upgrade.
Bug 578863 - Password modify extop needs to send referrals on replicas
Bug 584156 - Remove ldapi socket file during upgrade
Fix rsearch usage of name files for random filters
Bug 584497 - Allow DNA plugin to set same value on multiple attributes
Add replication session hooks
Correct function prototype for repl session hook
Bug 592389 - Set anonymous resource limits properly
Bug 601433 - Add man pages for start-dirsrv and related commands
Bug 604263 - Fix memory leak when password change is rejected
Bug 612242 - membership change on DS does not show on AD
Bug 613833 - Allow dirsrv_t to bind to rpc ports
Bug 594745 - Get rid of dirsrv_lib_t label
Bug 620927 - Allow multiple membership attributes in memberof plugin
Bug 612264 - ACI issue with (targetattr='userPassword')
Bug 630098 - fix coverity Defect Type: Code maintainability issues
Bug 630098 - fix coverity Defect Type: Code maintainability issues
Bug 630093 - (cov#15511) Don't use unintialized search_results in refint plugin
Bug 630093 - (cov#15518) Need to intialize fd in ldbm2ldif code
Bug 630096 - (cov#11778) check return value of ldap_parse_result
Bug 630096 - (cov#15446) check return value of ber_scanf()
Bug 630096 - (cov#15449,15450) Check return value of stat()
Bug 630096 - (cov#15448) Check return value of cache_replace()
Bug 630096 - (cov#15447) - Check return value of idl_append_extend()
Bug 630090 - (cov#11974) Remove unused ACL functions
Bug 630090 - (cov#15445) Fix illegal free in archive code
Bug 630094 - (cov#11818) Fix unreachable return in snmp subagent
Bug 630094 - (cov#15451) Get rid of unreachable free statements
Bug 630094 - (cov#15452) Remove NULL checking for op_string
Bug 630094 - (cov#15453) Eliminate NULL check for local_newentry
Bug 630094 - (cov#15454) Fix deadcode issue in mapping tree code
Bug 630094 - (cov#15455) Remove deadcode in attr_index_config()
Bug 630094 - (cov#15456) Remove NULL check for srdn in import code
Bug 630094 - (cov#15457) Remove deadcode in import code
Bug 630094 - (cov#15458) Fix deadcode issue in moddn code
Bug 630094 - (cov#15459) Remove NULL check for srdn in ldif2ldbm code
Bug 630094 - (cov#15520) Fix unreachable code issue if perfctrs code
Bug 630094 - (cov#15581) Add missing breaks in agt_mopen_stats()
Bug 690090 - (cov#11974) Remove additional unused ACL functions
Bug 630091 - (cov#15512) Fix usage of uninitialized bervals
Bug 630091 - (cov#15513) Fix usage of uninitialized bervals
Bug 630091 - (cov#15514) Initialize DBT in entryrdn_get_parent()
Bug 630091 - (cov#15515) Use of uninitialized array in index config code
Bug 630091 - (cov#15516,15517) Initialize pointers before attempting to free
Bug 630091 - (cov#15519) Initialize bervals in search_easter_egg()
Bug 630091 - (cov#15582) Free of uninitialized pointer in attr_index_config()
Bug 630097 - (cov#11933) Fix NULL dereference in schema code
Bug 630097 - (cov#11938) NULL dereference in mmldif
Bug 630097 - (cov#11946) NULL dereference in ResHashCreate()
Bug 630097 - (cov#11964) Remove dead code from libaccess
Bug 630097 - (cov#12143) NULL dereference in cos cache code
Bug 630097 - (cov#12148) NULL dereference in ruvInit()
Bug 630097 - (cov#12182,12183) NULL dereference in import code
Bug 630097 - (cov#15460) NULL deference in ACL URL code
Bug 630097 - (cov#15461) Remove unnecessary NULL check in DNA
Bug 630097 - (cov#15462) NULL dereference in mep_modrdn_post_op()
Bug 630097 - (cov#15463) Remove NULL check in referint plugin
Bug 630097 - (cov#15464) NULL dereference in repl code
Bug 630097 - (cov#15465) Null dereference in USN code
Bug 630097 - (cov#15473) NULL dereference in ResHashCreate()
Bug 630097 - (cov#15505) NULL dereference in memberOf code
Bug 630097 - (cov#15506) NULL dereference in dblayer code
Bug 630097 - (cov#15507,15508) NULL dereference in entryrdn code
Bug 630097 - (cov#15509) NULL dereference in idsktune
Bug 630097 - (cov#11938) NULL dereference in mmldif
Bug 630097 - (cov#15477) NULL dereference in ACL plug-in code
Bug 630091 - (cov#12209) Use of uninitialized pointer in libaccess
Bug 630092 - (cov#12116) Resource leak in ldclt code
Bug 630092 - (cov#12105) Resource leak in pwdscheme config code
Bug 630092 - (cov#12068) Resource leak in certmap code
Bug 630091 - (cov#11973) Array overrun in libaccess
Bug 522055 - Scope check for managed attribute fails
Bug 625335 - Self-write aci has permission to invalid attribute
Bug 631993 - Log authzid when proxy auth control is used
Cov #16300 - Unused variable in account policy plugin
Bug 544321 - remove-ds.pl should not throw error unlabelling port
Bug 555955 - Allow CoS values to be merged
Bug 643937 - Initialize replication version flags
Bug 305131 - Allow empty modify operation
Bug 619633 - Make attribute uniqueness obey requiredObjectClass
Bug 619623 - attr-unique-plugin ignores requiredObjectClass on modrdn operations
Bug 189985 - Improve attribute uniqueness error message
Bug 647932 - multiple memberOf configuration adding memberOf where there is no member
Bug 521088 - DNA should check ACLs before getting a value from the range
Bug 635009 - Add one-way AD sync capability
Bump VERSION.sh to 1.2.8.a1
Bug 648949 - Move selinux policy into base OS
Bug 648949 - Update configure
Roll back VERSION.sh for 1.2.7 release
Bug 625950 - hash nsslapd-rootpw changes in audit log
Bug 656392 - Remove calls to ber_err_print()
Bug 656515 - Allow Name and Optional UID syntax for grouping attributes
Bug 197886 - Avoid overflow of UUID generator
Bug 658312 - Allow mapped attribute types to be quoted
Bug 197886 - Initialize return value for UUID generation code
Bug 658309 - Process escaped characters in managed entry mappings
Bug 659456 - Incorrect usage of ber_printf() in winsync code
Bug 641944 - Don't normalize non-DN RDN values
Bug 658312 - Invalid free in Managed Entry plug-in
Bug 661792 - Valid managed entry config rejected
Bug 588791 - Allow anonymous rootDSE access only
Bug 606439 - Creating server instance with LDAPI takes too long
Bug 632670 - Chain-on-update logs managed-entries-plugin errors
Bug 621008 - parsing purge RUV from changelog at startup fails
Bug 663191 - Don't use $USER in DSCreate.pm
Bug 663597 - Memory leaks in normalization code
Bug 659131 - Incorrect RDN values added with multi-valued RDN
Bug 661102 - Rename of managed entries not handled correctly
Bug 193297 - Call pre-bind plug-ins for all SASL bind steps
Bug 201652 - LDAPv2 bind with expired password doesn't unbind correctly
Bug 470576 - Migration could do addition checks before commiting actions
Bug 481195 - Missing op type in log when password change required
Bug 509897 - Validate dnaScope to ensure it is a legal DN
Bug 505722 - Allow ntGroup to have mail attribute present
Bug 543633 - replication problems if supplier is killed under update load
Bug 671033 - range sharing between server breaks with SASL/GSSAPI auth
Bug 527912 - setup-ds.pl appears to hang when DNS is unreachable
Bug 252249 - Add pkg-config file for plug-in developers
Bug 670616 - Allow SSF to be set for local (ldapi) connections
Bug 668862 - init scripts return wrong error code
Bug 674430 - Improve error messages for attribute uniqueness
Bug 675853 - dirsrv crash segfault in need_new_pw()
Bug 678646 - Ignore tombstone operations in managed entry plug-in
Bug 671199 - Don't allow other to write to rundir
Bug 672468 - Don't use empty path elements in LD_LIBRARY_PATH
Bug 674852 - crash in ldap-agent when using OpenLDAP
Bug 681345 - setup-ds.pl should set SuiteSpotGroup automatically
Bug 680558 - Winsync plugin fails to restrain itself to the configured subtree
Bug 504803 - Allow maxlogsize to be set if logmaxdiskspace is -1
Bug 687974 - (cov#10715) Fix Coverity uninitialized variables issues
Bug 688341 - (cov#10709) Fix Coverity code maintainability issues
Bug 688341 - (cov#10708) Fix Coverity code maintainability issues
Bug 688341 - (cov#10706,10707) Fix Coverity code maintainability issues
Bug 688341 - (cov#10704,10705) Fix Coverity code maintainability issues
Bug 688341 - (cov#10703) Fix Coverity code maintainability issues
Bug 688341 - (cov#10702) Fix Coverity code maintainability issues
Bug 688341 - (cov#10709) Fix Coverity code maintainability issues
Bug 689537 - (cov#10699) Fix Coverity NULL pointer dereferences
Bug 689537 - (cov#10610) Fix Coverity NULL pointer dereferences
Bug 689537 - (cov#10608) Fix Coverity NULL pointer dereferences
Bug 689952 - (cov#10581) Incorrect bit check in replication connection code
Bug 690526 - (cov#10734) Double free in dse_add()
Bug 690649 - (cov#10731) Use of free'd pointer in indexing code
Bug 690882 - (cov#10571) Incorrect sizeof use in uuid code
Bug 690882 - (cov#10636,10637) Useless comparison in attrcrypt
Bug 690882 - (cov#10703) Incorrect sizeof use in vattr code
Bug 690882 - (cov#10572,10710) Incorrect sizeof use in uuid code
Bug 691574 - (cov#10579) Check return value of ber_scanf() in sort code
Bug 691574 - (cov#10577) Check return types when adding RDN CSNs
Bug 691574 - (cov#10573) check return value in GER code
Bug 691574 - (cov#10575) Check return value of ldap_get_option
Bug 691574 - (cov#10573) Fix syntax error
Bug 693868 - Add managed entry config during in-place upgrade
Add Auto Membership Plug-in
Bug 698428 - Make auto membership use Slapi_DN for DN comparisons
Bug 695779 - windows sync can lose old values when a new value is added
Bug 700557 - Linked attrs callbacks access free'd pointers after close
Bug 700557 - Leak at shutdown in DNA plug-in
Bug 703304 - Auto membership alternate config area should override default area
Bug 703304 - Auto membership alternate config area should override default area
Bug 703530 - Allow Managed Entry config to be relocated
Bug 697961 - memberOf needs to be triggered by internal operations
Bug 710377 - Import with chain-on-update crashes ns-slapd
Split automember regex rules into separate entries
Bug 713209 - Update sudo schema
Bug 691313 - Need TLS/SSL error messages in repl status and errors log
Bug 723937 - Slapi_Counter API broken on 32-bit F15
Bug 725743 - Make memberOf use PRMonitor for it's operation lock
Bug 729717 - Fatal error messages when syncing deletes from AD
Bug 728510 - Run dirsync after sending updates to AD
Bug 728592 - Allow ns-slapd to start with an invalid server cert
Bug 732541 - Ignore error 32 when adding automember config
Bug 722292 - Entries in DS are not updated properly when using WinSync API
Bug 722292 - (cov#11030) Leak of mapped_sdn in winsync rename code
Bug 735114 - renaming a managed entry does not update mepmanagedby
Noriko Hosoi (253):
544089 - Referential Integrity Plugin does not take into account the attribute
557224 - subtree rename breaks the referential integrity plug-in
247413 - Incorrect error on multiple identical value add
559016 - Attempting to rename suffix returns inappropriate errors
555577 - Syntax validation fails for "ou=NetscapeRoot" tree
Undo - 555577 - Syntax validation fails for "ou=NetscapeRoot" tree
560827 - Admin Server templates: DistinguishName validation fails
548535 - memory leak in attrcrypt
563365 - Error handling problems in the backend functions
565664 - Incorrect parameter for CACHE_RETURN()
565987 - redhat-ds-base fails to build due to undefined struct
527848 - make sure db upgrade to 4.7 and later works correctly
539618 - Replication bulk import reports Invalid read/write
567370 - dncache: assertion failure in id2entry_delete
548115 - memory leak in schema reload
555970 - missing read lock in the combination of cos and nsview
539618 - Replication bulk import reports Invalid read/write
570667 - MMR: simultaneous total updates on the masters cause
Merge branch '547503'
Revert "Merge branch '547503'"
Bug 554573 - ACIs use bind DN from bind req rather than cert mapped DN from sasl/external
199923 - subtree search fails to find items under a db
570107 - The import of LDIFs with base-64 encoded DNs fails,
572649 - DS8.2 crashes on RHEL 4 (corresponding to bob, ber_2 test case)
573060 - DN normalizer: ESC HEX HEX is not normalized (
573896 - initializing subtree with invalid syntax crashes ns-slapd
515805 - Stop "initialize Database" crashes the server
548533 - memory leak in Repl_5_Inc_Protocol_new
Fixing a syntax error
Update to New DN Format
585905 - ACL with targattrfilters error crashes the server
574167 - An escaped space at the end of the RDN value is not
590931 - rhds81 import - hardcoded pages_limit for nsslapd-import-cache-autosize
591336 - Implementing upgrade DN format tool
593453 - Creating password policy with ns-newpolicy.pl on Replicated
593110 - backup-restore does not ALWAYS work
593899 - adding specific ACI causes very large mem allocate request
588867 - entryusn plugin fails on solaris
593899 - adding specific ACI causes very large mem allocate request
595893 - Base DN in SASL mapping is not normalized
511112 - Password history limited to 25 values
597375 - Deleting LDBM database causes backup/restore problem
574101 - MODRDN request never returns - possible deadlock
606920 - anonymous resource limit - nstimelimit -
605827 - In-place upgrade: upgrade dn format should not run in setup-ds-admin.pl
578296 - Attribute type entrydn needs to be added when subtree
609256 - Selinux: pwdhash fails if called via Admin Server CGI
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
609255 - fix coverity Defect Type: Memory - illegal accesses issues
616618 - 389 v1.2.5 accepts 2 identical entries with different DN formats
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
610281 - fix coverity Defect Type: Control flow issues
616608 - SIGBUS in RDN index reads on platforms with strict alignments
619595 - Upgrading sub suffix under non-normalized suffix disappears
513166 - Simple Paged result doesn't provide the server's estimate
621928 - Unable to enable replica (rdn problem?) on 1.2.6 rc6
Bug 194531 - db2bak is too noisy
Bug 622628 - fix coverity Defect Type: Integer handling issues
Bug 622628 - fix coverity Defect Type: Integer handling issues
Bug 622628 - fix coverity Defect Type: Integer handling issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 622903 - fix coverity Defect Type: Code maintainability issues
Bug 623118 - Simplepaged results going in infinite loop
Bug 614511 - fix coverity Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 619122 - fix coverity Defect Type: Resource leaks issues CID 11975 - 12051
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 617630 - fix coverity Defect Type: Resource leaks issues CID 12052 - 12093
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 616500 - fix coverity Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverity Defect Type: Resource leaks issues CID 12094 - 12136
Bug 616500 - fix coverity Defect Type: Resource leaks issues CID 12094 - 12136
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892
Bug 616500 - fix coverity Defect Type: Resource leaks issues
Bug 623507 - fix coverity Defect Type: Incorrect expression issues
Bug 623507 - fix coverity Defect Type: Incorrect expression issues
Bug 613056 - fix coverify Defect Type: Null pointer dereferences
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Removed redundant code in agmt_new_from_entry
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093
Bug 628300 - DN is not normalized in dn/entry cache when an entry is added, entrydn is not present in search results
Bug 531642 - EntryUSN: RFE: a configuration option to make entryusn "global"
Bug 627738 - The cn=monitor statistics entries for the dnentry cache do not change or change very rarely
DN normalizer should check the invalid type
Bug 627738 - The cn=monitor statistics entries for the dnentry cache
Bug 629710 - escape_string does not check '\<HEX><HEX>'
agmtlist_shutdown (repl5_agmtlist.c) had an illegal access defect.
Bug 633168 - Share backend dbEnv with the replication changelog
Bug 633168 - Share backend dbEnv with the replication changelog
Bug 631862 - crash - delete entries not in cache + referint
Bug 625014 - SubTree Renames: ModRDN operation fails and the server hangs if the entry is moved to "under" the same DN.
Bug 558099 - Enhancement request: Log more information about the search result being a paged one
Bug 635987 - Incorrect sub scope search result with
Bug 606920 - anonymous resource limit- nstimelimit -
Bug 635987 - Incorrect sub scope search result with ACL containing ldap:///self
Bug 639289 - Adding a new CN entry with UpperCase UTF-8 Character
Bug 640027 - Naming attribute with a special char sequence parsing bug
Bug 640854 - changelog db: _cl5WriteOperation: failed to
Bug 637852 - sasl_io_start_packet: failed - read only 3 bytes
Bug 586966 - Sample update script has syntax errors
Bug 586973 - Sample update ldif points to non-existent directory
Bug 602456 - Allow to add any cn=config attributes;
Bug 244229 - targetattr not verified against schema when setting an aci
Bug 643532 - Incorrect DNs sometimes returned on searches
Bug 592397 - Upgrade tool dn2rdn: it does not clean up
Bug 645061 - Upgrade: 06inetorgperson.ldif and 05rfc4524.ldif
Bug 629681 - Retro Changelog trimming does not behave as expected
Bug 644608 - RHDS 8.1->8.2 upgrade fails to properly migrate ACIs
Bug 644608 - RHDS 8.1->8.2 upgrade fails to properly migrate ACIs
Bug 644608 - RHDS 8.1->8.2 upgrade fails to properly migrate ACIs
Bug 638773 - permissions too loose on pid and lock files
Bug 491733 - dbtest crashes
Bug 329751 - "nested" filtered roles searches candidates more
Bug 567282 - server can not abandon searchRequest of "simple paged results"
Bug 572018 - Upgrading from 1.2.5 to 1.2.6.a2 deletes userRoot
Bug 651571 - When attrcrypt is on, entrydn is stored in the backend db
Bug 661918 - 389-ds MMR plugin's changelogdb path logic is incorrect
Bug 182507 - clear-password mod from replica is discarded before changelogged
Bug 602456 - Allow to add any cn=config attributes;
Bug 489379 - passwordExpirationTime in entry being added
Bug 663484 - Entry usn plugin fails to properly tag entries on initialization
Bug 664563 - GER: ger for non-present entry is not correct
Bug 653007 - db2ldif export of clear text passwords lacks storage scheme
Bug 667488 - Cannot recreate numsubordinates index with db2index
Bug 663752 - Cert renewal for attrcrypt and encchangelog
Bug 615100 - log rotationinfo always recreated at startup,
Bug 624442 - MMR: duplicate replica ID
Bug 669205 - db2bak: backed up changelog should include RUVs
Bug 616850 - ldapmodify failed to reject the replace operation
Bug 627993 - Inconsistent storage of password expiry times
Bug 627993 - Inconsistent storage of password expiry times
dn2rdn should respect the DB version info
Bug 646381 - Faulty password for nsmultiplexorcredentials does not give any error message in logs
Bug 624547 - attrcrypt should query the given slot/token for
Bug 668619 - slapd stops responding
Bug 151705 - Need to update Console Cipher Preferences with new ciphers
Bug 615052 - intrinsics and 64-bit atomics code fails to compile
Bug 616213 - insufficient stack size for HP-UX on PA-RISC
Bug 675265 - preventryusn gets added to entries on a failed delete
Bug 604881 - admin server log files have incorrect permissions/ownerships
Bug 676053 - export task followed by import task causes cache assertion
Bug 676053 - export task followed by import task causes cache assertion
Bug 676053 - export task followed by import task causes cache assertion
Bug 450016 - RFE- Console display values in KB/MB/GB
Cancelling commit aef19508c4f618285116d2068655183658f564d9
Bug 625424 - repl-monitor.pl doesn't work in hub node
Bug 679978 - modifying attr value crashes the server, which is supposed to
Bug 681015 - RFE: allow fine grained password policy duration attributes in days, hours, minutes, as well
Bug 668909 - Can't modify replication agreement in some cases
Bug 684996 - Exported tombstone cannot be imported correctly
Bug 681015 - RFE: allow fine grained password policy duration attributes in days, hours, minutes, as well
Bug 689866 - ns-newpwpolicy.pl needs to use the new DN format
Bug 690955 - Mrclone fails due to the replica generation id mismatch
Bug 696407 - If an entry with a mixed case RDN is turned to be
Bug 697027 - 1 - minor memory leaks found by Valgrind + TET
Bug 697027 - 2 - minor memory leaks found by Valgrind + TET
Bug 697027 - 3 - minor memory leaks found by Valgrind + TET
Bug 697027 - 4 - minor memory leaks found by Valgrind + TET
Bug 697027 - 5 - minor memory leaks found by Valgrind + TET
Bug 697027 - 6 - minor memory leaks found by Valgrind + TET
Bug 697027 - 7 - minor memory leaks found by Valgrind + TET
Bug 697027 - 8 - minor memory leaks found by Valgrind + TET
Bug 697027 - 9 - minor memory leaks found by Valgrind + TET
Bug 697027 - 10 - minor memory leaks found by Valgrind + TET
Bug 697027 - 11 - minor memory leaks found by Valgrind + TET
Bug 697027 - 12 - minor memory leaks found by Valgrind + TET
Bug 697027 - 13 - minor memory leaks found by Valgrind + TET
Bug 697027 - 14 - minor memory leaks found by Valgrind + TET
Bug 697027 - 15 - minor memory leaks found by Valgrind + TET
Bug 697027 - 16 - minor memory leaks found by Valgrind + TET
Bug 697027 - 3 - minor memory leaks found by Valgrind + TET
Bug 697027 - 3 - minor memory leaks found by Valgrind + TET
Bug 700215 - ldclt core dumps
Bug 668619 - slapd stops responding
Bug 709826 - Memory leak: when extra referrals configured
Bug 706179 - DS can not restart after create a new objectClass has entryusn attribute
Bug 663752 - Cert renewal for attrcrypt and encchangelog
Bug 663752 - Cert renewal for attrcrypt and encchangelog
Bug 711679 - unresponsive LDAP service when deleting vlv on replica
Bug 711679 - unresponsive LDAP service when deleting vlv on replica
Bug 718303 - Intensive updates on masters could break the consumer's cache
Merge branch '718303'
Bug 719069 - clean up compiler warnings in 389-ds-base 1.2.9
Bug 712855 - Directory Server 8.2 logs "Netscape Portable
Bug 663752 - Cert renewal for attrcrypt and encchangelog
Bug 732153 - subtree and user account lockout policies implemented?
Introducing an environment variable USE_VALGRIND to clean up the
Rich Megginson (232):
Net::LDAP password modify extop breaks; msgid in response is 0xFF
Clean up assert for entrydn
Bug 543080 - Bitwise plugin fails to return the exact matched entries for Bitwise search filter
Bug 537466 - nsslapd-distribution-plugin should not require plugin name to begin with "lib"
bump version to 1.2.6.a2
Do not use syntax plugins directly for filters, indexing
wrap new style matching rule plugins for use in old style indexing code
change extensible filter code to use new syntax function style mr funcs
change syntax plugins to register required matching rule plugins
crash looking up compat syntax; numeric string syntax using integer; make octet string ordering work correctly
fix memory leak in attr replace when replacement fails
fix dso linking issues found by fedora 13 linking
problems linking with -z defs
389 DS segfaults on libsyntax-plugin.so - part 1
389 DS segfaults on libsyntax-plugin.so - part 2
389 DS segfaults on libsyntax-plugin.so - part 3
Bug 460162 - FedoraDS "with-FHS" installs init.d StartupScript in wrong location on non-RHEL/Fedora OS
Bug 568196 - Install DS8.2 on Solaris fails
Bug 568196 - Install DS8.2 on Solaris fails - part 2
Bug 551198 - LDAPI: incorrect logging to access log
bump version to 1.2.6.a3
fix various memory leaks
Bug 551198 - LDAPI: incorrect logging to access log - part 2
Bug 554573 - ACIs use bind DN from bind req rather than cert mapped DN from sasl/external
cleanup build warnings
Bug 571514 - upgrade to 1.2.6 should upgrade 05rfc4523.ldif (cert schema)
Bug 570905 - postalAddress syntax should allow empty lines (should allow $$)
Add support for additional schema/matching rules included with 389
Bug 572677 - Memory leak in searches including GER control
Bug 571677 - Busy replica on consumers when directly deleting a replication conflict
Bug 576074 - search filters with parentheses fail
Bug 567429 - slapd didn't close connection and get into CLOSE_WAIT state
Bug 578167 - repl. of mod/replace deletes multi-valued attrs
Bug 561575 - setup-ds-admin fails to supply nsds5ReplicaName when configuring via ConfigFile
Bug 572162 - the string "|*" within a search filter on a non-indexed attribute returns all elements.
Bug 576644 - segfault while multimaster replication (paired node won't find deleted entries)
start of 1.2.6.a4
Bug 572018 - Upgrading from 1.2.5 to 1.2.6.a2 deletes userRoot
Fix too few args for format warning in acllas
Bug 586571 - DS Console shows escaped DNs
Bug 591685 - Server instances Fail to Start on Solaris due to Library Path and pcre
bump console version to 1.2.3
Repl Session API needs to check for NULL api before init
Bug 593392 - setup-ds-admin.pl -k creates world readable file
Bug 595874 - 99user.ldif getting overpopulated
bump version to 1.2.6.a5
bump version to 1.2.6.rc1
bump version to 1.2.6.rc2
bump version to 1.2.6.rc3
Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
Bug 603942 - null deref in _ger_parse_control() for subjectdn
bump version to 1.2.6.rc4
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 602530 - coverity: op_shared_modify: compare pre, post and original entries before freeing them
Bug 602531 - coverity: op_shared_delete: compare preop entry and GLUE_PARENT_ENTRY before freeing them
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
Bug 610177 - fix coverity Defect Type: Uninitialized variables issues
Bug 610276 - fix coverity Defect Type: API usage errors issues
Bug 611850 - fix coverity Defect Type: Error handling issues
Bug 614242 - C99/ANSI C++ related compile errors on HP-UX
Bug 547503 - replication broken again, with 389 MMR replication and TCP errors
Bug 617013 - repl-monitor.pl use cpu upto 90%
fix build failures due to libtool problems
Bug 617629 - Missing aliases in new schema files
Bug 617862 - Replication: Unable to delete tombstone errors
bump version to 1.2.7.a1
Bug 610281 - fix coverity Defect Type: Control flow issues - daemon.c:write_function()
Bug 610281 - fix coverity Defect Type: Control flow issues - last repl init status
postalAddress syntax does not accept empty values
ger should support both "dn" and "distinguishedName"
openldap - ldap_url_parse_ext is not part of the public api
fix memleak in ldbm_config_read_instance_entries
Add -x option to ldap tools when using openldap
openldap - add support for missing controls, add ldif api, fix NSS usage
port client tools to use openldap API
use the mozldap versions of the proxy auth control create function
document slapi wrappers for openldap/mozldap functions that differ
fix some compiler warnings
use strcasecmp with ptype and type->bv_val
ber_printf 'o' cannot handle NULL bv_val
fix the url_parse logic when looking for a missing suffix DN
openldap ldapsearch uses -LLL to suppress # version: N
add ldaptool_opts for the non BUNDLE case in Makefile.am
openldap ldapsearch returns empty line at end of LDIF output
have to use LDAP_OPT_X_TLS_NEVER to defeat cert hostname checking
openldap_read_function needs to set EWOULDBLOCK if the buffer is empty
do not terminate unwrapped LDIF line with another newline
slapi_ldap_url_parse must handle multiple host:port in url
convert mozldap host list to openldap uri list
move the out pointer back if continuation lines were removed
check src < *out only; only check for \nspace if src < *out - 2
use slapi_ldap_url_parse in the acl code
do not un-null-terminate normalized DN until new url is constructed
implement slapi_ldap_explode_dn and slapi_ldap_explode_rdn
use slapi_pblock_set to set the ldap result code for the be postop plugins
pass the string copy to slapi_dn_normalize_original
bug 614511 - fix coverity null reference - revert macro aci $dn logic
fix compiler warnings - unused vars/funcs, invalid casts
use slapi_mods_init_passin/get_ldapmods_passout if modifying the smods
Have to explicitly set protocol version to 3
Only check modrdn ops for backend/suffix correctness if not the default backend
Bug 634561 - Server crushes when using Windows Sync Agreement
openldap ber_init will assert if the bv->bv_val is NULL
add the account policy plugin and related server code, schema, and config
fix pblock memory leak
do not register pre/post op plugins if disabled
add support for global inactivity limit
fix typos in Makefile.am, acctpolicy schema
bump version to 1.2.7.a2
remove extra format argument; use %lu for size_t printf format
Bug 644013 - uniqueness plugin segfault bug
bump version to 1.2.7.a3
bump to 1.2.7.a4
bump version to 1.2.7.a5
put replication config entries in separate file
bump version to 1.2.7.a6
bump version to 1.2.7.1
bump version to 1.2.7.2
bump version to 1.2.7.3
bump version to 1.2.7.4
Bug 515329 - Multiple mods in one operation can result in an inconsistent replica
bump version to 1.2.8.a1
Bug 642046 - Segfault when using SASL/GSSAPI multimaster replication, possible krb5_creds doublefree
Bug 624485 - setup dsktune check step should default to "yes" if no problems found
Bug 622907 - support piped passwords to perl-based maintenance commands
Bug 624485 - setup dsktune check step should default to "yes" if no problems found
Bug 576534 - Password displayed on console when entered in command-line utilities
Bug 667935 - DS pipe log script's logregex.py plugin is not redirecting the log output to the text file
bump version to 1.2.8.a2
Bug 668385 - DS pipe log script is executed as many times as the dirsrv service is restarted
Bug 676689 - crash while adding a new user to be synced to windows
Bug 675113 - ns-slapd core dump in windows_tot_run if oneway sync is used
Bug 677440 - clean up compiler warnings in 389-ds-base 1.2.8
Bug 677774 - DS fails to start after reboot
Bug 666076 - dirsrv crash (1.2.7.5) with multiple simple paged result searches
Bug 675320 - empty modify operation with repl on or lastmod off will crash server
bump version to 1.2.9.a1 - console version to 1.2.4
Bug 677705 - ds-logpipe.py script is failing to validate "-s" and "--serverpid" options with "-t".
Bug 676655 - winsync stops working after server restart
Bug 680555 - ns-slapd segfaults if I have more than 100 DBs
Bug 514190 - setup-ds-admin.pl --debug does not log to file
Bug 518890 - setup-ds-admin.pl - improve hostname validation
Bug 644784 - Memory leak in "testbind.c" plugin
Bug 683250 - slapd crashing when traffic replayed
Bug 690584 - #10691 ldbm_back_init() - fix coverity resource leak issues
Bug 690584 - #10690 #10689 attrcrypt_get_ssl_cert_name() - fix coverity resource leak issues
Bug 690584 - #10688 - dblayer_make_env - fix coverity resource leak issues
Bug 690584 - #10669 #10668 cl5ImportLDIF - fix coverity resource leak issues
Bug 690584 - #10658 linked_attrs_pre_op - fix coverity resource leak issues
Bug 690584 - #10655 acllas__handle_group_entry - fix coverity resource leak issues
Bug 690584 - #10654 #10653 str2entry_dupcheck - fix coverity resource leak issues
Bug 690584 - #10652 #10651 #10650 #10649 #10648 #10647 send_specific_attrs send_all_attrs - fix coverity resource leak issues
Bug 690584 - #10643 hash_rootpw - fix coverity resource leak issues
Bug 690584 - #10641 reslimit_bv2int - fix coverity resource leak issues
Bug 691422 - sdt_destroy - fix coverity control flow issues
Bug 691422 - ldbm_back_upgradedb - fix coverity control flow issues
Bug 691422 - csnplFree - fix coverity control flow issues
Bug 691422 - SetUnicodeStringFromUTF_8 - fix coverity control flow issues
Bug 691422 - cl5DeleteRUV - fix coverity control flow issues
Bug 691422 - acl_read_access_allowed_on_entry - fix coverity control flow issues
Bug 691422 - search_internal_callback_pb - fix coverity control flow issues
Bug 691422 - cl5WriteRUV - fix coverity control flow issues
Bug 691422 - windows_replay_update - fix coverity control flow issues
Bug 690584 - #10691 ldbm_back_init() - fix coverity resource leak issues
Bug 690584 - #10652 #10651 #10650 #10649 #10648 #10647 send_specific_attrs send_all_attrs - fix coverity resource leak issues
Bug 668385 - DS pipe log script is executed as many times as the dirsrv service is restarted
Bug 692937 - Replica install fails after step for "enable GSSAPI for replication"
Bug 692331 - Segfault on index update during full replication push on 1.2.7.5
Bug 693451 - cannot use localized matching rules
Bug 693455 - nsMatchingRule does not work with multiple values
Bug 693503 - matching rules do not inherit from superior attribute type
Bug 693466 - Unable to change schema online
Bug 692991 - rhds82 - windows_tot_run: failed to obtain data to send to the consumer; LDAP error - -1
Bug 693473 - rhds82 rfe - windows_tot_run to log Sizelimit exceeded instead of LDAP error - -1
Bug 693962 - Full replica push loses some entries with multi-valued RDNs
Bug 694336 - Group sync hangs Windows initial Sync
Bug 700145 - userpasswd not replicating
Bug 703990 - Support upgrade from Red Hat Directory Server
bump console version to 1.2.5
Bug 703990 - Support upgrade from Red Hat Directory Server
Bug 703990 - Support upgrade from Red Hat Directory Server
Bug 707015 - Cannot disable SSLv3 and use TLS only
bump version to 1.2.9.a2
Bug 707384 - only allow FIPS approved cipher suites in FIPS mode
Bug 711906 - ns-slapd segfaults using suffix referrals
Bug 706209 - LEGAL: RHEL6.1 License issue for 389-ds-base package
Bug 703703 - setup-ds-admin.pl asks for legal agreement to a non-existant file
Bug 711679 - unresponsive LDAP service when deleting vlv on replica
bump console version to 1.2.6
Bug 697694 - rhds82 - incr update state stop_fatal_error "requires administrator action", with extop_result: 9
Bug 716980 - winsync uses old AD entry if new one not found
add support for ldif files with changetype: add
writing Inf file shows SchemaFile = ARRAY(0xhexnum)
look for separate openldap ldif library
bump version to 1.2.9.a3
Bug 709468 - RSA Authentication Server timeouts when using simple paged results on RHDS 8.2.
Bug 720059 - RDN with % can cause crashes or missing entries
bump version to 1.2.9.0
Bug 725542 - Instance upgrade fails when upgrading 389-ds-base package
Bug 725953 - Winsync: DS entries fail to sync to AD, if the User's CN entry contains a comma
Bug 723937 - replication failing on RUV errors
bump version to 1.2.9.1
Bug 727511 - ldclt SSL search requests are failing with "illegal error number -1" error
bump version to 1.2.9.2
Bug 727511 - ldclt SSL search requests are failing with "illegal error numbe
bump version to 1.2.9.3
Bug 727511 - ldclt SSL search requests are failing with "illegal error number -1" error
bump version to 1.2.9.4
Bug 727511 - ldclt SSL search requests are failing with "illegal error number -1" error
bump version to 1.2.9.5
Bug 729378 - delete user subtree container in AD + modify password in DS == DS crash
Bug 723937 - replication failing on RUV errors
Bug 729369 - upgrade DB to upgrade from entrydn to entryrdn format is not working.
make sure the DBVERSION file ends in a newline
bump version to 1.2.9.6
Bug 633803 - passwordisglobalpolicy attribute brakes TLS chaining
Bug 733103 - large targetattr list with syntax errors cause server to crash or hang
bump version to 1.2.9.7
bump version to 1.2.9.8
Bug 703990 - cross-platform - Support upgrade from Red Hat Directory Server
Bug 735121 - simple paged search + ip/dns based ACI hangs server
bump version to 1.2.9.9
bump version to 1.2.9.10
root (1):
Bug 480787 - Autoconf parameter --with and --without
---
.gitignore | 1
Makefile.am | 178
Makefile.in | 5062 -
README | 11
VERSION.sh | 7
aclocal.m4 | 6884 -
compile | 21
config.guess | 302
config.h.in | 19
config.sub | 232
configure |41561 +++++-------
configure.ac | 106
depcomp | 172
dirsrv.pc.in | 7
include/base/dbtbase.h | 2
include/base/lexer.h | 126
include/i18n.h | 115
include/ldaputil/ldaputil.h | 10
include/libaccess/aclerror.h | 1
include/libaccess/aclproto.h | 15
include/libaccess/aclstruct.h | 2
include/libaccess/dbtlibaccess.h | 3
include/public/nsacl/aclapi.h | 7
install-sh | 517
ldap/admin/src/scripts/10cleanupldapi.pl | 23
ldap/admin/src/scripts/10fixrundir.pl | 11
ldap/admin/src/scripts/50automemberplugin.ldif | 15
ldap/admin/src/scripts/50fixNsState.pl | 240
ldap/admin/src/scripts/50managedentriesplugin.ldif | 16
ldap/admin/src/scripts/50refintprecedence.ldif | 4
ldap/admin/src/scripts/50smd5pwdstorageplugin.ldif | 5
ldap/admin/src/scripts/60upgradeschemafiles.pl | 2
ldap/admin/src/scripts/70upgradefromldif.pl | 112
ldap/admin/src/scripts/80upgradednformat.pl | 206
ldap/admin/src/scripts/81changelog.pl | 29
ldap/admin/src/scripts/90subtreerename.pl | 6
ldap/admin/src/scripts/DSCreate.pm.in | 240
ldap/admin/src/scripts/DSDialogs.pm | 4
ldap/admin/src/scripts/DSMigration.pm.in | 40
ldap/admin/src/scripts/DSUpdate.pm.in | 20
ldap/admin/src/scripts/DSUtil.pm.in | 219
ldap/admin/src/scripts/DialogManager.pm | 241
ldap/admin/src/scripts/DialogManager.pm.in | 241
ldap/admin/src/scripts/Inf.pm | 67
ldap/admin/src/scripts/Migration.pm.in | 20
ldap/admin/src/scripts/Setup.pm.in | 20
ldap/admin/src/scripts/SetupDialogs.pm.in | 31
ldap/admin/src/scripts/SetupLog.pm | 8
ldap/admin/src/scripts/ds-logpipe.py | 221
ldap/admin/src/scripts/exampleupdate.ldif | 2
ldap/admin/src/scripts/exampleupdate.sh | 10
ldap/admin/src/scripts/logregex.py | 16
ldap/admin/src/scripts/migrate-ds.pl.in | 13
ldap/admin/src/scripts/remove-ds.pl.in | 28
ldap/admin/src/scripts/repl-monitor.pl.in | 78
ldap/admin/src/scripts/restart-dirsrv.in | 25
ldap/admin/src/scripts/setup-ds.pl.in | 7
ldap/admin/src/scripts/setup-ds.res.in | 30
ldap/admin/src/scripts/start-dirsrv.in | 43
ldap/admin/src/scripts/stop-dirsrv.in | 27
ldap/admin/src/scripts/template-bak2db.in | 49
ldap/admin/src/scripts/template-bak2db.pl.in | 29
ldap/admin/src/scripts/template-db2bak.in | 53
ldap/admin/src/scripts/template-db2bak.pl.in | 29
ldap/admin/src/scripts/template-db2index.in | 14
ldap/admin/src/scripts/template-db2index.pl.in | 33
ldap/admin/src/scripts/template-db2ldif.in | 15
ldap/admin/src/scripts/template-db2ldif.pl.in | 29
ldap/admin/src/scripts/template-dbverify.in | 15
ldap/admin/src/scripts/template-dn2rdn.in | 25
ldap/admin/src/scripts/template-fixup-linkedattrs.pl.in | 29
ldap/admin/src/scripts/template-fixup-memberof.pl.in | 29
ldap/admin/src/scripts/template-ldif2db.in | 15
ldap/admin/src/scripts/template-ldif2db.pl.in | 29
ldap/admin/src/scripts/template-ldif2ldap.in | 19
ldap/admin/src/scripts/template-monitor.in | 19
ldap/admin/src/scripts/template-ns-accountstatus.pl.in | 33
ldap/admin/src/scripts/template-ns-activate.pl.in | 33
ldap/admin/src/scripts/template-ns-inactivate.pl.in | 33
ldap/admin/src/scripts/template-ns-newpwpolicy.pl.in | 47
ldap/admin/src/scripts/template-restart-slapd.in | 2
ldap/admin/src/scripts/template-restoreconfig.in | 15
ldap/admin/src/scripts/template-saveconfig.in | 15
ldap/admin/src/scripts/template-schema-reload.pl.in | 29
ldap/admin/src/scripts/template-start-slapd.in | 3
ldap/admin/src/scripts/template-stop-slapd.in | 2
ldap/admin/src/scripts/template-suffix2instance.in | 15
ldap/admin/src/scripts/template-syntax-validate.pl.in | 29
ldap/admin/src/scripts/template-upgradedb.in | 15
ldap/admin/src/scripts/template-upgradednformat.in | 63
ldap/admin/src/scripts/template-usn-tombstone-cleanup.pl.in | 29
ldap/admin/src/scripts/template-verify-db.pl.in | 19
ldap/admin/src/scripts/template-vlvindex.in | 15
ldap/admin/src/slapd.inf.in | 2
ldap/docs/LICENSE.txt | 132
ldap/docs/README.txt | 11
ldap/include/ldaplog.h | 32
ldap/ldif/50replication-plugins.ldif | 26
ldap/ldif/template-baseacis.ldif.in | 2
ldap/ldif/template-bitwise.ldif.in | 6
ldap/ldif/template-dse.ldif.in | 70
ldap/ldif/template-suffix-db.ldif.in | 1
ldap/schema/00core.ldif | 72
ldap/schema/01core389.ldif | 7
ldap/schema/02common.ldif | 8
ldap/schema/05rfc4523.ldif | 14
ldap/schema/05rfc4524.ldif | 30
ldap/schema/06inetorgperson.ldif | 5
ldap/schema/10automember-plugin.ldif | 123
ldap/schema/10mep-plugin.ldif | 104
ldap/schema/30ns-common.ldif | 4
ldap/schema/50ns-directory.ldif | 2
ldap/schema/60acctpolicy.ldif | 47
ldap/schema/60qmail.ldif | 4
ldap/schema/60sudo.ldif | 58
ldap/servers/plugins/acctpolicy/acct_config.c | 143
ldap/servers/plugins/acctpolicy/acct_init.c | 191
ldap/servers/plugins/acctpolicy/acct_plugin.c | 314
ldap/servers/plugins/acctpolicy/acct_util.c | 257
ldap/servers/plugins/acctpolicy/acctpolicy.h | 81
ldap/servers/plugins/acctpolicy/sampleconfig.ldif | 40
ldap/servers/plugins/acctpolicy/samplepolicy.ldif | 27
ldap/servers/plugins/acl/acl.c | 115
ldap/servers/plugins/acl/acl.h | 15
ldap/servers/plugins/acl/acl_ext.c | 29
ldap/servers/plugins/acl/aclanom.c | 1
ldap/servers/plugins/acl/acleffectiverights.c | 112
ldap/servers/plugins/acl/aclgroup.c | 9
ldap/servers/plugins/acl/acllas.c | 383
ldap/servers/plugins/acl/acllist.c | 14
ldap/servers/plugins/acl/aclparse.c | 610
ldap/servers/plugins/acl/aclplugin.c | 27
ldap/servers/plugins/acl/aclproxy.c | 232
ldap/servers/plugins/acl/aclutil.c | 103
ldap/servers/plugins/automember/automember.c | 1884
ldap/servers/plugins/automember/automember.h | 134
ldap/servers/plugins/bitwise/bitwise.c | 20
ldap/servers/plugins/chainingdb/cb.h | 2
ldap/servers/plugins/chainingdb/cb_add.c | 76
ldap/servers/plugins/chainingdb/cb_bind.c | 65
ldap/servers/plugins/chainingdb/cb_compare.c | 55
ldap/servers/plugins/chainingdb/cb_config.c | 13
ldap/servers/plugins/chainingdb/cb_conn_stateless.c | 90
ldap/servers/plugins/chainingdb/cb_controls.c | 12
ldap/servers/plugins/chainingdb/cb_delete.c | 80
ldap/servers/plugins/chainingdb/cb_init.c | 4
ldap/servers/plugins/chainingdb/cb_instance.c | 81
ldap/servers/plugins/chainingdb/cb_modify.c | 74
ldap/servers/plugins/chainingdb/cb_modrdn.c | 82
ldap/servers/plugins/chainingdb/cb_search.c | 99
ldap/servers/plugins/chainingdb/cb_utils.c | 3
ldap/servers/plugins/collation/collate.c | 24
ldap/servers/plugins/cos/cos_cache.c | 258
ldap/servers/plugins/deref/deref.c | 8
ldap/servers/plugins/dna/dna.c | 652
ldap/servers/plugins/http/http_impl.c | 81
ldap/servers/plugins/linkedattrs/fixup_task.c | 4
ldap/servers/plugins/linkedattrs/linked_attrs.c | 87
ldap/servers/plugins/memberof/memberof.c | 548
ldap/servers/plugins/memberof/memberof.h | 7
ldap/servers/plugins/memberof/memberof_config.c | 232
ldap/servers/plugins/mep/mep.c | 2581
ldap/servers/plugins/mep/mep.h | 129
ldap/servers/plugins/pam_passthru/pam_ptimpl.c | 17
ldap/servers/plugins/passthru/ptconfig.c | 43
ldap/servers/plugins/pwdstorage/smd5_pwd.c | 9
ldap/servers/plugins/referint/referint.c | 700
ldap/servers/plugins/replication/cl5.h | 1
ldap/servers/plugins/replication/cl5_api.c | 2187
ldap/servers/plugins/replication/cl5_api.h | 92
ldap/servers/plugins/replication/cl5_clcache.c | 33
ldap/servers/plugins/replication/cl5_clcache.h | 2
ldap/servers/plugins/replication/cl5_config.c | 197
ldap/servers/plugins/replication/cl5_init.c | 2
ldap/servers/plugins/replication/cl_crypt.c | 203
ldap/servers/plugins/replication/cl_crypt.h | 53
ldap/servers/plugins/replication/csnpl.c | 2
ldap/servers/plugins/replication/legacy_consumer.c | 1
ldap/servers/plugins/replication/repl-session-plugin.h | 119
ldap/servers/plugins/replication/repl5.h | 51
ldap/servers/plugins/replication/repl5_agmt.c | 134
ldap/servers/plugins/replication/repl5_agmtlist.c | 52
ldap/servers/plugins/replication/repl5_connection.c | 147
ldap/servers/plugins/replication/repl5_inc_protocol.c | 29
ldap/servers/plugins/replication/repl5_init.c | 28
ldap/servers/plugins/replication/repl5_plugins.c | 53
ldap/servers/plugins/replication/repl5_prot_private.h | 4
ldap/servers/plugins/replication/repl5_protocol.c | 107
ldap/servers/plugins/replication/repl5_protocol_util.c | 509
ldap/servers/plugins/replication/repl5_replica.c | 207
ldap/servers/plugins/replication/repl5_replica_config.c | 363
ldap/servers/plugins/replication/repl5_ruv.c | 84
ldap/servers/plugins/replication/repl5_ruv.h | 2
ldap/servers/plugins/replication/repl5_tot_protocol.c | 30
ldap/servers/plugins/replication/repl5_total.c | 22
ldap/servers/plugins/replication/repl_compare.c | 1
ldap/servers/plugins/replication/repl_controls.c | 2
ldap/servers/plugins/replication/repl_extop.c | 266
ldap/servers/plugins/replication/repl_globals.c | 1
ldap/servers/plugins/replication/repl_init.c | 1
ldap/servers/plugins/replication/repl_objset.c | 9
ldap/servers/plugins/replication/repl_session_plugin.c | 188
ldap/servers/plugins/replication/repl_shared.h | 17
ldap/servers/plugins/replication/replutil.c | 85
ldap/servers/plugins/replication/test_repl_session_plugin.c | 335
ldap/servers/plugins/replication/urp.c | 1
ldap/servers/plugins/replication/windows_connection.c | 164
ldap/servers/plugins/replication/windows_inc_protocol.c | 55
ldap/servers/plugins/replication/windows_private.c | 112
ldap/servers/plugins/replication/windows_protocol_util.c | 633
ldap/servers/plugins/replication/windows_tot_protocol.c | 125
ldap/servers/plugins/replication/windowsrepl.h | 14
ldap/servers/plugins/replication/winsync-plugin.h | 2
ldap/servers/plugins/retrocl/retrocl.c | 3
ldap/servers/plugins/retrocl/retrocl.h | 2
ldap/servers/plugins/retrocl/retrocl_create.c | 13
ldap/servers/plugins/retrocl/retrocl_po.c | 11
ldap/servers/plugins/retrocl/retrocl_trim.c | 20
ldap/servers/plugins/rever/des.c | 72
ldap/servers/plugins/rever/rever.c | 8
ldap/servers/plugins/roles/roles_cache.c | 64
ldap/servers/plugins/schema_reload/schema_reload.c | 5
ldap/servers/plugins/shared/plugin-utils.h | 112
ldap/servers/plugins/shared/utils.c | 508
ldap/servers/plugins/statechange/statechange.c | 7
ldap/servers/plugins/syntaxes/bin.c | 142
ldap/servers/plugins/syntaxes/bitstring.c | 36
ldap/servers/plugins/syntaxes/ces.c | 140
ldap/servers/plugins/syntaxes/cis.c | 288
ldap/servers/plugins/syntaxes/dn.c | 42
ldap/servers/plugins/syntaxes/int.c | 64
ldap/servers/plugins/syntaxes/nameoptuid.c | 41
ldap/servers/plugins/syntaxes/numericstring.c | 118
ldap/servers/plugins/syntaxes/string.c | 198
ldap/servers/plugins/syntaxes/syntax.h | 59
ldap/servers/plugins/syntaxes/syntax_common.c | 117
ldap/servers/plugins/syntaxes/tel.c | 62
ldap/servers/plugins/syntaxes/validate.c | 17
ldap/servers/plugins/syntaxes/value.c | 116
ldap/servers/plugins/uiduniq/7bit.c | 7
ldap/servers/plugins/uiduniq/plugin-utils.h | 96
ldap/servers/plugins/uiduniq/uid.c | 202
ldap/servers/plugins/uiduniq/utils.c | 249
ldap/servers/plugins/usn/usn.c | 112
ldap/servers/plugins/usn/usn.h | 2
ldap/servers/plugins/usn/usn_cleanup.c | 13
ldap/servers/plugins/views/views.c | 6
ldap/servers/slapd/abandon.c | 7
ldap/servers/slapd/add.c | 118
ldap/servers/slapd/agtmmap.c | 56
ldap/servers/slapd/attr.c | 80
ldap/servers/slapd/attrlist.c | 7
ldap/servers/slapd/attrsyntax.c | 85
ldap/servers/slapd/auth.c | 79
ldap/servers/slapd/back-ldbm/ancestorid.c | 10
ldap/servers/slapd/back-ldbm/archive.c | 91
ldap/servers/slapd/back-ldbm/back-ldbm.h | 42
ldap/servers/slapd/back-ldbm/cache.c | 66
ldap/servers/slapd/back-ldbm/dbhelp.c | 12
ldap/servers/slapd/back-ldbm/dblayer.c | 1643
ldap/servers/slapd/back-ldbm/dblayer.h | 12
ldap/servers/slapd/back-ldbm/dbtest.c | 349
ldap/servers/slapd/back-ldbm/dbversion.c | 51
ldap/servers/slapd/back-ldbm/dn2entry.c | 12
ldap/servers/slapd/back-ldbm/filterindex.c | 98
ldap/servers/slapd/back-ldbm/findentry.c | 72
ldap/servers/slapd/back-ldbm/id2entry.c | 174
ldap/servers/slapd/back-ldbm/idl.c | 17
ldap/servers/slapd/back-ldbm/idl_new.c | 18
ldap/servers/slapd/back-ldbm/import-merge.c | 28
ldap/servers/slapd/back-ldbm/import-threads.c | 1336
ldap/servers/slapd/back-ldbm/import.c | 395
ldap/servers/slapd/back-ldbm/import.h | 20
ldap/servers/slapd/back-ldbm/index.c | 137
ldap/servers/slapd/back-ldbm/init.c | 36
ldap/servers/slapd/back-ldbm/instance.c | 36
ldap/servers/slapd/back-ldbm/ldbm_add.c | 142
ldap/servers/slapd/back-ldbm/ldbm_attr.c | 248
ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 986
ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c | 2
ldap/servers/slapd/back-ldbm/ldbm_config.c | 103
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 161
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 523
ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 109
ldap/servers/slapd/back-ldbm/ldbm_instance_config.c | 225
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 100
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 170
ldap/servers/slapd/back-ldbm/ldbm_search.c | 157
ldap/servers/slapd/back-ldbm/ldbm_usn.c | 74
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 642
ldap/servers/slapd/back-ldbm/matchrule.c | 50
ldap/servers/slapd/back-ldbm/misc.c | 294
ldap/servers/slapd/back-ldbm/monitor.c | 14
ldap/servers/slapd/back-ldbm/nextid.c | 17
ldap/servers/slapd/back-ldbm/perfctrs.c | 24
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 33
ldap/servers/slapd/back-ldbm/sort.c | 32
ldap/servers/slapd/back-ldbm/start.c | 29
ldap/servers/slapd/back-ldbm/vlv.c | 248
ldap/servers/slapd/back-ldbm/vlv_srch.c | 11
ldap/servers/slapd/back-ldbm/vlv_srch.h | 3
ldap/servers/slapd/back-ldif/back-ldif.h | 2
ldap/servers/slapd/back-ldif/modrdn.c | 12
ldap/servers/slapd/backend.c | 64
ldap/servers/slapd/backend_manager.c | 8
ldap/servers/slapd/bind.c | 275
ldap/servers/slapd/charray.c | 6
ldap/servers/slapd/compare.c | 31
ldap/servers/slapd/configdse.c | 84
ldap/servers/slapd/connection.c | 188
ldap/servers/slapd/conntable.c | 3
ldap/servers/slapd/control.c | 7
ldap/servers/slapd/csn.c | 5
ldap/servers/slapd/csngen.c | 6
ldap/servers/slapd/daemon.c | 138
ldap/servers/slapd/delete.c | 82
ldap/servers/slapd/dn.c | 1113
ldap/servers/slapd/dse.c | 42
ldap/servers/slapd/dynalib.c | 29
ldap/servers/slapd/entry.c | 648
ldap/servers/slapd/entrywsi.c | 78
ldap/servers/slapd/eventq.c | 4
ldap/servers/slapd/extendop.c | 42
ldap/servers/slapd/factory.c | 1
ldap/servers/slapd/fe.h | 5
ldap/servers/slapd/fedse.c | 19
ldap/servers/slapd/filter.c | 2
ldap/servers/slapd/filter.h | 1
ldap/servers/slapd/filtercmp.c | 25
ldap/servers/slapd/filterentry.c | 27
ldap/servers/slapd/index_subsystem.c | 18
ldap/servers/slapd/intrinsics.h | 7
ldap/servers/slapd/ldaputil.c | 686
ldap/servers/slapd/lenstr.c | 6
ldap/servers/slapd/libglobs.c | 404
ldap/servers/slapd/libslapd.def | 1
ldap/servers/slapd/log.c | 73
ldap/servers/slapd/main.c | 270
ldap/servers/slapd/mapping_tree.c | 275
ldap/servers/slapd/match.c | 96
ldap/servers/slapd/modify.c | 333
ldap/servers/slapd/modrdn.c | 215
ldap/servers/slapd/modutil.c | 30
ldap/servers/slapd/operation.c | 1
ldap/servers/slapd/opshared.c | 140
ldap/servers/slapd/pagedresults.c | 130
ldap/servers/slapd/passwd_extop.c | 109
ldap/servers/slapd/pblock.c | 295
ldap/servers/slapd/plugin.c | 209
ldap/servers/slapd/plugin_internal_op.c | 31
ldap/servers/slapd/plugin_mr.c | 474
ldap/servers/slapd/plugin_syntax.c | 352
ldap/servers/slapd/protect_db.c | 24
ldap/servers/slapd/protect_db.h | 7
ldap/servers/slapd/proto-slap.h | 56
ldap/servers/slapd/proxyauth.c | 247
ldap/servers/slapd/psearch.c | 1
ldap/servers/slapd/pw.c | 289
ldap/servers/slapd/pw.h | 3
ldap/servers/slapd/pw_mgmt.c | 139
ldap/servers/slapd/rdn.c | 108
ldap/servers/slapd/regex.c | 3
ldap/servers/slapd/resourcelimit.c | 40
ldap/servers/slapd/result.c | 71
ldap/servers/slapd/rootdse.c | 4
ldap/servers/slapd/sasl_io.c | 167
ldap/servers/slapd/sasl_map.c | 53
ldap/servers/slapd/saslbind.c | 139
ldap/servers/slapd/schema.c | 159
ldap/servers/slapd/search.c | 47
ldap/servers/slapd/security_wrappers.c | 36
ldap/servers/slapd/slap.h | 116
ldap/servers/slapd/slapi-plugin-compat4.h | 6
ldap/servers/slapd/slapi-plugin.h | 546
ldap/servers/slapd/slapi-private.h | 37
ldap/servers/slapd/slapi_counter.c | 24
ldap/servers/slapd/snmp_collator.c | 17
ldap/servers/slapd/ssl.c | 299
ldap/servers/slapd/str2filter.c | 1
ldap/servers/slapd/task.c | 96
ldap/servers/slapd/test-plugins/testbind.c | 1
ldap/servers/slapd/test-plugins/testpostop.c | 1
ldap/servers/slapd/time.c | 85
ldap/servers/slapd/tools/dbscan.c | 72
ldap/servers/slapd/tools/ldclt/data.c | 50
ldap/servers/slapd/tools/ldclt/ldapfct.c | 1069
ldap/servers/slapd/tools/ldclt/ldclt.c | 33
ldap/servers/slapd/tools/ldclt/ldclt.h | 3
ldap/servers/slapd/tools/ldclt/ldcltU.c | 24
ldap/servers/slapd/tools/ldclt/parser.c | 19
ldap/servers/slapd/tools/ldclt/scalab01.c | 182
ldap/servers/slapd/tools/ldif.c | 4
ldap/servers/slapd/tools/mmldif.c | 9
ldap/servers/slapd/tools/pwenc.c | 2
ldap/servers/slapd/tools/rsearch/addthread.c | 25
ldap/servers/slapd/tools/rsearch/sdattable.c | 4
ldap/servers/slapd/tools/rsearch/searchthread.c | 62
ldap/servers/slapd/utf8compare.c | 2
ldap/servers/slapd/util.c | 182
ldap/servers/slapd/uuid.c | 19
ldap/servers/slapd/value.c | 42
ldap/servers/slapd/valueset.c | 75
ldap/servers/slapd/vattr.c | 79
ldap/servers/snmp/ldap-agent.c | 26
ldap/servers/snmp/main.c | 11
ldap/systools/idsktune.c | 65
lib/base/crit.cpp | 6
lib/base/ereport.cpp | 2
lib/base/lexer.cpp | 1015
lib/base/plist.cpp | 3
lib/base/util.cpp | 13
lib/ldaputil/cert.c | 4
lib/ldaputil/certmap.c | 409
lib/ldaputil/dbconf.c | 1
lib/ldaputil/utest/Makefile | 149
lib/ldaputil/utest/auth.cpp | 611
lib/ldaputil/utest/authtest | 138
lib/ldaputil/utest/certmap.conf | 68
lib/ldaputil/utest/dblist.conf | 47
lib/ldaputil/utest/example.c | 153
lib/ldaputil/utest/plugin.c | 152
lib/ldaputil/utest/plugin.h | 57
lib/ldaputil/utest/stubs.c | 144
lib/ldaputil/utest/stubs.cpp | 139
lib/ldaputil/utest/test.ref | 480
lib/ldaputil/vtable.c | 2
lib/libaccess/acl.tab.cpp | 21
lib/libaccess/aclcache.cpp | 105
lib/libaccess/aclflush.cpp | 1
lib/libaccess/aclpriv.h | 1
lib/libaccess/acltools.cpp | 1896
lib/libaccess/authdb.cpp | 112
lib/libaccess/lasdns.cpp | 7
lib/libaccess/lasip.cpp | 16
lib/libaccess/nseframe.cpp | 1
lib/libaccess/oneeval.cpp | 17
lib/libaccess/permhash.h | 11
lib/libaccess/register.cpp | 50
lib/libaccess/usrcache.cpp | 14
lib/libaccess/utest/.purify | 19
lib/libaccess/utest/Makefile | 147
lib/libaccess/utest/acl.dat | 44
lib/libaccess/utest/aclfile0 | 87
lib/libaccess/utest/aclfile1 | 43
lib/libaccess/utest/aclfile10 | 45
lib/libaccess/utest/aclfile11 | 43
lib/libaccess/utest/aclfile12 | 43
lib/libaccess/utest/aclfile13 | 43
lib/libaccess/utest/aclfile14 | 43
lib/libaccess/utest/aclfile15 | 43
lib/libaccess/utest/aclfile16 | 43
lib/libaccess/utest/aclfile17 | 43
lib/libaccess/utest/aclfile18 | 51
lib/libaccess/utest/aclfile19 | 46
lib/libaccess/utest/aclfile2 | 43
lib/libaccess/utest/aclfile3 | 43
lib/libaccess/utest/aclfile4 | 43
lib/libaccess/utest/aclfile5 | 43
lib/libaccess/utest/aclfile6 | 55
lib/libaccess/utest/aclfile7 | 43
lib/libaccess/utest/aclfile8 | 43
lib/libaccess/utest/aclfile9 | 43
lib/libaccess/utest/aclgrp0 | 42
lib/libaccess/utest/aclgrp1 | 42
lib/libaccess/utest/aclgrp2 | 42
lib/libaccess/utest/aclgrp3 | 42
lib/libaccess/utest/aclgrp4 | 42
lib/libaccess/utest/acltest.cpp | 794
lib/libaccess/utest/onetest.cpp | 77
lib/libaccess/utest/shexp.cpp | 331
lib/libaccess/utest/shexp.h | 168
lib/libaccess/utest/test.ref | 217
lib/libaccess/utest/testmain.cpp | 89
lib/libaccess/utest/twotest.cpp | 87
lib/libaccess/utest/ustubs.cpp | 331
lib/libadmin/error.c | 2
lib/libadmin/template.c | 2
lib/libadmin/util.c | 48
lib/libsi18n/coreres.c | 141
lib/libsi18n/coreres.h | 52
lib/libsi18n/getlang.c | 330
lib/libsi18n/getstrmem.c | 160
lib/libsi18n/getstrmem.h | 1
lib/libsi18n/getstrprop.c | 85
lib/libsi18n/makstrdb.c | 21
lib/libsi18n/propset.c | 442
lib/libsi18n/propset.h | 80
lib/libsi18n/reshash.c | 21
ltmain.sh |13199 ++-
m4/db.m4 | 21
m4/fhs.m4 | 4
m4/icu.m4 | 25
m4/kerberos.m4 | 4
m4/mozldap.m4 | 38
m4/netsnmp.m4 | 15
m4/nspr.m4 | 17
m4/nss.m4 | 17
m4/openldap.m4 | 30
m4/pcre.m4 | 28
m4/sasl.m4 | 25
m4/selinux.m4 | 13
m4/svrcore.m4 | 41
man/man8/restart-dirsrv.8 | 50
man/man8/start-dirsrv.8 | 50
man/man8/stop-dirsrv.8 | 50
missing | 104
selinux/dirsrv.fc.in | 2
selinux/dirsrv.if | 41
selinux/dirsrv.te | 11
wrappers/cl-dump.in | 11
wrappers/dbscan.in | 10
wrappers/infadd.in | 12
wrappers/initscript.in | 243
wrappers/ldap-agent-initscript.in | 20
wrappers/ldap-agent.in | 12
wrappers/ldclt.in | 12
wrappers/ldif.in | 12
wrappers/migratecred.in | 14
wrappers/mmldif.in | 14
wrappers/pwdhash.in | 14
wrappers/repl-monitor.in | 11
wrappers/rsearch.in | 12
522 files changed, 67197 insertions(+), 58928 deletions(-)
---
12 years, 3 months
Branch '389-ds-base-1.2.9' - VERSION.sh
by Richard Allen Megginson
VERSION.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 801236c2a6bbeb771e4131146e487d0a49f2ab3a
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Sep 7 08:41:12 2011 -0600
bump version to 1.2.9.10
diff --git a/VERSION.sh b/VERSION.sh
index b224300..d839bc0 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -10,7 +10,7 @@ vendor="389 Project"
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=2
-VERSION_MAINT=9.9
+VERSION_MAINT=9.10
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
12 years, 3 months
Branch '389-ds-base-1.2.9' - ldap/servers
by Nathan Kinder
ldap/servers/plugins/mep/mep.c | 40 +++++++++++++++++++++++++-------
ldap/servers/slapd/plugin_internal_op.c | 17 +++++++++----
2 files changed, 44 insertions(+), 13 deletions(-)
New commits:
commit c8278808569a126b107b66b041486a4ab8700e38
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Sep 6 11:08:40 2011 -0700
Bug 735114 - renaming a managed entry does not update mepmanagedby
When a number of different plug-ins are being used that perform
internal operations to update entries, it is possible for the
managed entry plug-in to fail to update the managed entry. In
particular, it has been found that renaming an origin entry can
trigger a plug-in other than the managed entry plug-in to rename
the managed entry. This causes the managed entry plug-in to fail
when it attempts to update the managed entry.
This patch makes the managed entry plug-in check if the managed
entry has already been renamed when processing a MODRDN operation.
If it detects that the managed entry has already been renamed, it
will use the new DN to perform the managed entry updates.
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index 520a8c2..456cacf 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -2378,6 +2378,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
Slapi_Entry *new_managed_entry = NULL;
Slapi_DN *managed_sdn = NULL;
Slapi_Mods *smods = NULL;
+ int free_managed_dn = 1;
mep_config_read_lock();
@@ -2450,6 +2451,31 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
mods[0] = &mod;
mods[1] = 0;
+ /* Create a new managed entry to determine what changes
+ * we need to make to the existing managed entry. */
+ new_managed_entry = mep_create_managed_entry(config, post_e);
+ if (new_managed_entry == NULL) {
+ slapi_log_error(SLAPI_LOG_FATAL, MEP_PLUGIN_SUBSYSTEM,
+ "mep_modrdn_post_op: Unable to create in-memory "
+ "managed entry from origin entry \"%s\".\n", new_dn);
+ goto bailmod;
+ }
+
+ /* Check if the managed entry exists. It is possible that
+ * it has already been renamed by another plug-in. If it
+ * has already been renamed, we need to use the new DN to
+ * perform our updates. */
+ managed_sdn = slapi_sdn_new_dn_byref(managed_dn);
+
+ if (slapi_search_internal_get_entry(managed_sdn, 0,
+ NULL, mep_get_plugin_id()) == LDAP_NO_SUCH_OBJECT) {
+ slapi_ch_free_string(&managed_dn);
+ /* This DN is not a copy, so we don't want to free it later. */
+ managed_dn = slapi_entry_get_dn(new_managed_entry);
+ slapi_sdn_set_dn_byref(managed_sdn, managed_dn);
+ free_managed_dn = 0;
+ }
+
/* Perform the modify operation. */
slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM,
"mep_modrdn_post_op: Updating %s pointer to \"%s\" "
@@ -2465,12 +2491,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
"origin entry \"%s\" in managed entry \"%s\" "
"(%s).\n", new_dn, managed_dn, ldap_err2string(result));
} else {
- /* Create a new managed entry to determine what changes
- * we need to make to the existing managed entry. */
- new_managed_entry = mep_create_managed_entry(config, post_e);
-
/* See if we need to rename the managed entry. */
- managed_sdn = slapi_sdn_new_dn_byref(managed_dn);
if (slapi_sdn_compare(slapi_entry_get_sdn(new_managed_entry), managed_sdn) != 0) {
/* Rename the managed entry. */
slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM,
@@ -2510,14 +2531,17 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
slapi_mods_free(&smods);
}
- slapi_sdn_free(&managed_sdn);
- slapi_entry_free(new_managed_entry);
}
+bailmod:
+ slapi_entry_free(new_managed_entry);
+ slapi_sdn_free(&managed_sdn);
}
slapi_pblock_destroy(mep_pb);
- slapi_ch_free_string(&managed_dn);
+ if (free_managed_dn) {
+ slapi_ch_free_string(&managed_dn);
+ }
mep_config_unlock();
} else {
diff --git a/ldap/servers/slapd/plugin_internal_op.c b/ldap/servers/slapd/plugin_internal_op.c
index 76f70e8..75d4e4a 100644
--- a/ldap/servers/slapd/plugin_internal_op.c
+++ b/ldap/servers/slapd/plugin_internal_op.c
@@ -872,7 +872,8 @@ void set_common_params (Slapi_PBlock *pb)
/*
* Given a DN, find an entry by doing an internal search. An LDAP error
- * code is returned.
+ * code is returned. To check if an entry exists without returning a
+ * copy of the entry, NULL can be passed for ret_entry.
*/
int
slapi_search_internal_get_entry( Slapi_DN *dn, char ** attrs, Slapi_Entry **ret_entry , void * component_identity)
@@ -881,7 +882,10 @@ slapi_search_internal_get_entry( Slapi_DN *dn, char ** attrs, Slapi_Entry **ret_
Slapi_PBlock *int_search_pb = NULL;
int rc = 0;
- *ret_entry = NULL;
+ if (ret_entry) {
+ *ret_entry = NULL;
+ }
+
int_search_pb = slapi_pblock_new ();
slapi_search_internal_set_pb ( int_search_pb, slapi_sdn_get_dn(dn), LDAP_SCOPE_BASE, "(|(objectclass=*)(objectclass=ldapsubentry))",
attrs ,
@@ -893,9 +897,12 @@ slapi_search_internal_get_entry( Slapi_DN *dn, char ** attrs, Slapi_Entry **ret_
if ( LDAP_SUCCESS == rc ) {
slapi_pblock_get( int_search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries );
if ( NULL != entries && NULL != entries[ 0 ]) {
- Slapi_Entry *temp_entry = NULL;
- temp_entry = entries[ 0 ];
- *ret_entry = slapi_entry_dup(temp_entry);
+ /* Only need to dup the entry if the caller passed ret_entry in. */
+ if (ret_entry) {
+ Slapi_Entry *temp_entry = NULL;
+ temp_entry = entries[ 0 ];
+ *ret_entry = slapi_entry_dup(temp_entry);
+ }
} else {
/* No entry there */
rc = LDAP_NO_SUCH_OBJECT;
12 years, 3 months