diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-09 04:45:17 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-15 00:51:19 +0100 |
commit | afee8a28c408efd3323b9064929b00be6eb89815 (patch) | |
tree | b2e299c28e4a40a8c780d99ea2ff1853c6247e57 /source4 | |
parent | efcc3c0d796d66c5eddeabf5f8fe00769a17b72b (diff) | |
download | samba-afee8a28c408efd3323b9064929b00be6eb89815.tar.gz samba-afee8a28c408efd3323b9064929b00be6eb89815.tar.bz2 samba-afee8a28c408efd3323b9064929b00be6eb89815.zip |
s4-schema_syntax: Use remote prefixMap to map remote ATTID to local one
in dsdb_attribute_drsuapi_to_ldb() function.
drsuapi_DsReplicaAttribute *in parameter come from remote DC
so we can't rely on in->attid to map it directly to an
dsdb_attribute in our local schema cache
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index 2f8f9a5834..1c30065618 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -2642,17 +2642,25 @@ WERROR dsdb_attribute_drsuapi_to_ldb(struct ldb_context *ldb, { const struct dsdb_attribute *sa; struct dsdb_syntax_ctx syntax_ctx; + uint32_t attid_local; - sa = dsdb_attribute_by_attributeID_id(schema, in->attid); + /* use default syntax conversion context */ + dsdb_syntax_ctx_init(&syntax_ctx, ldb, schema); + syntax_ctx.pfm_remote = pfm_remote; + + /* map remote ATTID to local ATTID */ + if (!dsdb_syntax_attid_from_remote_attid(&syntax_ctx, mem_ctx, in->attid, &attid_local)) { + DEBUG(0,(__location__ "Error: Can't find local ATTID for 0x%08X\n", + in->attid)); + return WERR_FOOBAR; + } + + sa = dsdb_attribute_by_attributeID_id(schema, attid_local); if (!sa) { DEBUG(1,(__location__ ": Unknown attributeID_id 0x%08X\n", in->attid)); return WERR_FOOBAR; } - /* use default syntax conversion context */ - dsdb_syntax_ctx_init(&syntax_ctx, ldb, schema); - syntax_ctx.pfm_remote = pfm_remote; - return sa->syntax->drsuapi_to_ldb(&syntax_ctx, sa, in, mem_ctx, out); } |