summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-10-26 02:41:46 +0200
committerStefan Metzmacher <metze@samba.org>2009-11-06 14:05:42 +0100
commit28b6eb94944e5bca0fff4aeef181e61926df3568 (patch)
treed13756832dbc6e629ee2a13cf0735f43efd67973
parenta83385303b3d0cae61d3ace412f58ca49a01f9dc (diff)
downloadsamba-28b6eb94944e5bca0fff4aeef181e61926df3568.tar.gz
samba-28b6eb94944e5bca0fff4aeef181e61926df3568.tar.bz2
samba-28b6eb94944e5bca0fff4aeef181e61926df3568.zip
s4/drs: dsdb_get_oid_mappings_drsuapi() to use new prefixMap interface
dsdb_get_oid_mappings_drsuapi() just need to call dsdb_drsuapi_pfm_from_schema_pfm() to get filled-in DRSUAPI prefixMap. Perhaps it won't be bad to rename this function to have more expressive name in the future Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/dsdb/schema/schema_init.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index dc4f1fffec..e64cc4bb83 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -122,40 +122,9 @@ WERROR dsdb_get_oid_mappings_drsuapi(const struct dsdb_schema *schema,
TALLOC_CTX *mem_ctx,
struct drsuapi_DsReplicaOIDMapping_Ctr **_ctr)
{
- DATA_BLOB oid_blob;
- struct drsuapi_DsReplicaOIDMapping_Ctr *ctr;
- uint32_t i;
-
- ctr = talloc(mem_ctx, struct drsuapi_DsReplicaOIDMapping_Ctr);
- W_ERROR_HAVE_NO_MEMORY(ctr);
-
- ctr->num_mappings = schema->num_prefixes;
- if (include_schema_info) ctr->num_mappings++;
- ctr->mappings = talloc_array(schema, struct drsuapi_DsReplicaOIDMapping, ctr->num_mappings);
- W_ERROR_HAVE_NO_MEMORY(ctr->mappings);
-
- for (i=0; i < schema->num_prefixes; i++) {
- if (!ber_write_partial_OID_String(ctr->mappings, &oid_blob, schema->prefixes[i].oid)) {
- DEBUG(0, ("write_partial_OID failed for %s", schema->prefixes[i].oid));
- return WERR_INTERNAL_ERROR;
- }
-
- ctr->mappings[i].id_prefix = schema->prefixes[i].id>>16;
- ctr->mappings[i].oid.length = oid_blob.length;
- ctr->mappings[i].oid.binary_oid = oid_blob.data;
- }
-
- if (include_schema_info) {
- oid_blob = strhex_to_data_blob(ctr->mappings, schema->schema_info);
- W_ERROR_HAVE_NO_MEMORY(oid_blob.data);
-
- ctr->mappings[i].id_prefix = 0;
- ctr->mappings[i].oid.length = oid_blob.length;
- ctr->mappings[i].oid.binary_oid = oid_blob.data;
- }
-
- *_ctr = ctr;
- return WERR_OK;
+ return dsdb_drsuapi_pfm_from_schema_pfm(schema->prefixmap,
+ include_schema_info ? schema->schema_info : NULL,
+ mem_ctx, _ctr);
}
WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema,