1
0
Эх сурвалжийг харах

Bug 693466 - Unable to change schema online

https://bugzilla.redhat.com/show_bug.cgi?id=693466
Resolves: bug 693466
Bug Description: Unable to change schema online
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: The problem is only with attributes that specify a SUP.
There was some old code that assumed the attributes were stored in a list
in order of SUP.  This is not the case.  They are stored in a hashtable
which is not in any order at all.  But the check is redundant anyway.
If a SUP is specified, the code already checks if the superior exists and
returns an error if not.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 14 жил өмнө
parent
commit
466fced49d

+ 0 - 77
ldap/servers/slapd/schema.c

@@ -3107,65 +3107,6 @@ oc_free( struct objclass **ocp )
 	}
 }
 
-struct supargs{
-        char *sup, *oid;
-        unsigned long rc;
-};
-
-static int
-at_sup_dependency_callback(struct asyntaxinfo *asi, void *arg)
-{
-    struct supargs *aew = (struct supargs *)arg;
-    int rc=ATTR_SYNTAX_ENUM_NEXT;
-    
-    if (!asi) {
-        LDAPDebug(LDAP_DEBUG_ANY, "Error: no attribute types in at_schema_attributes_callback\n",
-            0, 0, 0);
-    } 
-    else 
-    {
-        if (strcasecmp (asi->asi_oid, aew->oid ) == 0) {
-            rc=ATTR_SYNTAX_ENUM_STOP;
-        } else {
-            if(asi->asi_name != NULL) {
-                if (strcasecmp (asi->asi_name, aew->sup ) == 0) {
-                    aew->rc=0;
-                } else if (asi->asi_aliases) {
-                   int i = 0;
-
-                    /* Loop through aliases to see if any match */
-                   for (i=0; asi->asi_aliases[i] != NULL; i++) {
-                       if (strcasecmp (asi->asi_aliases[i], aew->sup ) == 0) {
-                           aew->rc=0;
-                       }
-                   }
-		}
-            }
-        }
-    }
-    return rc;
-}
-
-/* walks down attribute types and makes sure that the superior value is found in an attribute type
-   preceeding in the hash table. I have concerns about collisions messing with the order here but this
-   may be the best we can do.
-*/
-
-static int
-slapi_check_at_sup_dependency(char *sup, char *oid) 
-{
-    struct supargs aew;
-    
-    memset(&aew,0,sizeof(struct supargs));
-    aew.rc=LDAP_TYPE_OR_VALUE_EXISTS;
-    aew.sup=sup;
-    aew.oid=oid;
-    attr_syntax_enumerate_attrs(at_sup_dependency_callback, &aew, PR_FALSE);
-    return aew.rc;
-}
-
-
-
 /*
  * if asipp is NULL, the attribute type is added to the global set of schema.
  * if asipp is not NULL, the AT is not added but *asipp is set.  When you are
@@ -3469,24 +3410,6 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf,
             attr_syntax_return( asi_parent );
         }
     }
-    /* 
-       if we are remote (via modify_schema_dse) then check sup dependencies. Locally
-       was done in if statement above 
-    */
-    
-    if(!status) 
-    {
-        if(is_remote && (pSuperior != NULL))
-        {
-            status=slapi_check_at_sup_dependency(pSuperior, pOid);
-        }
-        if(LDAP_SUCCESS != status) {
-            schema_create_errormsg( errorbuf, errorbufsize,
-                schema_errprefix_at, first_attr_name,
-                "Missing parent attribute syntax OID");
-            status = LDAP_TYPE_OR_VALUE_EXISTS;
-        }
-    }
 
     if (!status && (NULL == pSyntax)) {
         schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at,