diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-06-10 08:27:59 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-06-12 11:17:22 +1000 |
commit | d6f5c1ace215131dc09611abcd2a52254bdab4d6 (patch) | |
tree | 386ffcbc714cb491cad54800e308c4ddd991b8fb /source4/dsdb | |
parent | e82836467c2ecdcb2c89c2b6eb4dae51bd2f22a2 (diff) | |
download | samba-d6f5c1ace215131dc09611abcd2a52254bdab4d6.tar.gz samba-d6f5c1ace215131dc09611abcd2a52254bdab4d6.tar.bz2 samba-d6f5c1ace215131dc09611abcd2a52254bdab4d6.zip |
s4:dsdb Provide a function to convert from DRS prefix maps to the LDB prefixmap
This allows us to push a prefixmap directly into the schema we
generate in the provision code.
Andrew Bartlett
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 47eef5c04f..8e47f1228d 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -168,30 +168,39 @@ WERROR dsdb_get_oid_mappings_drsuapi(const struct dsdb_schema *schema, mem_ctx, _ctr); } -WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema, - TALLOC_CTX *mem_ctx, - struct ldb_val *prefixMap, - struct ldb_val *schemaInfo) +WERROR dsdb_get_drsuapi_prefixmap_as_blob(const struct drsuapi_DsReplicaOIDMapping_Ctr *ctr, + TALLOC_CTX *mem_ctx, + struct ldb_val *prefixMap) { - WERROR status; - enum ndr_err_code ndr_err; - struct drsuapi_DsReplicaOIDMapping_Ctr *ctr; struct prefixMapBlob pfm; - - status = dsdb_get_oid_mappings_drsuapi(schema, false, mem_ctx, &ctr); - W_ERROR_NOT_OK_RETURN(status); - + enum ndr_err_code ndr_err; pfm.version = PREFIX_MAP_VERSION_DSDB; pfm.reserved = 0; pfm.ctr.dsdb = *ctr; ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, &pfm, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); - talloc_free(ctr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); return ntstatus_to_werror(nt_status); } + return WERR_OK; +} + +WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema, + TALLOC_CTX *mem_ctx, + struct ldb_val *prefixMap, + struct ldb_val *schemaInfo) +{ + WERROR status; + struct drsuapi_DsReplicaOIDMapping_Ctr *ctr; + + status = dsdb_get_oid_mappings_drsuapi(schema, false, mem_ctx, &ctr); + W_ERROR_NOT_OK_RETURN(status); + + status = dsdb_get_drsuapi_prefixmap_as_blob(ctr, mem_ctx, prefixMap); + talloc_free(ctr); + W_ERROR_NOT_OK_RETURN(status); *schemaInfo = strhex_to_data_blob(mem_ctx, schema->schema_info); W_ERROR_HAVE_NO_MEMORY(schemaInfo->data); |