This is an automated email from the git hooks/post-receive script.
lkrispen pushed a commit to branch master
in repository 389-ds-base.
commit fc10c8b392affc7a125dedcefdd7fdda482079c6
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue Nov 22 15:16:21 2016 +0100
Ticket 49050 - make objectclass ldapsubentry effective immediately
Entries containing objectclass ldapsubentry are not returned in normal searches,
but if the objectclass is added via ldapmodify the flag is not set in the cache entry
and it is not effective until reloaded to the cache
FIx: when modiifying an entry check for oc ldapsubentry and set flag in entry cache
Reviewed by: Mark, William - thanks
---
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index e86b391..aee39e6 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -275,7 +275,26 @@ modify_apply_check_expand(
*/
for (i = 0; mods && mods[i]; ++i) {
if (0 == strcasecmp(SLAPI_ATTR_OBJECTCLASS, mods[i]->mod_type)) {
- slapi_schema_expand_objectclasses(ec->ep_entry);
+ slapi_schema_expand_objectclasses( ec->ep_entry );
+ /* if the objectclass ldapsubentry is added or removed, the flag in the
entry
+ * has to be updated. Otherwise it would only be effective after a reload
+ * of the entry.
+ */
+ for (size_t j = 0; mods[i]->mod_bvalues != NULL &&
mods[i]->mod_bvalues[j] != NULL; j++ ) {
+ if (strncasecmp((const char *)mods[i]->mod_bvalues[j]->bv_val,
+ "ldapsubentry", mods[i]->mod_bvalues[j]->bv_len)
== 0) {
+ switch ( mods[i]->mod_op & ~LDAP_MOD_BVALUES ) {
+ case LDAP_MOD_ADD:
+ case LDAP_MOD_REPLACE:
+ ec->ep_entry->e_flags |= SLAPI_ENTRY_LDAPSUBENTRY;
+ break;
+ case LDAP_MOD_DELETE:
+ ec->ep_entry->e_flags &= ~SLAPI_ENTRY_LDAPSUBENTRY;
+ break;
+ }
+ break;
+ }
+ }
break;
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.