Skip to content
Snippets Groups Projects
Commit af8cb90e authored by Howard Chu's avatar Howard Chu
Browse files

ITS#3289 - add SLAP_AT_DYNAMIC flag for dynamically generated attributes.

Set flag for hasSubordinates and subschemaSubentry. Strip dynamic attributes
before storing entries in syncrepl.
parent f2ee179c
No related branches found
No related tags found
No related merge requests found
......@@ -495,7 +495,7 @@ static struct slap_schema_ad_map {
"EQUALITY booleanMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
NULL, 0,
NULL, SLAP_AT_DYNAMIC,
NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_hasSubordinates) },
......@@ -504,7 +504,7 @@ static struct slap_schema_ad_map {
"EQUALITY distinguishedNameMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE "
"NO-USER-MODIFICATION USAGE directoryOperation )",
NULL, 0,
NULL, SLAP_AT_DYNAMIC,
NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
......
......@@ -622,6 +622,8 @@ typedef struct slap_attribute_type {
#else
#define SLAP_AT_HIDE 0x8000U /* hide attribute */
#endif
#define SLAP_AT_DYNAMIC 0x0400U /* dynamically generated */
slap_mask_t sat_flags;
LDAP_SLIST_ENTRY(slap_attribute_type) sat_next;
......
......@@ -1057,6 +1057,18 @@ syncrepl_message_to_entry(
#endif
goto done;
}
/* Strip out dynamically generated attrs */
for ( modtail = modlist; *modtail ; ) {
mod = *modtail;
if ( mod->sml_desc->ad_type->sat_flags & SLAP_AT_DYNAMIC ) {
*modtail = mod->sml_next;
slap_mod_free( &mod->sml_mod, 0 );
free( mod );
} else {
modtail = &mod->sml_next;
}
}
rc = slap_mods2entry( *modlist, &e, 1, 1, &text, txtbuf, textlen);
if( rc != LDAP_SUCCESS ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment