ldap/servers/plugins/sync/sync_persist.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
New commits:
commit fc8def62bb569197a27d083ee113b90606fb1fb8
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue May 27 15:27:17 2014 +0200
Ticket 47805 - syncrepl doesn't send notification when attribute in search filter changes
Bug Description: if an entry is modified so that it no longer matches
the search filter specified in teh sync repl
request a delete info should be sent
Fix Description: check pre and post entry for mods to determine if an entry
moves in or out of scope. Same logic as modrdn
https://fedorahosted.org/389/ticket/47805
Reviewed by: Mark, thanks
diff --git a/ldap/servers/plugins/sync/sync_persist.c b/ldap/servers/plugins/sync/sync_persist.c
index 4216a87..4fb4574 100644
--- a/ldap/servers/plugins/sync/sync_persist.c
+++ b/ldap/servers/plugins/sync/sync_persist.c
@@ -97,14 +97,15 @@ int sync_del_persist_post_op(Slapi_PBlock *pb)
int sync_mod_persist_post_op(Slapi_PBlock *pb)
{
- Slapi_Entry *e;
+ Slapi_Entry *e, *e_prev;
if ( !SYNC_IS_INITIALIZED()) {
return(0);
}
slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &e);
- sync_queue_change(e, NULL, LDAP_REQ_MODIFY);
+ slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &e_prev);
+ sync_queue_change(e, e_prev, LDAP_REQ_MODIFY);
return( 0 );
}
@@ -180,7 +181,7 @@ sync_queue_change( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype )
/* if the change is a modrdn then we need to check if the entry was
* moved into scope, out of scope, or stays in scope
*/
- if (chgtype == LDAP_REQ_MODRDN)
+ if (chgtype == LDAP_REQ_MODRDN || chgtype == LDAP_REQ_MODIFY)
prev_match = slapi_sdn_scope_test( slapi_entry_get_sdn_const(eprev), base, scope ) &&
( 0 == slapi_vattr_filter_test( req->req_pblock, eprev, req->req_filter, 0 /* verify_access */ ));
@@ -194,9 +195,8 @@ sync_queue_change( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype )
matched++;
node = (SyncQueueNode *)slapi_ch_calloc( 1, sizeof( SyncQueueNode ));
- node->sync_entry = slapi_entry_dup( e );
- if ( chgtype == LDAP_REQ_MODRDN) {
+ if ( chgtype == LDAP_REQ_MODRDN || chgtype == LDAP_REQ_MODIFY) {
if (prev_match && cur_match)
node->sync_chgtype = LDAP_REQ_MODIFY;
else if (prev_match)
@@ -206,6 +206,12 @@ sync_queue_change( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype )
} else {
node->sync_chgtype = chgtype;
}
+ if (node->sync_chgtype == LDAP_REQ_DELETE && chgtype == LDAP_REQ_MODIFY ) {
+ /* use previous entry to pass the filter test in sync_send_results */
+ node->sync_entry = slapi_entry_dup( eprev );
+ } else {
+ node->sync_entry = slapi_entry_dup( e );
+ }
/* Put it on the end of the list for this sync search */
PR_Lock( req->req_lock );
pOldtail = req->ps_eq_tail;
VERSION.sh | 2 +-
ldap/servers/slapd/attr.c | 4 ++--
ldap/servers/slapd/entrywsi.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 27f2fab636b852d8245edd1804d5a5aa0281fa75
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue May 27 14:14:15 2014 +0200
Ticket 47806 - Failed deletion of aci: no such attribute
Bug Description: an aci can be retrieved by doing an ldapsearch,
but the attemt to delete this specific aci
fails with err=16
Fix Description: the root cause for this problem is that there are many acis in
this entry and the valuearray has an array of sorting
indexes to use the performance improvement from ticket #346
But in replication update resolution values are moved using
functions which are not aware of the attribute syntax
and so the sorting gets out of order and the value to be
deleted isn't found.
NOTE 1: after restart the value could be deleted
NOTE 2: with the latest fix for ticket 346 (comment 81) the bug
isn't visible since the comparison functions used in both
scenarios are similar. but the correct functions should be
called.
https://fedorahosted.org/389/ticket/47806
Reviewed by: Mark, Thanks
diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c
index 39c6e99..a4cf6cb 100644
--- a/ldap/servers/slapd/attr.c
+++ b/ldap/servers/slapd/attr.c
@@ -840,7 +840,7 @@ attr_value_find_wsi(Slapi_Attr *a, const struct berval *bval, Slapi_Value **valu
int
slapi_attr_add_value(Slapi_Attr *a, const Slapi_Value *v)
{
- slapi_valueset_add_value( &a->a_present_values, v);
+ slapi_valueset_add_attr_value_ext( a, &a->a_present_values, (Slapi_Value *)v, 0);
return 0;
}
@@ -869,7 +869,7 @@ slapi_attr_set_valueset(Slapi_Attr *a, const Slapi_ValueSet *vs)
int
attr_add_deleted_value(Slapi_Attr *a, const Slapi_Value *v)
{
- slapi_valueset_add_value( &a->a_deleted_values, v);
+ slapi_valueset_add_attr_value_ext( a, &a->a_deleted_values, (Slapi_Value *)v, 0);
return 0;
}
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 7a25489..5059457 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -52,7 +52,7 @@ entry_present_value_to_deleted_value(Slapi_Attr *a, Slapi_Value *v)
Slapi_Value *r= valueset_remove_value(a, &a->a_present_values, v);
if(r!=NULL)
{
- slapi_valueset_add_value_ext(&a->a_deleted_values, r, SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_deleted_values, r, SLAPI_VALUE_FLAG_PASSIN);
}
return LDAP_SUCCESS;
}
@@ -77,7 +77,7 @@ entry_deleted_value_to_present_value(Slapi_Attr *a, Slapi_Value *v)
Slapi_Value *r= valueset_remove_value(a, &a->a_deleted_values, v);
if(r!=NULL)
{
- slapi_valueset_add_value_ext(&a->a_present_values, r, SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_present_values, r, SLAPI_VALUE_FLAG_PASSIN);
}
return LDAP_SUCCESS;
}
@@ -1273,9 +1273,9 @@ resolve_attribute_state_to_present_or_deleted(Slapi_Entry *e, Slapi_Attr *a, Sla
if((csn_compare(vucsn,deletedcsn)>=0) ||
value_distinguished_at_csn(e, a, valuestoupdate[i], deletedcsn))
{
- slapi_valueset_add_value_ext(&a->a_present_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_present_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
} else {
- slapi_valueset_add_value_ext(&a->a_deleted_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_deleted_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
}
}
}
commit c52014ccc9b339d296a906463ccb75e5852726ca
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon May 26 10:18:26 2014 +0200
bump version
diff --git a/VERSION.sh b/VERSION.sh
index 609e298..fef5a76 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=3
-VERSION_MAINT=2.15
+VERSION_MAINT=2.16
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
ldap/servers/slapd/attr.c | 4 ++--
ldap/servers/slapd/entrywsi.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit d5c64615f4658d9025b97a50f7add888a6c2e3bd
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue May 27 14:14:15 2014 +0200
Ticket 47806 - Failed deletion of aci: no such attribute
Bug Description: an aci can be retrieved by doing an ldapsearch,
but the attemt to delete this specific aci
fails with err=16
Fix Description: the root cause for this problem is that there are many acis in
this entry and the valuearray has an array of sorting
indexes to use the performance improvement from ticket #346
But in replication update resolution values are moved using
functions which are not aware of the attribute syntax
and so the sorting gets out of order and the value to be
deleted isn't found.
NOTE 1: after restart the value could be deleted
NOTE 2: with the latest fix for ticket 346 (comment 81) the bug
isn't visible since the comparison functions used in both
scenarios are similar. but the correct functions should be
called.
https://fedorahosted.org/389/ticket/47806
Reviewed by: Mark, Thanks
diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c
index 39c6e99..a4cf6cb 100644
--- a/ldap/servers/slapd/attr.c
+++ b/ldap/servers/slapd/attr.c
@@ -840,7 +840,7 @@ attr_value_find_wsi(Slapi_Attr *a, const struct berval *bval, Slapi_Value **valu
int
slapi_attr_add_value(Slapi_Attr *a, const Slapi_Value *v)
{
- slapi_valueset_add_value( &a->a_present_values, v);
+ slapi_valueset_add_attr_value_ext( a, &a->a_present_values, (Slapi_Value *)v, 0);
return 0;
}
@@ -869,7 +869,7 @@ slapi_attr_set_valueset(Slapi_Attr *a, const Slapi_ValueSet *vs)
int
attr_add_deleted_value(Slapi_Attr *a, const Slapi_Value *v)
{
- slapi_valueset_add_value( &a->a_deleted_values, v);
+ slapi_valueset_add_attr_value_ext( a, &a->a_deleted_values, (Slapi_Value *)v, 0);
return 0;
}
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 7a25489..5059457 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -52,7 +52,7 @@ entry_present_value_to_deleted_value(Slapi_Attr *a, Slapi_Value *v)
Slapi_Value *r= valueset_remove_value(a, &a->a_present_values, v);
if(r!=NULL)
{
- slapi_valueset_add_value_ext(&a->a_deleted_values, r, SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_deleted_values, r, SLAPI_VALUE_FLAG_PASSIN);
}
return LDAP_SUCCESS;
}
@@ -77,7 +77,7 @@ entry_deleted_value_to_present_value(Slapi_Attr *a, Slapi_Value *v)
Slapi_Value *r= valueset_remove_value(a, &a->a_deleted_values, v);
if(r!=NULL)
{
- slapi_valueset_add_value_ext(&a->a_present_values, r, SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_present_values, r, SLAPI_VALUE_FLAG_PASSIN);
}
return LDAP_SUCCESS;
}
@@ -1273,9 +1273,9 @@ resolve_attribute_state_to_present_or_deleted(Slapi_Entry *e, Slapi_Attr *a, Sla
if((csn_compare(vucsn,deletedcsn)>=0) ||
value_distinguished_at_csn(e, a, valuestoupdate[i], deletedcsn))
{
- slapi_valueset_add_value_ext(&a->a_present_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_present_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
} else {
- slapi_valueset_add_value_ext(&a->a_deleted_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
+ slapi_valueset_add_attr_value_ext(a, &a->a_deleted_values, valuestoupdate[i], SLAPI_VALUE_FLAG_PASSIN);
}
}
}
ldap/servers/slapd/daemon.c | 8 +++++---
ldap/servers/slapd/libglobs.c | 17 +++--------------
ldap/servers/slapd/slap.h | 1 +
3 files changed, 9 insertions(+), 17 deletions(-)
New commits:
commit 933cbd5c1cb956c5a668a7dc8c4f611b3c08d2d7
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu May 22 15:27:02 2014 -0400
Ticket 47636 - errorlog-level 16384 is listed as 0 in cn=config
Bug Description: Even if the nsslapd-errorlog-level is set to the
default value(16384), a search on cn=config returns
the value "0". This is inconsistent and confusing
with the server documentation.
Fix Description: Do not convert the default errorlog level to zero when
updating the internal configuration. We still allow
zero to be set from a ldap client to return the logging
to the default state, but that zero will still be stored
as 16384.
https://fedorahosted.org/389/ticket/47636
Reviewed by: rmeggins & nhosoi(Thanks!!)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index b0cdcc1..9d24b37 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -798,10 +798,12 @@ disk_monitoring_thread(void *nothing)
*/
if(verbose_logging != 0 && verbose_logging != LDAP_DEBUG_ANY){
LDAPDebug(LDAP_DEBUG_ANY, "Disk space is low on disk (%s), remaining space: %" NSPRIu64 " Kb, "
- "temporarily setting error loglevel to zero.\n", dirstr,
- (disk_space / 1024), 0);
+ "temporarily setting error loglevel to the default level(%d).\n", dirstr,
+ (disk_space / 1024), SLAPD_DEFAULT_ERRORLOG_LEVEL);
/* Setting the log level back to zero, actually sets the value to LDAP_DEBUG_ANY */
- config_set_errorlog_level(CONFIG_LOGLEVEL_ATTRIBUTE, "0", errorbuf, CONFIG_APPLY);
+ config_set_errorlog_level(CONFIG_LOGLEVEL_ATTRIBUTE,
+ STRINGIFYDEFINE(SLAPD_DEFAULT_ERRORLOG_LEVEL),
+ errorbuf, CONFIG_APPLY);
continue;
}
/*
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 040649b..fbe10ff 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -118,7 +118,6 @@ typedef enum {
CONFIG_CONSTANT_STRING, /* for #define values, e.g. */
CONFIG_SPECIAL_REFERRALLIST, /* this is a berval list */
CONFIG_SPECIAL_SSLCLIENTAUTH, /* maps strings to an enumeration */
- CONFIG_SPECIAL_ERRORLOGLEVEL, /* requires & with LDAP_DEBUG_ANY */
CONFIG_STRING_OR_EMPTY, /* use an empty string */
CONFIG_SPECIAL_ANON_ACCESS_SWITCH, /* maps strings to an enumeration */
CONFIG_SPECIAL_VALIDATE_CERT_SWITCH, /* maps strings to an enumeration */
@@ -289,7 +288,7 @@ slapi_onoff_t init_mempool_switch;
static int
isInt(ConfigVarType type)
{
- return type == CONFIG_INT || type == CONFIG_ON_OFF || type == CONFIG_SPECIAL_SSLCLIENTAUTH || type == CONFIG_SPECIAL_ERRORLOGLEVEL;
+ return type == CONFIG_INT || type == CONFIG_ON_OFF || type == CONFIG_SPECIAL_SSLCLIENTAUTH;
}
/* the caller will typically have to cast the result based on the ConfigVarType */
@@ -339,7 +338,7 @@ static struct config_get_and_set {
{CONFIG_LOGLEVEL_ATTRIBUTE, config_set_errorlog_level,
NULL, 0,
(void**)&global_slapdFrontendConfig.errorloglevel,
- CONFIG_SPECIAL_ERRORLOGLEVEL, NULL, NULL},
+ CONFIG_INT, NULL, STRINGIFYDEFINE(SLAPD_DEFAULT_ERRORLOG_LEVEL)},
{CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE, NULL,
log_set_logging, SLAPD_ERROR_LOG,
(void**)&global_slapdFrontendConfig.errorlog_logging_enabled,
@@ -1520,7 +1519,7 @@ FrontendConfig_init () {
cfg->errorlog_minfreespace = 5;
cfg->errorlog_exptime = 1;
cfg->errorlog_exptimeunit = slapi_ch_strdup(INIT_ERRORLOG_EXPTIMEUNIT);
- cfg->errorloglevel = 0;
+ cfg->errorloglevel = SLAPD_DEFAULT_ERRORLOG_LEVEL;
init_auditlog_logging_enabled = cfg->auditlog_logging_enabled = LDAP_OFF;
cfg->auditlog_mode = slapi_ch_strdup(INIT_AUDITLOG_MODE);
@@ -7475,16 +7474,6 @@ config_set_value(
*((char **)value) : "unknown");
break;
- case CONFIG_SPECIAL_ERRORLOGLEVEL:
- if (value) {
- int ival = *(int *)value;
- ival &= ~LDAP_DEBUG_ANY;
- slapi_entry_attr_set_int(e, cgas->attr_name, ival);
- }
- else
- slapi_entry_attr_set_charptr(e, cgas->attr_name, "");
- break;
-
case CONFIG_SPECIAL_ANON_ACCESS_SWITCH:
if (!value) {
slapi_entry_attr_set_charptr(e, cgas->attr_name, "off");
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 5401a66..bbc1dc5 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -272,6 +272,7 @@ typedef void (*VFPV)(); /* takes undefined arguments */
#define SLAPD_DEFAULT_DIR_MODE S_IRWXU
#endif
+#define SLAPD_DEFAULT_ERRORLOG_LEVEL 16384
#define SLAPD_DEFAULT_IDLE_TIMEOUT 0 /* seconds - 0 == never */
#define SLAPD_DEFAULT_SIZELIMIT 2000 /* use -1 for no limit */
#define SLAPD_DEFAULT_TIMELIMIT 3600 /* use -1 for no limit */