diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 17acfbd736..5050bddda8 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -117,6 +117,11 @@ int bdb_modify_internal( return err; } + /* If objectClass was modified, reset the flags */ + if ( mod->sm_desc == slap_schema.si_ad_objectClass ) { + e->e_ocflags = 0; + } + /* check if modified attribute was indexed */ err = bdb_index_is_indexed( be, mod->sm_desc ); if ( err == LDAP_SUCCESS ) { diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 685d87c6f5..8753991485 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -187,6 +187,11 @@ int ldbm_modify_internal( goto exit; } + /* If objectClass was modified, reset the flags */ + if ( mod->sm_desc == slap_schema.si_ad_objectClass ) { + e->e_ocflags = 0; + } + /* check if modified attribute was indexed */ rc = index_is_indexed( be, mod->sm_desc ); if ( rc == LDAP_SUCCESS ) {