]> git.sur5r.net Git - openldap/commitdiff
ITS#3289 - add SLAP_AT_DYNAMIC flag for dynamically generated attributes.
authorHoward Chu <hyc@openldap.org>
Thu, 19 Aug 2004 23:39:45 +0000 (23:39 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 19 Aug 2004 23:39:45 +0000 (23:39 +0000)
Set flag for hasSubordinates and subschemaSubentry. Strip dynamic attributes
before storing entries in syncrepl.

servers/slapd/schema_prep.c
servers/slapd/slap.h
servers/slapd/syncrepl.c

index 33366f3a1060d7688c28581ffbb58736c5602f77..e1c09e1daa8a757e951e77b2688e381324e7781d 100644 (file)
@@ -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) },
index 7918818f9cc7b088fb7ba7a6a62cedc30a2f2e8e..138622e14d3d32a4d94b8a12f03a75ee05a835a6 100644 (file)
@@ -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;
index ec6a067c8c0deea09a2f7cd75b5ac65be1c7e40f..898b161f7f7fdc8499c1cad9cbcecdc59c509b2a 100644 (file)
@@ -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 ) {