mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-01 04:29:35 -05:00
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.
This commit is contained in:
parent
f2ee179c3f
commit
af8cb90ed8
3 changed files with 16 additions and 2 deletions
|
|
@ -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 ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue