summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-10-26 03:06:16 +0200
committerStefan Metzmacher <metze@samba.org>2009-11-06 14:05:42 +0100
commitddab9d1fe74c90b2b05cd1712931930e82380913 (patch)
treef2bd2f124b3972829922c3b480b03caaa922d113
parent28b6eb94944e5bca0fff4aeef181e61926df3568 (diff)
downloadsamba-ddab9d1fe74c90b2b05cd1712931930e82380913.tar.gz
samba-ddab9d1fe74c90b2b05cd1712931930e82380913.tar.bz2
samba-ddab9d1fe74c90b2b05cd1712931930e82380913.zip
s4/drs: dsdb_verify_oid_mappings_drsuapi() replaced by dsdb_schema_pfm_contains_drsuapi_pfm()
dsdb_schema_pfm_contains_drsuapi_pfm() is part of reimplemented prefixMap interface. This name was choosen to clearly show, that this a week verification in case we want to determine if remote schema is changed. Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/dsdb/repl/replicated_objects.c2
-rw-r--r--source4/dsdb/schema/schema_init.c71
-rw-r--r--source4/libnet/libnet_vampire.c2
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c2
4 files changed, 3 insertions, 74 deletions
diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c
index ec5dcd4720..47291b68de 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -229,7 +229,7 @@ WERROR dsdb_extended_replicated_objects_commit(struct ldb_context *ldb,
return WERR_DS_SCHEMA_NOT_LOADED;
}
- status = dsdb_verify_oid_mappings_drsuapi(schema, mapping_ctr);
+ status = dsdb_schema_pfm_contains_drsuapi_pfm(schema->prefixmap, mapping_ctr);
W_ERROR_NOT_OK_RETURN(status);
out = talloc_zero(mem_ctx, struct dsdb_extended_replicated_objects);
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index e64cc4bb83..0796200cb0 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -157,77 +157,6 @@ WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema,
return WERR_OK;
}
-WERROR dsdb_verify_oid_mappings_drsuapi(const struct dsdb_schema *schema, const struct drsuapi_DsReplicaOIDMapping_Ctr *ctr)
-{
- uint32_t i,j;
- DATA_BLOB oid_blob;
-
- for (i=0; i < ctr->num_mappings; i++) {
- if (ctr->mappings[i].oid.binary_oid == NULL) {
- return WERR_INVALID_PARAM;
- }
-
- if (ctr->mappings[i].oid.binary_oid[0] == 0xFF) {
- if (ctr->mappings[i].id_prefix != 0) {
- return WERR_INVALID_PARAM;
- }
-
- /* the magic value should be in the last array member */
- if (i != (ctr->num_mappings - 1)) {
- return WERR_INVALID_PARAM;
- }
-
- if (ctr->mappings[i].oid.length != 21) {
- return WERR_INVALID_PARAM;
- }
-
- oid_blob = strhex_to_data_blob(NULL, schema->schema_info);
- W_ERROR_HAVE_NO_MEMORY(oid_blob.data);
-
- if (memcmp(oid_blob.data, ctr->mappings[i].oid.binary_oid, 21) != 0) {
- data_blob_free(&oid_blob);
- return WERR_DS_DRA_SCHEMA_MISMATCH;
- }
-
- data_blob_free(&oid_blob);
- } else {
- /* the last array member should contain the magic value not a oid */
- if (i == (ctr->num_mappings - 1)) {
- return WERR_INVALID_PARAM;
- }
-
- for (j=0; j < schema->num_prefixes; j++) {
- if (schema->prefixes[j].id != (ctr->mappings[i].id_prefix<<16)) {
- continue;
- }
-
- if (!ber_write_partial_OID_String(NULL, &oid_blob, schema->prefixes[j].oid)) {
- return WERR_INTERNAL_ERROR;
- }
-
- if (oid_blob.length != ctr->mappings[j].oid.length) {
- data_blob_free(&oid_blob);
- return WERR_DS_DRA_SCHEMA_MISMATCH;
- }
-
- if (memcmp(ctr->mappings[i].oid.binary_oid, oid_blob.data, oid_blob.length) != 0) {
- data_blob_free(&oid_blob);
- return WERR_DS_DRA_SCHEMA_MISMATCH;
- }
-
- data_blob_free(&oid_blob);
-
- break;
- }
-
- if (j == schema->num_prefixes) {
- return WERR_DS_DRA_SCHEMA_MISMATCH;
- }
- }
- }
-
- return WERR_OK;
-}
WERROR dsdb_map_oid2int(const struct dsdb_schema *schema, const char *in, uint32_t *out)
{
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index 2c5aae024e..7120d61eed 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -426,7 +426,7 @@ static NTSTATUS vampire_schema_chunk(void *private_data,
s->schema = s->self_made_schema;
} else {
- status = dsdb_verify_oid_mappings_drsuapi(s->schema, mapping_ctr);
+ status = dsdb_schema_pfm_contains_drsuapi_pfm(s->schema->prefixmap, mapping_ctr);
if (!W_ERROR_IS_OK(status)) {
return werror_to_ntstatus(status);
}
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index fbdcd06cbf..319dd0aecd 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -400,7 +400,7 @@ static NTSTATUS test_become_dc_schema_chunk(void *private_data,
s->schema = s->self_made_schema;
} else {
- status = dsdb_verify_oid_mappings_drsuapi(s->schema, mapping_ctr);
+ status = dsdb_schema_pfm_contains_drsuapi_pfm(s->schema->prefixmap, mapping_ctr);
if (!W_ERROR_IS_OK(status)) {
return werror_to_ntstatus(status);
}