s4:schema Don't rely on objectCategory 'magic' when loading the schema
authorAndrew Bartlett <abartlet@samba.org>
Wed, 11 Mar 2009 05:36:40 +0000 (16:36 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 11 Mar 2009 05:36:40 +0000 (16:36 +1100)
The short-to-long name canonicalisation rules use the schema, so
clearly they won't work when loading it.

Andrew Bartlett

source4/dsdb/schema/schema_init.c

index 3396493636bc0c9d7c56b005061b9028b28d75eb..b6a7cf7cc8aa893501cb04b6c48e7d2d0ecc4ae1 100644 (file)
@@ -972,7 +972,7 @@ int dsdb_schema_from_schema_dn(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
         */
        ret = ldb_search(ldb, tmp_ctx, &a_res,
                         schema_dn, LDB_SCOPE_ONELEVEL, NULL,
         */
        ret = ldb_search(ldb, tmp_ctx, &a_res,
                         schema_dn, LDB_SCOPE_ONELEVEL, NULL,
-                        "(objectCategory=attributeSchema)");
+                        "(objectClass=attributeSchema)");
        if (ret != LDB_SUCCESS) {
                *error_string_out = talloc_asprintf(mem_ctx, 
                                       "dsdb_schema: failed to search attributeSchema objects: %s",
        if (ret != LDB_SUCCESS) {
                *error_string_out = talloc_asprintf(mem_ctx, 
                                       "dsdb_schema: failed to search attributeSchema objects: %s",
@@ -986,7 +986,7 @@ int dsdb_schema_from_schema_dn(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
         */
        ret = ldb_search(ldb, tmp_ctx, &c_res,
                         schema_dn, LDB_SCOPE_ONELEVEL, NULL,
         */
        ret = ldb_search(ldb, tmp_ctx, &c_res,
                         schema_dn, LDB_SCOPE_ONELEVEL, NULL,
-                        "(objectCategory=classSchema)");
+                        "(objectClass=classSchema)");
        if (ret != LDB_SUCCESS) {
                *error_string_out = talloc_asprintf(mem_ctx, 
                                       "dsdb_schema: failed to search attributeSchema objects: %s",
        if (ret != LDB_SUCCESS) {
                *error_string_out = talloc_asprintf(mem_ctx, 
                                       "dsdb_schema: failed to search attributeSchema objects: %s",