dirsrvtests/tickets
by thierry bordaz
dirsrvtests/tickets/ticket47490_test.py | 42 ++++++++++++++---------------
dirsrvtests/tickets/ticket47560_test.py | 12 ++++----
dirsrvtests/tickets/ticket47573_test.py | 16 +++++------
dirsrvtests/tickets/ticket47653MMR_test.py | 2 -
dirsrvtests/tickets/ticket47653_test.py | 2 -
dirsrvtests/tickets/ticket47676_test.py | 4 +-
6 files changed, 39 insertions(+), 39 deletions(-)
New commits:
commit 5b8dfcd1b37e66739ed18a8aeaf494c1969bf574
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Tue Feb 11 17:51:09 2014 +0100
Update test cases due to new modules: Schema, tasks, plugins and index
Reviewed by Rich Megginson (thanks Rich)
diff --git a/dirsrvtests/tickets/ticket47490_test.py b/dirsrvtests/tickets/ticket47490_test.py
index 58490d0..438723a 100644
--- a/dirsrvtests/tickets/ticket47490_test.py
+++ b/dirsrvtests/tickets/ticket47490_test.py
@@ -77,13 +77,13 @@ def _oc_definition(oid_ext, name, must=None, may=None):
def add_OC(instance, oid_ext, name):
new_oc = _oc_definition(oid_ext, name)
- instance.addSchema('objectClasses', new_oc)
+ instance.schema.add_schema('objectClasses', new_oc)
def mod_OC(instance, oid_ext, name, old_must=None, old_may=None, new_must=None, new_may=None):
old_oc = _oc_definition(oid_ext, name, old_must, old_may)
new_oc = _oc_definition(oid_ext, name, new_must, new_may)
- instance.delSchema('objectClasses', old_oc)
- instance.addSchema('objectClasses', new_oc)
+ instance.schema.del_schema('objectClasses', old_oc)
+ instance.schema.add_schema('objectClasses', new_oc)
def trigger_schema_push(topology):
"""
@@ -316,8 +316,8 @@ def test_ticket47490_one(topology):
add_OC(topology.master, 2, 'masterNewOCA')
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was updated on the consumer
log.debug("test_ticket47490_one master_schema_csn=%s", master_schema_csn)
@@ -353,8 +353,8 @@ def test_ticket47490_two(topology):
# now push the scheam
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was NOT updated on the consumer
log.debug("test_ticket47490_two master_schema_csn=%s", master_schema_csn)
@@ -387,8 +387,8 @@ def test_ticket47490_three(topology):
# now push the scheam
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was NOT updated on the consumer
log.debug("test_ticket47490_three master_schema_csn=%s", master_schema_csn)
@@ -420,8 +420,8 @@ def test_ticket47490_four(topology):
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was updated on the consumer
log.debug("test_ticket47490_four master_schema_csn=%s", master_schema_csn)
@@ -462,8 +462,8 @@ def test_ticket47490_five(topology):
add_OC(topology.master, 4, 'masterNewOCC')
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was NOT updated on the consumer
log.debug("test_ticket47490_five master_schema_csn=%s", master_schema_csn)
@@ -508,8 +508,8 @@ def test_ticket47490_six(topology):
mod_OC(topology.master, 1, 'consumerNewOCA', old_must=MUST_OLD, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_OLD)
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was NOT updated on the consumer
log.debug("test_ticket47490_six master_schema_csn=%s", master_schema_csn)
@@ -547,8 +547,8 @@ def test_ticket47490_seven(topology):
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was updated on the consumer
log.debug("test_ticket47490_seven master_schema_csn=%s", master_schema_csn)
@@ -589,8 +589,8 @@ def test_ticket47490_eight(topology):
mod_OC(topology.master, 4, 'masterNewOCC', old_must=MUST_OLD, new_must=MUST_OLD, old_may=MAY_OLD, new_may=MAY_NEW)
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was not updated on the consumer
log.debug("test_ticket47490_eight master_schema_csn=%s", master_schema_csn)
@@ -635,8 +635,8 @@ def test_ticket47490_nine(topology):
mod_OC(topology.master, 1, 'consumerNewOCA', old_must=MUST_NEW, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_NEW)
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was updated on the consumer
log.debug("test_ticket47490_nine master_schema_csn=%s", master_schema_csn)
diff --git a/dirsrvtests/tickets/ticket47560_test.py b/dirsrvtests/tickets/ticket47560_test.py
index c11233c..67d83e8 100644
--- a/dirsrvtests/tickets/ticket47560_test.py
+++ b/dirsrvtests/tickets/ticket47560_test.py
@@ -144,11 +144,12 @@ def test_ticket47560(topology):
"""
# enable/disable the mbo plugin
if value != 'on':
- value = 'off'
+ topology.standalone.plugins.enable(name=PLUGIN_MEMBER_OF)
+ else:
+ topology.standalone.plugins.disable(name=PLUGIN_MEMBER_OF)
+
log.debug("-------------> _enable_disable_mbo(%s)" % value)
- MEMBEROF_PLUGIN_DN = 'cn=MemberOf Plugin,cn=plugins,cn=config'
- replace = [(ldap.MOD_REPLACE, 'nsslapd-pluginEnabled', value)]
- topology.standalone.modify_s(MEMBEROF_PLUGIN_DN, replace)
+
topology.standalone.stop(timeout=120)
time.sleep(1)
topology.standalone.start(timeout=120)
@@ -258,7 +259,7 @@ def test_ticket47560(topology):
log.debug( "Unfixed entry %r\n" % ent)
# run the fixup task
- topology.standalone.fixupMemberOf(SUFFIX, verbose=False)
+ topology.standalone.tasks.fixupMemberOf(suffix=SUFFIX, args={TASK_WAIT: True})
ents = topology.standalone.search_s(member_DN, ldap.SCOPE_BASE, filt)
assert len(ents) == 1
@@ -298,7 +299,6 @@ def run_isolated():
test_ticket47560(topo)
test_ticket47560_final(topo)
-
if __name__ == '__main__':
run_isolated()
diff --git a/dirsrvtests/tickets/ticket47573_test.py b/dirsrvtests/tickets/ticket47573_test.py
index 565d521..a85fc10 100644
--- a/dirsrvtests/tickets/ticket47573_test.py
+++ b/dirsrvtests/tickets/ticket47573_test.py
@@ -78,13 +78,13 @@ def _oc_definition(oid_ext, name, must=None, may=None):
def add_OC(instance, oid_ext, name):
new_oc = _oc_definition(oid_ext, name)
- instance.addSchema('objectClasses', new_oc)
+ instance.schema.add_schema('objectClasses', new_oc)
def mod_OC(instance, oid_ext, name, old_must=None, old_may=None, new_must=None, new_may=None):
old_oc = _oc_definition(oid_ext, name, old_must, old_may)
new_oc = _oc_definition(oid_ext, name, new_must, new_may)
- instance.delSchema('objectClasses', old_oc)
- instance.addSchema('objectClasses', new_oc)
+ instance.schema.del_schema('objectClasses', old_oc)
+ instance.schema.add_schema('objectClasses', new_oc)
def trigger_schema_push(topology):
"""
@@ -314,12 +314,12 @@ def test_ticket47573_one(topology):
new_oc = _oc_definition(2, 'OCwithMayAttr',
must = MUST_OLD,
may = MAY_OLD)
- topology.master.addSchema('objectClasses', new_oc)
+ topology.master.schema.add_schema('objectClasses', new_oc)
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was updated on the consumer
log.debug("test_ticket47573_one master_schema_csn=%s", master_schema_csn)
@@ -348,8 +348,8 @@ def test_ticket47573_two(topology):
# now push the scheam
trigger_schema_push(topology)
- master_schema_csn = topology.master.getSchemaCSN()
- consumer_schema_csn = topology.consumer.getSchemaCSN()
+ master_schema_csn = topology.master.schema.get_schema_csn()
+ consumer_schema_csn = topology.consumer.schema.get_schema_csn()
# Check the schemaCSN was NOT updated on the consumer
log.debug("test_ticket47573_two master_schema_csn=%s", master_schema_csn)
diff --git a/dirsrvtests/tickets/ticket47653MMR_test.py b/dirsrvtests/tickets/ticket47653MMR_test.py
index 1f221c6..5d86888 100644
--- a/dirsrvtests/tickets/ticket47653MMR_test.py
+++ b/dirsrvtests/tickets/ticket47653MMR_test.py
@@ -258,7 +258,7 @@ def test_ticket47653_init(topology):
topology.master1.log.info("Add %s that allows 'member' attribute" % OC_NAME)
new_oc = _oc_definition(2, OC_NAME, must = MUST, may = MAY)
- topology.master1.addSchema('objectClasses', new_oc)
+ topology.master1.schema.add_schema('objectClasses', new_oc)
# entry used to bind with
diff --git a/dirsrvtests/tickets/ticket47653_test.py b/dirsrvtests/tickets/ticket47653_test.py
index 2693093..9f4e757 100644
--- a/dirsrvtests/tickets/ticket47653_test.py
+++ b/dirsrvtests/tickets/ticket47653_test.py
@@ -155,7 +155,7 @@ def test_ticket47653_init(topology):
topology.standalone.log.info("Add %s that allows 'member' attribute" % OC_NAME)
new_oc = _oc_definition(2, OC_NAME, must = MUST, may = MAY)
- topology.standalone.addSchema('objectClasses', new_oc)
+ topology.standalone.schema.add_schema('objectClasses', new_oc)
# entry used to bind with
diff --git a/dirsrvtests/tickets/ticket47676_test.py b/dirsrvtests/tickets/ticket47676_test.py
index 8ba5956..1d7f0b1 100644
--- a/dirsrvtests/tickets/ticket47676_test.py
+++ b/dirsrvtests/tickets/ticket47676_test.py
@@ -270,7 +270,7 @@ def test_ticket47676_init(topology):
topology.master1.log.info("Add %s that allows 'member' attribute" % OC_NAME)
new_oc = _oc_definition(OC_OID_EXT, OC_NAME, must = MUST, may = MAY)
- topology.master1.addSchema('objectClasses', new_oc)
+ topology.master1.schema.add_schema('objectClasses', new_oc)
# entry used to bind with
@@ -372,7 +372,7 @@ def test_ticket47676_reject_action(topology):
# Add a new OC on M1 so that schema CSN will change and M1 will try to push the schema
topology.master1.log.info("Add %s on M1" % OC2_NAME)
new_oc = _oc_definition(OC2_OID_EXT, OC2_NAME, must = MUST, may = MAY)
- topology.master1.addSchema('objectClasses', new_oc)
+ topology.master1.schema.add_schema('objectClasses', new_oc)
# Safety checking that the schema has been updated on M1
topology.master1.log.info("Check %s is in M1" % OC2_NAME)
10 years, 2 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/entry.c | 14 ++++++++++++--
ldap/servers/slapd/slapi-plugin.h | 21 +++++++++++++++++++--
2 files changed, 31 insertions(+), 4 deletions(-)
New commits:
commit 57af5622333165360d9e2b5764a8375e4c2ccb7f
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Feb 11 10:28:46 2014 -0800
Ticket #47608 - change slapi_entry_attr_get_bool to handle "on"/"off" values, support default value
Description: Adding an API slapi_entry_attr_get_bool_ext, which is an
extension of slapi_entry_attr_get_bool. The difference is slapi_
entry_attr_get_bool_ext returns the given default value if the type
is not found in the entry.
https://fedorahosted.org/389/ticket/47608
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 3de05ad..9dc94b3 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -2973,9 +2973,9 @@ slapi_entry_attr_get_ulonglong( const Slapi_Entry* e, const char *type)
/* returned value: attribute value as a boolean type */
PRBool
-slapi_entry_attr_get_bool( const Slapi_Entry* e, const char *type)
+slapi_entry_attr_get_bool_ext(const Slapi_Entry* e, const char *type, PRBool default_value)
{
- PRBool r = PR_FALSE; /* default if no attr */
+ PRBool r = default_value; /* default if no attr */
Slapi_Attr* attr = NULL;
if ((0 == slapi_entry_attr_find(e, type, &attr)) && attr) {
Slapi_Value *v;
@@ -2997,6 +2997,10 @@ slapi_entry_attr_get_bool( const Slapi_Entry* e, const char *type)
r = PR_TRUE;
} else if (!PL_strncasecmp(bvp->bv_val, "no", bvp->bv_len)) {
r = PR_FALSE;
+ } else if (!PL_strncmp(bvp->bv_val, "1", bvp->bv_len)) {
+ r = PR_TRUE;
+ } else if (!PL_strncmp(bvp->bv_val, "0", bvp->bv_len)) {
+ r = PR_FALSE;
} else { /* assume numeric: 0 - false: non-zero - true */
r = (PRBool)slapi_value_get_ulong(v);
}
@@ -3004,6 +3008,12 @@ slapi_entry_attr_get_bool( const Slapi_Entry* e, const char *type)
return r;
}
+PRBool
+slapi_entry_attr_get_bool(const Slapi_Entry* e, const char *type)
+{
+ return slapi_entry_attr_get_bool_ext(e, type, PR_FALSE);
+}
+
void
slapi_entry_attr_set_charptr( Slapi_Entry* e, const char *type, const char *value)
{
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index a4682b5..2f24251 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -1872,14 +1872,31 @@ unsigned long long slapi_entry_attr_get_ulonglong( const Slapi_Entry* e, const c
*
* Comparisons are case-insensitive (\c TRUE, \c trUe, and \c true are all the
* same), and unique substrings can be matched (\c t and \c tr will be interpreted
- * as \c true). If the attribute value is a number, then non-zero numbers are
+ * as \c true). In addition, \c on, \c off, \c yes, \c no are supported.
+ * If the attribute value is a number, then non-zero numbers are
* interpreted as \c true, and \c 0 is interpreted as \c false.
*
* \param e Entry from which you want to get the boolean value.
* \param type Attribute type from which you want to get the value.
* \return \c PR_TRUE | \c PR_FALSE
*/
-PRBool slapi_entry_attr_get_bool( const Slapi_Entry* e, const char *type);
+PRBool slapi_entry_attr_get_bool(const Slapi_Entry* e, const char *type);
+
+/**
+ * Gets the value of a given attribute of a given entry as a boolean value.
+ *
+ * Comparisons are case-insensitive (\c TRUE, \c trUe, and \c true are all the
+ * same), and unique substrings can be matched (\c t and \c tr will be interpreted
+ * as \c true). In addition, \c on, \c off, \c yes, \c no are supported.
+ * If the attribute value is a number, then non-zero numbers are
+ * interpreted as \c true, and \c 0 is interpreted as \c false.
+ * If the attribute type is not found in the entry, the given default value is returned.
+ *
+ * \param e Entry from which you want to get the boolean value.
+ * \param type Attribute type from which you want to get the value.
+ * \return \c PR_TRUE | \c PR_FALSE
+ */
+PRBool slapi_entry_attr_get_bool_ext(const Slapi_Entry* e, const char *type, PRBool default_value);
/**
* Replaces the value or values of an attribute in an entry with a specified string
10 years, 2 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit a4a46424d59a189552c1d17eed1d52218f3a95b8
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Feb 7 16:02:37 2014 -0700
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: 389-ds-base-1.3.1
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 59941ea23b6f288617ba1e6ce58238fa59266c9f)
(cherry picked from commit 01a112121e80505021d0a18afa899b5c46180797)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 248a41f..ba844c6 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1194,6 +1194,34 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
entry_deleted_value_to_zapped_value(a,pending_value);
pending_value = NULL;
}
+ else if (current_value && pending_value && !new_value && adcsn &&
+ (attribute_state == ATTRIBUTE_DELETED) &&
+ current_value_vucsn && !pending_value_vucsn && pending_value_vdcsn &&
+ (csn_compare(current_value_vucsn, pending_value_vdcsn) > 0) &&
+ (csn_compare(adcsn, pending_value_vdcsn) == 0))
+ {
+ /* in the case of the following:
+ * beginning attr state is a deleted value
+ * incoming operation is
+ * add: newvalue
+ * attribute_state is ATTRIBUTE_DELETED
+ * so we have both a current_value and a pending_value
+ * new_value is NULL
+ * current_value_vucsn is CSN1
+ * pending_value_vucsn is NULL
+ * pending_value_vdcsn is CSN2
+ * adcsn is CSN2 == pending_value_vdcsn
+ * CSN1 > CSN2
+ * since the pending_value is deleted, and the current_value has
+ * a greater CSN, we should keep the current_value and zap
+ * the pending_value
+ */
+ /* just remove the deleted value */
+ entry_deleted_value_to_zapped_value(a,pending_value);
+ pending_value = NULL;
+ attr_set_deletion_csn(a,NULL);
+ return; /* we are done - we are keeping the present value */
+ }
else if(new_value==NULL)
{
/* check if the pending value should become the current value */
10 years, 2 months
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit 59941ea23b6f288617ba1e6ce58238fa59266c9f
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Feb 7 16:02:37 2014 -0700
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: master
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index f4f6481..7a25489 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1378,6 +1378,34 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
entry_deleted_value_to_zapped_value(a,pending_value);
pending_value = NULL;
}
+ else if (current_value && pending_value && !new_value && adcsn &&
+ (attribute_state == ATTRIBUTE_DELETED) &&
+ current_value_vucsn && !pending_value_vucsn && pending_value_vdcsn &&
+ (csn_compare(current_value_vucsn, pending_value_vdcsn) > 0) &&
+ (csn_compare(adcsn, pending_value_vdcsn) == 0))
+ {
+ /* in the case of the following:
+ * beginning attr state is a deleted value
+ * incoming operation is
+ * add: newvalue
+ * attribute_state is ATTRIBUTE_DELETED
+ * so we have both a current_value and a pending_value
+ * new_value is NULL
+ * current_value_vucsn is CSN1
+ * pending_value_vucsn is NULL
+ * pending_value_vdcsn is CSN2
+ * adcsn is CSN2 == pending_value_vdcsn
+ * CSN1 > CSN2
+ * since the pending_value is deleted, and the current_value has
+ * a greater CSN, we should keep the current_value and zap
+ * the pending_value
+ */
+ /* just remove the deleted value */
+ entry_deleted_value_to_zapped_value(a,pending_value);
+ pending_value = NULL;
+ attr_set_deletion_csn(a,NULL);
+ return; /* we are done - we are keeping the present value */
+ }
else if(new_value==NULL)
{
/* check if the pending value should become the current value */
10 years, 2 months
Branch '389-ds-base-1.3.0' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit dad08c10826896dc4e8772ec400d60e3eb0ebbb6
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Feb 7 16:02:37 2014 -0700
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 59941ea23b6f288617ba1e6ce58238fa59266c9f)
(cherry picked from commit 01a112121e80505021d0a18afa899b5c46180797)
(cherry picked from commit a4a46424d59a189552c1d17eed1d52218f3a95b8)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 946bf0a..6a4ec79 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1193,6 +1193,34 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
entry_deleted_value_to_zapped_value(a,pending_value);
pending_value = NULL;
}
+ else if (current_value && pending_value && !new_value && adcsn &&
+ (attribute_state == ATTRIBUTE_DELETED) &&
+ current_value_vucsn && !pending_value_vucsn && pending_value_vdcsn &&
+ (csn_compare(current_value_vucsn, pending_value_vdcsn) > 0) &&
+ (csn_compare(adcsn, pending_value_vdcsn) == 0))
+ {
+ /* in the case of the following:
+ * beginning attr state is a deleted value
+ * incoming operation is
+ * add: newvalue
+ * attribute_state is ATTRIBUTE_DELETED
+ * so we have both a current_value and a pending_value
+ * new_value is NULL
+ * current_value_vucsn is CSN1
+ * pending_value_vucsn is NULL
+ * pending_value_vdcsn is CSN2
+ * adcsn is CSN2 == pending_value_vdcsn
+ * CSN1 > CSN2
+ * since the pending_value is deleted, and the current_value has
+ * a greater CSN, we should keep the current_value and zap
+ * the pending_value
+ */
+ /* just remove the deleted value */
+ entry_deleted_value_to_zapped_value(a,pending_value);
+ pending_value = NULL;
+ attr_set_deletion_csn(a,NULL);
+ return; /* we are done - we are keeping the present value */
+ }
else if(new_value==NULL)
{
/* check if the pending value should become the current value */
10 years, 2 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit 01a112121e80505021d0a18afa899b5c46180797
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Feb 7 16:02:37 2014 -0700
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: 389-ds-base-1.3.2
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 59941ea23b6f288617ba1e6ce58238fa59266c9f)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index f4f6481..7a25489 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1378,6 +1378,34 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
entry_deleted_value_to_zapped_value(a,pending_value);
pending_value = NULL;
}
+ else if (current_value && pending_value && !new_value && adcsn &&
+ (attribute_state == ATTRIBUTE_DELETED) &&
+ current_value_vucsn && !pending_value_vucsn && pending_value_vdcsn &&
+ (csn_compare(current_value_vucsn, pending_value_vdcsn) > 0) &&
+ (csn_compare(adcsn, pending_value_vdcsn) == 0))
+ {
+ /* in the case of the following:
+ * beginning attr state is a deleted value
+ * incoming operation is
+ * add: newvalue
+ * attribute_state is ATTRIBUTE_DELETED
+ * so we have both a current_value and a pending_value
+ * new_value is NULL
+ * current_value_vucsn is CSN1
+ * pending_value_vucsn is NULL
+ * pending_value_vdcsn is CSN2
+ * adcsn is CSN2 == pending_value_vdcsn
+ * CSN1 > CSN2
+ * since the pending_value is deleted, and the current_value has
+ * a greater CSN, we should keep the current_value and zap
+ * the pending_value
+ */
+ /* just remove the deleted value */
+ entry_deleted_value_to_zapped_value(a,pending_value);
+ pending_value = NULL;
+ attr_set_deletion_csn(a,NULL);
+ return; /* we are done - we are keeping the present value */
+ }
else if(new_value==NULL)
{
/* check if the pending value should become the current value */
10 years, 2 months
Branch '389-ds-base-1.2.11' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/entrywsi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit 86fb13764f4dda2efc8b869377b2e90314466362
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Feb 7 16:02:37 2014 -0700
Ticket #47692 single valued attribute replicated ADD does not work
https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: 389-ds-base-1.2.11
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 59941ea23b6f288617ba1e6ce58238fa59266c9f)
(cherry picked from commit 01a112121e80505021d0a18afa899b5c46180797)
(cherry picked from commit a4a46424d59a189552c1d17eed1d52218f3a95b8)
(cherry picked from commit dad08c10826896dc4e8772ec400d60e3eb0ebbb6)
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 6c37f45..cca615d 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -1148,6 +1148,34 @@ resolve_attribute_state_single_valued(Slapi_Entry *e, Slapi_Attr *a, int attribu
entry_deleted_value_to_zapped_value(a,pending_value);
pending_value = NULL;
}
+ else if (current_value && pending_value && !new_value && adcsn &&
+ (attribute_state == ATTRIBUTE_DELETED) &&
+ current_value_vucsn && !pending_value_vucsn && pending_value_vdcsn &&
+ (csn_compare(current_value_vucsn, pending_value_vdcsn) > 0) &&
+ (csn_compare(adcsn, pending_value_vdcsn) == 0))
+ {
+ /* in the case of the following:
+ * beginning attr state is a deleted value
+ * incoming operation is
+ * add: newvalue
+ * attribute_state is ATTRIBUTE_DELETED
+ * so we have both a current_value and a pending_value
+ * new_value is NULL
+ * current_value_vucsn is CSN1
+ * pending_value_vucsn is NULL
+ * pending_value_vdcsn is CSN2
+ * adcsn is CSN2 == pending_value_vdcsn
+ * CSN1 > CSN2
+ * since the pending_value is deleted, and the current_value has
+ * a greater CSN, we should keep the current_value and zap
+ * the pending_value
+ */
+ /* just remove the deleted value */
+ entry_deleted_value_to_zapped_value(a,pending_value);
+ pending_value = NULL;
+ attr_set_deletion_csn(a,NULL);
+ return; /* we are done - we are keeping the present value */
+ }
else if(new_value==NULL)
{
/* check if the pending value should become the current value */
10 years, 2 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 ++
ldap/servers/slapd/back-ldbm/dblayer.c | 6 ++++++
2 files changed, 8 insertions(+)
New commits:
commit 901dc5e9539ba47eeced5bf68bb9ff59d0b5f02b
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Feb 10 16:49:42 2014 -0500
Ticket 47615 - Failed to compile the DS 389 1.3.2.3 version against Berkeley DB 4.2 version
Bug Description: libdb 4.2 does not support the db->compact feature, which causes
build failures. The compact feature was only added to libdb 4.4
Fix Description: Use preprocessor commands to ioslate the compact code.
https://fedorahosted.org/389/ticket/47615
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 80e39bce5c2d3649694bfce04822868c7256e022)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 980296e..85727f9 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -3517,6 +3517,7 @@ static void _cl5DoTrimming (ReplicaId rid)
static void
_cl5CompactDBs()
{
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
int rc;
Object *fileObj = NULL;
CL5DBFile *dbFile = NULL;
@@ -3573,6 +3574,7 @@ bail:
}
PR_Unlock (s_cl5Desc.dbTrim.lock);
+#endif
return;
}
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 3b4a536..6582c7a 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -4668,7 +4668,9 @@ static int checkpoint_threadmain(void *param)
char **list = NULL;
char **listp = NULL;
struct dblayer_private_env *penv = NULL;
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
time_t time_of_last_comapctdb_completion = current_time(); /* seconds since epoch */
+#endif
int compactdb_interval = 0;
back_txn txn;
@@ -4779,6 +4781,8 @@ static int checkpoint_threadmain(void *param)
}
/* find out which log files don't contain active txns */
DB_CHECKPOINT_LOCK(PR_TRUE, penv->dblayer_env_lock);
+
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
/* Compacting DB borrowing the timing of the log flush */
if ((compactdb_interval > 0) &&
(current_time() - time_of_last_comapctdb_completion > compactdb_interval)) {
@@ -4822,6 +4826,8 @@ static int checkpoint_threadmain(void *param)
time_of_last_comapctdb_completion = current_time(); /* seconds since epoch */
compactdb_interval = priv->dblayer_compactdb_interval;
}
+#endif
+
rval = LOG_ARCHIVE(penv->dblayer_DB_ENV, &list,
DB_ARCH_ABS, (void *)slapi_ch_malloc);
DB_CHECKPOINT_UNLOCK(PR_TRUE, penv->dblayer_env_lock);
10 years, 2 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 ++
ldap/servers/slapd/back-ldbm/dblayer.c | 6 ++++++
2 files changed, 8 insertions(+)
New commits:
commit 80e39bce5c2d3649694bfce04822868c7256e022
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Feb 10 16:49:42 2014 -0500
Ticket 47615 - Failed to compile the DS 389 1.3.2.3 version against Berkeley DB 4.2 version
Bug Description: libdb 4.2 does not support the db->compact feature, which causes
build failures. The compact feature was only added to libdb 4.4
Fix Description: Use preprocessor commands to ioslate the compact code.
https://fedorahosted.org/389/ticket/47615
Reviewed by: rmeggins(Thanks!)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 980296e..85727f9 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -3517,6 +3517,7 @@ static void _cl5DoTrimming (ReplicaId rid)
static void
_cl5CompactDBs()
{
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
int rc;
Object *fileObj = NULL;
CL5DBFile *dbFile = NULL;
@@ -3573,6 +3574,7 @@ bail:
}
PR_Unlock (s_cl5Desc.dbTrim.lock);
+#endif
return;
}
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 9fae72b..cb0509f 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -4672,7 +4672,9 @@ static int checkpoint_threadmain(void *param)
char **list = NULL;
char **listp = NULL;
struct dblayer_private_env *penv = NULL;
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
time_t time_of_last_comapctdb_completion = current_time(); /* seconds since epoch */
+#endif
int compactdb_interval = 0;
back_txn txn;
@@ -4783,6 +4785,8 @@ static int checkpoint_threadmain(void *param)
}
/* find out which log files don't contain active txns */
DB_CHECKPOINT_LOCK(PR_TRUE, penv->dblayer_env_lock);
+
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
/* Compacting DB borrowing the timing of the log flush */
if ((compactdb_interval > 0) &&
(current_time() - time_of_last_comapctdb_completion > compactdb_interval)) {
@@ -4826,6 +4830,8 @@ static int checkpoint_threadmain(void *param)
time_of_last_comapctdb_completion = current_time(); /* seconds since epoch */
compactdb_interval = priv->dblayer_compactdb_interval;
}
+#endif
+
rval = LOG_ARCHIVE(penv->dblayer_DB_ENV, &list,
DB_ARCH_ABS, (void *)slapi_ch_malloc);
DB_CHECKPOINT_UNLOCK(PR_TRUE, penv->dblayer_env_lock);
10 years, 2 months
Branch '389-ds-base-1.2.11' - 2 commits - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/dn.c | 10 +++++++---
ldap/servers/slapd/entry.c | 31 ++++++++-----------------------
ldap/servers/slapd/libglobs.c | 12 ++++++------
ldap/servers/slapd/valueset.c | 11 +++++------
4 files changed, 26 insertions(+), 38 deletions(-)
New commits:
commit 346d36664fb84f16207dd900849931f9eab3622d
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Feb 10 17:58:20 2014 -0800
Ticket #47677 - Size returned by slapi_entry_size is not accurate
Description: slapi_entry_size calculating the entry size had issues.
. To calculate the Slapi_DN size, local function slapi_dn_size was used.
Local slapi_dn_size missed to count the raw dn length. This patch
replaces slapi_dn_size with (slapi_sdn_get_size - sizeof(Slapi_DN)).
. slapi_entry_size counted Slapi_RDN twice.
. slapi_entry_size did not count the size of e_virtual_lock, e_aux_attrs
and e_extension.
https://fedorahosted.org/389/ticket/47677
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit b1e4cdf5131a1730c9d3674b19d0e2a0670286e7)
(cherry picked from commit 7b0842923c54333bc14539d72e999cbe30814386)
(cherry picked from commit baa3df4e846526f520d3d3533e2611045c243771)
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index 0f20d16..804d56e 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -2603,18 +2603,22 @@ sdn_dump( const Slapi_DN *sdn, const char *text)
size_t
slapi_sdn_get_size(const Slapi_DN *sdn)
{
- size_t sz = sizeof(Slapi_DN);
+ size_t sz = 0;
/* slapi_sdn_get_ndn_len returns the normalized dn length
* if dn or ndn exists. If both does not exist, it
* normalizes udn and set it to dn and returns the length.
*/
- sz += slapi_sdn_get_ndn_len(sdn);
+ if (NULL == sdn) {
+ return sz;
+ }
+ sz += slapi_sdn_get_ndn_len(sdn) + 1 /* '\0' */;
if (sdn->dn && sdn->ndn) {
- sz += slapi_sdn_get_ndn_len(sdn);
+ sz *= 2;
}
if (sdn->udn) {
sz += strlen(sdn->udn) + 1;
}
+ sz += sizeof(Slapi_DN);
return sz;
}
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index d47e0f6..29fe075 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -2040,40 +2040,25 @@ static size_t slapi_attrlist_size(Slapi_Attr *attrs)
return size;
}
-static size_t slapi_dn_size(Slapi_DN *sdn)
-{
- size_t size = 0;
-
- if (sdn == NULL) return 0;
-
- if (slapi_sdn_get_dn(sdn)) {
- size += slapi_sdn_get_ndn_len(sdn) + 1;
- }
- if (slapi_sdn_get_ndn(sdn)) {
- size += slapi_sdn_get_ndn_len(sdn) + 1;
- }
-
- return size;
-}
-
/* return the approximate size of an entry --
* useful for checking cache sizes, etc
*/
size_t
slapi_entry_size(Slapi_Entry *e)
{
- u_long size = 0;
-
- /* doesn't include memory used by e_extension */
+ size_t size = 0;
if (e->e_uniqueid) size += strlen(e->e_uniqueid) + 1;
if (e->e_dncsnset) size += csnset_size(e->e_dncsnset);
if (e->e_maxcsn) size += sizeof( CSN );
- size += slapi_dn_size(&e->e_sdn);
- size += slapi_rdn_get_size(&e->e_srdn);
+ if (e->e_virtual_lock) size += sizeof(Slapi_RWLock);
+ /* Slapi_DN and RDN are included in Slapi_Entry */
+ size += (slapi_sdn_get_size(&e->e_sdn) - sizeof(Slapi_DN));
+ size += (slapi_rdn_get_size(&e->e_srdn) - sizeof(Slapi_RDN));
size += slapi_attrlist_size(e->e_attrs);
- if (e->e_deleted_attrs) size += slapi_attrlist_size(e->e_deleted_attrs);
- if (e->e_virtual_attrs) size += slapi_attrlist_size(e->e_virtual_attrs);
+ size += slapi_attrlist_size(e->e_deleted_attrs);
+ size += slapi_attrlist_size(e->e_virtual_attrs);
+ size += slapi_attrlist_size(e->e_aux_attrs);
size += sizeof(Slapi_Entry);
return size;
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index f04acc3..de6914f 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -479,11 +479,11 @@ valuearray_size(Slapi_Value **va)
if(va!=NULL && va[0]!=NULL)
{
int i;
- for (i = 0; va[i]; i++)
+ for (i = 0; va[i]; i++)
{
s += value_size(va[i]);
}
- s += (i + 1) * sizeof(Slapi_Value*);
+ s += (i + 1) * sizeof(Slapi_Value*);
}
return s;
}
@@ -973,10 +973,9 @@ valueset_get_valuearray(const Slapi_ValueSet *vs)
size_t
valueset_size(const Slapi_ValueSet *vs)
{
- size_t s= 0;
- if(!valuearray_isempty(vs->va))
- {
- s= valuearray_size(vs->va);
+ size_t s = 0;
+ if (vs && !valuearray_isempty(vs->va)) {
+ s = valuearray_size(vs->va);
}
return s;
}
commit 98986b513ed0cf243fe43ce0e745828da680208f
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Feb 10 17:53:45 2014 -0800
Ticket #47693 - Environment variables are not passed when DS is started via service
Description:
The previous commit 57199b34c9cbe4a703e537633fbe6beab9a94e81
contained a cherry-pick error.
Replaced CFG_ONOFF_LOCK_WRITE with CFG_LOCK_WRITE, and
CFG_ONOFF_UNLOCK_WRITE with CFG_UNLOCK_WRITE
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 903d38b..8103133 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -6676,9 +6676,9 @@ config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int
value, CONFIG_MALLOC_MXFAST, max);
return LDAP_OPERATIONS_ERROR;
}
- CFG_ONOFF_LOCK_WRITE(slapdFrontendConfig);
+ CFG_LOCK_WRITE(slapdFrontendConfig);
slapdFrontendConfig->malloc_mxfast = mxfast;
- CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig);
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
if ((mxfast >= 0) && (mxfast <= max)) {
mallopt(M_MXFAST, mxfast);
@@ -6719,9 +6719,9 @@ config_set_malloc_trim_threshold(const char *attrname, char *value, char *errorb
return LDAP_OPERATIONS_ERROR;
}
- CFG_ONOFF_LOCK_WRITE(slapdFrontendConfig);
+ CFG_LOCK_WRITE(slapdFrontendConfig);
slapdFrontendConfig->malloc_trim_threshold = trim_threshold;
- CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig);
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
if (trim_threshold >= -1) {
mallopt(M_TRIM_THRESHOLD, trim_threshold);
@@ -6769,9 +6769,9 @@ config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorb
return LDAP_OPERATIONS_ERROR;
}
- CFG_ONOFF_LOCK_WRITE(slapdFrontendConfig);
+ CFG_LOCK_WRITE(slapdFrontendConfig);
slapdFrontendConfig->malloc_mmap_threshold = mmap_threshold;
- CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig);
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
if ((mmap_threshold >= 0) && (mmap_threshold <= max)) {
mallopt(M_MMAP_THRESHOLD, mmap_threshold);
10 years, 2 months