diff options
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 31 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 10 | ||||
-rw-r--r-- | source4/libnet/libnet_vampire.c | 3 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_BecomeDC.c | 3 |
4 files changed, 15 insertions, 32 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 1d2363bfa6..ba14d378c1 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -158,28 +158,6 @@ WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema, } -WERROR dsdb_map_int2oid(const struct dsdb_schema *schema, uint32_t in, TALLOC_CTX *mem_ctx, const char **out) -{ - uint32_t i; - - for (i=0; i < schema->num_prefixes; i++) { - const char *val; - if (schema->prefixes[i].id != (in & 0xFFFF0000)) { - continue; - } - - val = talloc_asprintf(mem_ctx, "%s.%u", - schema->prefixes[i].oid, - in & 0xFFFF); - W_ERROR_HAVE_NO_MEMORY(val); - - *out = val; - return WERR_OK; - } - - return WERR_DS_NO_MSDS_INTID; -} - /* * this function is called from within a ldb transaction from the schema_fsmo module */ @@ -1181,7 +1159,8 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb, GET_STRING_DS(schema, r, "name", mem_ctx, attr, cn, true); GET_STRING_DS(schema, r, "lDAPDisplayName", mem_ctx, attr, lDAPDisplayName, true); GET_UINT32_DS(schema, r, "attributeID", attr, attributeID_id); - status = dsdb_map_int2oid(schema, attr->attributeID_id, mem_ctx, &attr->attributeID_oid); + status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, attr->attributeID_id, + mem_ctx, &attr->attributeID_oid); if (!W_ERROR_IS_OK(status)) { DEBUG(0,("%s: '%s': unable to map attributeID 0x%08X: %s\n", __location__, attr->lDAPDisplayName, attr->attributeID_id, @@ -1199,7 +1178,8 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb, GET_UINT32_DS(schema, r, "linkID", attr, linkID); GET_UINT32_DS(schema, r, "attributeSyntax", attr, attributeSyntax_id); - status = dsdb_map_int2oid(schema, attr->attributeSyntax_id, mem_ctx, &attr->attributeSyntax_oid); + status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, attr->attributeSyntax_id, + mem_ctx, &attr->attributeSyntax_oid); if (!W_ERROR_IS_OK(status)) { DEBUG(0,("%s: '%s': unable to map attributeSyntax 0x%08X: %s\n", __location__, attr->lDAPDisplayName, attr->attributeSyntax_id, @@ -1247,7 +1227,8 @@ WERROR dsdb_class_from_drsuapi(struct dsdb_schema *schema, GET_STRING_DS(schema, r, "name", mem_ctx, obj, cn, true); GET_STRING_DS(schema, r, "lDAPDisplayName", mem_ctx, obj, lDAPDisplayName, true); GET_UINT32_DS(schema, r, "governsID", obj, governsID_id); - status = dsdb_map_int2oid(schema, obj->governsID_id, mem_ctx, &obj->governsID_oid); + status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, obj->governsID_id, + mem_ctx, &obj->governsID_oid); if (!W_ERROR_IS_OK(status)) { DEBUG(0,("%s: '%s': unable to map governsID 0x%08X: %s\n", __location__, obj->lDAPDisplayName, obj->governsID_id, diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index f656728a54..65baaeb070 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -684,9 +684,9 @@ static WERROR _dsdb_syntax_OID_oid_drsuapi_to_ldb(struct ldb_context *ldb, W_ERROR_HAVE_NO_MEMORY(out->values); for (i=0; i < out->num_values; i++) { - uint32_t v; + uint32_t attid; WERROR status; - const char *str; + const char *oid; if (in->value_ctr.values[i].blob == NULL) { return WERR_FOOBAR; @@ -696,12 +696,12 @@ static WERROR _dsdb_syntax_OID_oid_drsuapi_to_ldb(struct ldb_context *ldb, return WERR_FOOBAR; } - v = IVAL(in->value_ctr.values[i].blob->data, 0); + attid = IVAL(in->value_ctr.values[i].blob->data, 0); - status = dsdb_map_int2oid(schema, v, out->values, &str); + status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, attid, out->values, &oid); W_ERROR_NOT_OK_RETURN(status); - out->values[i] = data_blob_string_const(str); + out->values[i] = data_blob_string_const(oid); } return WERR_OK; diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 7120d61eed..f7131c1d02 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -226,7 +226,8 @@ static NTSTATUS vampire_apply_schema(struct vampire_state *s, const char *oid = NULL; a = &cur->object.attribute_ctr.attributes[i]; - status = dsdb_map_int2oid(s->self_made_schema, a->attid, s, &oid); + status = dsdb_schema_pfm_oid_from_attid(s->self_made_schema->prefixmap, + a->attid, s, &oid); 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 319dd0aecd..342463875d 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -190,7 +190,8 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s, const char *oid = NULL; a = &cur->object.attribute_ctr.attributes[i]; - status = dsdb_map_int2oid(s->self_made_schema, a->attid, s, &oid); + status = dsdb_schema_pfm_oid_from_attid(s->self_made_schema->prefixmap, + a->attid, s, &oid); if (!W_ERROR_IS_OK(status)) { return werror_to_ntstatus(status); } |