summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-11-30 12:13:16 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-12-01 13:01:17 +0200
commit29f9249bd64a1873149e3857483c64b897deac13 (patch)
treec68892c20ae46772ce06e15023ae4a18c5dcfc58
parentcf8ffc37b42b9b880ba1a0058bd5d0ab984f82b6 (diff)
downloadsamba-29f9249bd64a1873149e3857483c64b897deac13.tar.gz
samba-29f9249bd64a1873149e3857483c64b897deac13.tar.bz2
samba-29f9249bd64a1873149e3857483c64b897deac13.zip
s4-dsdb/syntax: Implement Remote-ATTID to Local-ATTID mapping function
-rw-r--r--source4/dsdb/schema/schema_syntax.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 0d1d274519..9ef2e32d14 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -70,6 +70,41 @@ uint32_t dsdb_attribute_get_attid(const struct dsdb_attribute *attr,
return attr->attributeID_id;
}
+/**
+ * Map an ATTID from remote DC to a local ATTID
+ * using remote prefixMap
+ */
+static bool dsdb_syntax_attid_from_remote_attid(const struct dsdb_syntax_ctx *ctx,
+ TALLOC_CTX *mem_ctx,
+ uint32_t id_remote,
+ uint32_t *id_local)
+{
+ WERROR werr;
+ const char *oid;
+
+ /*
+ * map remote ATTID to local directly in case
+ * of no remote prefixMap (during provision for instance)
+ */
+ if (!ctx->pfm_remote) {
+ *id_local = id_remote;
+ return true;
+ }
+
+ werr = dsdb_schema_pfm_oid_from_attid(ctx->pfm_remote, id_remote, mem_ctx, &oid);
+ if (!W_ERROR_IS_OK(werr)) {
+ DEBUG(0,("ATTID->OID failed (%s) for: 0x%08X\n", win_errstr(werr), id_remote));
+ return false;
+ }
+
+ werr = dsdb_schema_pfm_attid_from_oid(ctx->schema->prefixmap, oid, id_local);
+ if (!W_ERROR_IS_OK(werr)) {
+ DEBUG(0,("OID->ATTID failed (%s) for: %s\n", win_errstr(werr), oid));
+ return false;
+ }
+
+ return true;
+}
static WERROR dsdb_syntax_FOOBAR_drsuapi_to_ldb(const struct dsdb_syntax_ctx *ctx,
const struct dsdb_attribute *attr,