summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-10-26 23:50:50 +0200
committerStefan Metzmacher <metze@samba.org>2009-11-06 14:05:45 +0100
commit5381d8d157e90ae0e6058a19c2486377221ef3f6 (patch)
treea7f5f5824967a8e0cd975fed6fea82bbd18f65ff /source4/dsdb/schema
parent20622de49f8a876ef91db329348d0827126f11c2 (diff)
downloadsamba-5381d8d157e90ae0e6058a19c2486377221ef3f6.tar.gz
samba-5381d8d157e90ae0e6058a19c2486377221ef3f6.tar.bz2
samba-5381d8d157e90ae0e6058a19c2486377221ef3f6.zip
s4/drs: Load prefixMap from ldb_val moved in separate function
It is to be used later in several places when we need such conversion. Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_init.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 5ce537a4e7..615e1d4d3d 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -65,6 +65,41 @@ WERROR dsdb_load_prefixmap_from_drsuapi(struct dsdb_schema *schema,
return WERR_OK;
}
+static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct dsdb_schema_prefixmap **_pfm)
+{
+ WERROR werr;
+ enum ndr_err_code ndr_err;
+ struct prefixMapBlob pfm_blob;
+
+ TALLOC_CTX *temp_ctx = talloc_new(mem_ctx);
+ W_ERROR_HAVE_NO_MEMORY(temp_ctx);
+
+ ndr_err = ndr_pull_struct_blob(pfm_ldb_val, temp_ctx,
+ iconv_convenience, &pfm_blob,
+ (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err);
+ talloc_free(temp_ctx);
+ return ntstatus_to_werror(nt_status);
+ }
+
+ if (pfm_blob.version != PREFIX_MAP_VERSION_DSDB) {
+ DEBUG(0,("_dsdb_prefixmap_from_ldb_val: pfm_blob->version incorrect\n"));
+ talloc_free(temp_ctx);
+ return WERR_VERSION_PARSE_ERROR;
+ }
+
+ /* call the drsuapi version */
+ werr = dsdb_schema_pfm_from_drsuapi_pfm(&pfm_blob.ctr.dsdb, false, mem_ctx, _pfm, NULL);
+
+ talloc_free(temp_ctx);
+
+ return werr;
+}
+
WERROR dsdb_load_oid_mappings_ldb(struct dsdb_schema *schema,
const struct ldb_val *prefixMap,
const struct ldb_val *schemaInfo)