summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_syntax.c
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-08-17 03:21:46 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-08-19 03:34:01 +0300
commitb7d1586ccd05a78a4fae512c54fa39dda408e08b (patch)
tree514e9262ea99d75d5c8fb69f14c642e6f72816bf /source4/dsdb/schema/schema_syntax.c
parent20a8481d3ff149e3cece6f2d8d2cf6ae8462d11a (diff)
downloadsamba-b7d1586ccd05a78a4fae512c54fa39dda408e08b.tar.gz
s4-dsdb: Add context structure for dsdb_syntax conversion functions
This structure is intended to hold context-dependent data. Syntax-conversion and object-conversion functions need that data to convert objects and attributes from drs-to-ldb and ldb-to-drs correctly. For instance: ATTID value depends on whether we are converting object from partition different that Schema partition.
Diffstat (limited to 'source4/dsdb/schema/schema_syntax.c')
-rw-r--r--source4/dsdb/schema/schema_syntax.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 193d62dfcca..a6593b4f785 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -31,6 +31,19 @@
#include "../lib/util/charset/charset.h"
#include "librpc/ndr/libndr.h"
+/**
+ * Initialize dsdb_syntax_ctx with default values
+ * for common cases.
+ */
+void dsdb_syntax_ctx_init(struct dsdb_syntax_ctx *ctx,
+ struct ldb_context *ldb,
+ const struct dsdb_schema *schema)
+{
+ ctx->ldb = ldb;
+ ctx->schema = schema;
+}
+
+
static WERROR dsdb_syntax_FOOBAR_drsuapi_to_ldb(struct ldb_context *ldb,
const struct dsdb_schema *schema,
const struct dsdb_attribute *attr,