Remove DESCRIPTION from generated schema lines.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 3 Oct 2008 23:36:04 +0000 (16:36 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 Oct 2008 21:16:30 +0000 (14:16 -0700)
This is not permitted in the AD aggregate schema, and more trouble
than it is worth in the OpenLDAP schema due to escaping issues.

Andrew Bartlett

source4/dsdb/schema/schema_description.c
source4/utils/ad2oLschema.c

index e152f44b9751d7785d19ed54e32938d94fa6431a..c3c37b46533320b56bb2e4ebcb8f6f68c6843aa8 100644 (file)
@@ -33,7 +33,6 @@ char *schema_attribute_description(TALLOC_CTX *mem_ctx,
                                          const char *seperator,
                                          const char *oid, 
                                          const char *name,
-                                         const char *description,
                                          const char *equality, 
                                          const char *substring, 
                                          const char *syntax,
@@ -46,15 +45,6 @@ char *schema_attribute_description(TALLOC_CTX *mem_ctx,
                                              "NAME '%s'%s", name, seperator);
        IF_NULL_FAIL_RET(schema_entry);
        
-       if (description) {
-#if 0          
-               /* Need a way to escape ' characters from the description */
-               schema_entry = talloc_asprintf_append(schema_entry, 
-                                                     "DESC '%s'%s", description, seperator);
-               IF_NULL_FAIL_RET(schema_entry);
-#endif
-       }
-
        if (equality) {
                schema_entry = talloc_asprintf_append(schema_entry, 
                                                      "EQUALITY %s%s", equality, seperator);
@@ -104,7 +94,7 @@ char *schema_attribute_to_description(TALLOC_CTX *mem_ctx, const struct dsdb_att
                                               " ",
                                               attribute->attributeID_oid,
                                               attribute->lDAPDisplayName,
-                                              NULL, NULL, NULL, talloc_asprintf(tmp_ctx, "'%s'", syntax),
+                                              NULL, NULL, talloc_asprintf(tmp_ctx, "'%s'", syntax),
                                               attribute->isSingleValued,
                                               attribute->systemOnly);
        talloc_free(tmp_ctx);
@@ -149,7 +139,6 @@ char *schema_class_description(TALLOC_CTX *mem_ctx,
                               const char *oid, 
                               const char *name,
                               const char **auxillary_classes,
-                              const char *description,
                               const char *subClassOf,
                               int objectClassCategory,
                               char **must,
@@ -164,12 +153,6 @@ char *schema_class_description(TALLOC_CTX *mem_ctx,
                                              "NAME '%s'%s", name, seperator);
        IF_NULL_FAIL_RET(schema_entry);
        
-       if (description) {
-               schema_entry = talloc_asprintf_append(schema_entry, 
-                                                     "DESC '%s'%s", description, seperator);
-               IF_NULL_FAIL_RET(schema_entry);
-       }
-
        if (auxillary_classes) {
                schema_entry = talloc_asprintf_append(schema_entry, 
                                                      "AUX ( ");
@@ -262,7 +245,6 @@ char *schema_class_to_description(TALLOC_CTX *mem_ctx, const struct dsdb_class *
                                           " ",
                                           class->governsID_oid,
                                           class->lDAPDisplayName,
-                                          NULL,
                                           NULL, 
                                           class->subClassOf,
                                           class->objectClassCategory,
@@ -308,7 +290,6 @@ char *schema_class_to_dITContentRule(TALLOC_CTX *mem_ctx, const struct dsdb_clas
                                           class->governsID_oid,
                                           class->lDAPDisplayName,
                                           (const char **)aux_class_list,
-                                          NULL, 
                                           NULL, /* Must not specify a
                                                  * SUP (subclass) in
                                                  * ditContentRules
index 3c2ffe7a00c188231a7e1e4406b823515c0d0a94..c579112b45ddf0c50580632de9c2935f6e735bf9 100644 (file)
@@ -221,7 +221,6 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
 
        for (attribute=schema->attributes; attribute; attribute = attribute->next) {
                const char *name = attribute->lDAPDisplayName;
-               const char *description = attribute->adminDescription;
                const char *oid = attribute->attributeID_oid;
                const char *syntax = attribute->attributeSyntax_oid;
                const char *equality = NULL, *substring = NULL;
@@ -270,7 +269,16 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
                        }
                }
                
-               schema_entry = schema_attribute_description(mem_ctx, target, seperator, oid, name, description, equality, substring, syntax, single_value, false);
+               schema_entry = schema_attribute_description(mem_ctx, 
+                                                           target, 
+                                                           seperator, 
+                                                           oid, 
+                                                           name, 
+                                                           equality, 
+                                                           substring, 
+                                                           syntax, 
+                                                           single_value, 
+                                                           false);
 
                if (schema_entry == NULL) {
                        ret.failures++;
@@ -291,7 +299,6 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
        /* This is already sorted to have 'top' and similar classes first */
        for (objectclass=schema->classes; objectclass; objectclass = objectclass->next) {
                const char *name = objectclass->lDAPDisplayName;
-               const char *description = objectclass->adminDescription;
                const char *oid = objectclass->governsID_oid;
                const char *subClassOf = objectclass->subClassOf;
                int objectClassCategory = objectclass->objectClassCategory;
@@ -356,7 +363,6 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
                                                        oid, 
                                                        name,
                                                        NULL, 
-                                                       description,
                                                        subClassOf,
                                                        objectClassCategory,
                                                        must,