summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-04-08 05:31:35 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-04-09 12:21:32 +0300
commit5363b6e68b2eb432142b4c0d4972ea4def17c1be (patch)
treea04d648801ed5c0244b979dc069995e11e9e83f7 /source4/dsdb/schema
parentc3d77989913a1ec270a50847922f6c1ffd7cbad0 (diff)
downloadsamba-5363b6e68b2eb432142b4c0d4972ea4def17c1be.tar.gz
samba-5363b6e68b2eb432142b4c0d4972ea4def17c1be.tar.bz2
samba-5363b6e68b2eb432142b4c0d4972ea4def17c1be.zip
s4/dsdb: Use dsdb_schema_info object to create default schemaInfo values
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_init.c19
-rw-r--r--source4/dsdb/schema/schema_set.c10
2 files changed, 22 insertions, 7 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 2f9abea303..1f2b1b8e17 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -734,9 +734,22 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
}
info_val = ldb_msg_find_ldb_val(schema_res->msgs[0], "schemaInfo");
if (!info_val) {
- info_val_default = strhex_to_data_blob(mem_ctx, "FF0000000000000000000000000000000000000000");
- if (!info_val_default.data) {
- dsdb_oom(error_string, mem_ctx);
+ struct dsdb_schema_info *schema_info;
+
+ status = dsdb_schema_info_create(ldb, mem_ctx, &schema_info);
+ if (!W_ERROR_IS_OK(status)) {
+ *error_string = talloc_asprintf(mem_ctx,
+ "schema_fsmo_init: dsdb_schema_info_create() failed - %s",
+ win_errstr(status));
+ DEBUG(0,(__location__ ": %s\n", *error_string));
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ status = dsdb_blob_from_schema_info(schema_info, mem_ctx, &info_val_default);
+ if (!W_ERROR_IS_OK(status)) {
+ *error_string = talloc_asprintf(mem_ctx,
+ "schema_fsmo_init: dsdb_blob_from_schema_info() failed - %s",
+ win_errstr(status));
+ DEBUG(0,(__location__ ": %s\n", *error_string));
return LDB_ERR_OPERATIONS_ERROR;
}
info_val = &info_val_default;
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 1c7d39aa53..9dcf2b8d42 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -582,6 +582,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const
const struct ldb_val *prefix_val;
const struct ldb_val *info_val;
struct ldb_val info_val_default;
+ struct dsdb_schema_info *schema_info;
mem_ctx = talloc_new(ldb);
@@ -622,15 +623,16 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const
info_val = ldb_msg_find_ldb_val(msg, "schemaInfo");
if (!info_val) {
- info_val_default = strhex_to_data_blob(mem_ctx, "FF0000000000000000000000000000000000000000");
- if (!info_val_default.data) {
- goto nomem;
- }
+ status = dsdb_schema_info_create(ldb, mem_ctx, &schema_info);
+ W_ERROR_NOT_OK_GOTO(status, failed);
+ status = dsdb_blob_from_schema_info(schema_info, mem_ctx, &info_val_default);
+ W_ERROR_NOT_OK_GOTO(status, failed);
info_val = &info_val_default;
}
status = dsdb_load_oid_mappings_ldb(schema, prefix_val, info_val);
if (!W_ERROR_IS_OK(status)) {
+ DEBUG(0,("ERROR: dsdb_load_oid_mappings_ldb() failed with %s\n", win_errstr(status)));
goto failed;
}