diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-11-11 16:35:59 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-15 09:46:27 +0100 |
commit | 75ae19422b2b405cabe269c29afb61a1b50636d1 (patch) | |
tree | e6ca4fc28108dab7edf126ff3563870a9d9fc179 | |
parent | e6a9e1dda920d83c2926061e331d52aa9e9d0871 (diff) | |
download | samba-75ae19422b2b405cabe269c29afb61a1b50636d1.tar.gz samba-75ae19422b2b405cabe269c29afb61a1b50636d1.tar.bz2 samba-75ae19422b2b405cabe269c29afb61a1b50636d1.zip |
s4:dsdb/schema: pass and remember the schema_dn in dsdb_set_schema_from_ldif()
metze
-rw-r--r-- | source4/dsdb/pydsdb.c | 2 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_set.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 62b5c8db83..3c7c8bfaa1 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -838,7 +838,7 @@ static PyObject *py_dsdb_set_schema_from_ldif(PyObject *self, PyObject *args) PyErr_LDB_OR_RAISE(py_ldb, ldb); - result = dsdb_set_schema_from_ldif(ldb, pf, df); + result = dsdb_set_schema_from_ldif(ldb, pf, df, dn); PyErr_WERROR_IS_ERR_RAISE(result); Py_RETURN_NONE; diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 18f3ab7b7c..6f735db486 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -683,7 +683,9 @@ WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_sche * schema itself to the directory. */ -WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const char *df) +WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, + const char *pf, const char *df, + const char *dn) { struct ldb_ldif *ldif; struct ldb_message *msg; @@ -702,9 +704,15 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const } schema = dsdb_new_schema(mem_ctx); - + if (!schema) { + goto nomem; + } + schema->base_dn = ldb_dn_new(schema, ldb, dn); + if (!schema->base_dn) { + goto nomem; + } schema->fsmo.we_are_master = true; - schema->fsmo.master_dn = ldb_dn_new_fmt(schema, ldb, "@PROVISION_SCHEMA_MASTER"); + schema->fsmo.master_dn = ldb_dn_new(schema, ldb, "@PROVISION_SCHEMA_MASTER"); if (!schema->fsmo.master_dn) { goto nomem; } |