mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
s4:dsdb/pydsdb: pass down schema_dn to _dsdb_set_schema_from_ldif()
metze
This commit is contained in:
parent
18eba021e7
commit
e6a9e1dda9
@ -829,11 +829,11 @@ static PyObject *py_dsdb_set_am_rodc(PyObject *self, PyObject *args)
|
||||
static PyObject *py_dsdb_set_schema_from_ldif(PyObject *self, PyObject *args)
|
||||
{
|
||||
WERROR result;
|
||||
char *pf, *df;
|
||||
char *pf, *df, *dn;
|
||||
PyObject *py_ldb;
|
||||
struct ldb_context *ldb;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "Oss", &py_ldb, &pf, &df))
|
||||
if (!PyArg_ParseTuple(args, "Osss", &py_ldb, &pf, &df, &dn))
|
||||
return NULL;
|
||||
|
||||
PyErr_LDB_OR_RAISE(py_ldb, ldb);
|
||||
|
@ -1101,7 +1101,8 @@ def reload_full_schema(samdb, names):
|
||||
:param names: List of key provision parameters
|
||||
"""
|
||||
|
||||
current = samdb.search(expression="objectClass=*", base=str(names.schemadn),
|
||||
schemadn = str(names.schemadn)
|
||||
current = samdb.search(expression="objectClass=*", base=schemadn,
|
||||
scope=SCOPE_SUBTREE)
|
||||
schema_ldif = ""
|
||||
prefixmap_data = ""
|
||||
@ -1113,9 +1114,9 @@ def reload_full_schema(samdb, names):
|
||||
prefixmap_data = b64encode(prefixmap_data)
|
||||
|
||||
# We don't actually add this ldif, just parse it
|
||||
prefixmap_ldif = "dn: cn=schema\nprefixMap:: %s\n\n" % prefixmap_data
|
||||
prefixmap_ldif = "dn: %s\nprefixMap:: %s\n\n" % (schemadn, prefixmap_data)
|
||||
|
||||
dsdb._dsdb_set_schema_from_ldif(samdb, prefixmap_ldif, schema_ldif)
|
||||
dsdb._dsdb_set_schema_from_ldif(samdb, prefixmap_ldif, schema_ldif, schemadn)
|
||||
|
||||
|
||||
def update_partition(ref_samdb, samdb, basedn, names, schema, provisionUSNs, prereloadfunc):
|
||||
|
@ -120,7 +120,7 @@ class Schema(object):
|
||||
self.set_from_ldif(prefixmap_ldif, self.schema_data, self.schemadn)
|
||||
|
||||
def set_from_ldif(self, pf, df, dn):
|
||||
dsdb._dsdb_set_schema_from_ldif(self.ldb, pf, df)
|
||||
dsdb._dsdb_set_schema_from_ldif(self.ldb, pf, df, dn)
|
||||
|
||||
def write_to_tmp_ldb(self, schemadb_path):
|
||||
self.ldb.connect(url=schemadb_path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user