s4/drs: remove unused num_prefixes and prefixes from dsdb_schema
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Thu, 29 Oct 2009 14:24:00 +0000 (16:24 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 6 Nov 2009 13:05:49 +0000 (14:05 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/schema/schema.h
source4/dsdb/schema/schema_init.c

index 5af951aff5f878654255ff63b77288f3203bfee3..661060d7552046e94040303e6ffbaa6f5e77b73c 100644 (file)
@@ -273,7 +273,7 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
 
        if (schema && do_attribute_explicit(attrs, "dsSchemaPrefixCount")) {
                if (ldb_msg_add_fmt(msg, "dsSchemaPrefixCount", 
-                                   "%u", schema->num_prefixes) != 0) {
+                                   "%u", schema->prefixmap->length) != 0) {
                        goto failed;
                }
        }
index 6c9ec96dfe4894df64f56838ddd03fe1a630f239..f3ba25c8644470560002431503f8997676e39e18 100644 (file)
@@ -165,8 +165,6 @@ struct dsdb_schema_oid_prefix {
 };
 
 struct dsdb_schema {
-       uint32_t num_prefixes;
-       struct dsdb_schema_oid_prefix *prefixes;
 
        struct dsdb_schema_prefixmap *prefixmap;
 
index 83695b354b0796cdadf75b7e4d54066c6870e59f..412ff0ceb35b5c09159894353b5eeff38f5bf530 100644 (file)
@@ -639,7 +639,7 @@ WERROR dsdb_attribute_from_ldb(struct ldb_context *ldb,
        GET_STRING_LDB(msg, "cn", mem_ctx, attr, cn, false);
        GET_STRING_LDB(msg, "lDAPDisplayName", mem_ctx, attr, lDAPDisplayName, true);
        GET_STRING_LDB(msg, "attributeID", mem_ctx, attr, attributeID_oid, true);
-       if (schema->num_prefixes == 0) {
+       if (!schema->prefixmap || schema->prefixmap->length == 0) {
                /* set an invalid value */
                attr->attributeID_id = 0xFFFFFFFF;
        } else {
@@ -664,7 +664,7 @@ WERROR dsdb_attribute_from_ldb(struct ldb_context *ldb,
        GET_UINT32_LDB(msg, "linkID", attr, linkID);
 
        GET_STRING_LDB(msg, "attributeSyntax", mem_ctx, attr, attributeSyntax_oid, true);
-       if (schema->num_prefixes == 0) {
+       if (!schema->prefixmap || schema->prefixmap->length == 0) {
                /* set an invalid value */
                attr->attributeSyntax_id = 0xFFFFFFFF;
        } else {
@@ -719,7 +719,7 @@ WERROR dsdb_class_from_ldb(const struct dsdb_schema *schema,
        GET_STRING_LDB(msg, "cn", mem_ctx, obj, cn, false);
        GET_STRING_LDB(msg, "lDAPDisplayName", mem_ctx, obj, lDAPDisplayName, true);
        GET_STRING_LDB(msg, "governsID", mem_ctx, obj, governsID_oid, true);
-       if (schema->num_prefixes == 0) {
+       if (!schema->prefixmap || schema->prefixmap->length == 0) {
                /* set an invalid value */
                obj->governsID_id = 0xFFFFFFFF;
        } else {