mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4:provison Add prefixes to ldb using same code a later modify will use
This allows us to test out the code that will do the modify of the prefixMap, and to provide the bindings that may assist a future upgrade script. Andrew Bartlett
This commit is contained in:
@ -239,6 +239,9 @@ class Ldb(ldb.Ldb):
|
||||
def set_schema_from_ldb(self, ldb):
|
||||
glue.dsdb_set_schema_from_ldb(self, ldb)
|
||||
|
||||
def write_prefixes_from_schema(self):
|
||||
glue.dsdb_write_prefixes_from_schema_to_ldb(self)
|
||||
|
||||
def convert_schema_to_openldap(self, target, mapping):
|
||||
return glue.dsdb_convert_schema_to_openldap(self, target, mapping)
|
||||
|
||||
|
@ -151,18 +151,21 @@ class Schema(object):
|
||||
self.schema_data += open(setup_path("schema_samba4.ldif"), 'r').read()
|
||||
self.schema_data = substitute_var(self.schema_data, {"SCHEMADN": schemadn})
|
||||
check_all_substituted(self.schema_data)
|
||||
prefixmap = open(setup_path("prefixMap.txt"), 'r').read()
|
||||
prefixmap = b64encode(prefixmap)
|
||||
|
||||
|
||||
self.schema_dn_modify = read_and_sub_file(setup_path("provision_schema_basedn_modify.ldif"),
|
||||
{"SCHEMADN": schemadn,
|
||||
"PREFIXMAP_B64": prefixmap,
|
||||
"SERVERDN": serverdn,
|
||||
})
|
||||
self.schema_dn_add = read_and_sub_file(setup_path("provision_schema_basedn.ldif"),
|
||||
{"SCHEMADN": schemadn
|
||||
})
|
||||
self.ldb.set_schema_from_ldif(self.schema_dn_modify, self.schema_data)
|
||||
|
||||
prefixmap = open(setup_path("prefixMap.txt"), 'r').read()
|
||||
prefixmap = b64encode(prefixmap)
|
||||
|
||||
# We don't actually add this ldif, just parse it
|
||||
prefixmap_ldif = "dn: cn=schema\nprefixMap:: %s\n\n" % prefixmap
|
||||
self.ldb.set_schema_from_ldif(prefixmap_ldif, self.schema_data)
|
||||
|
||||
|
||||
def check_install(lp, session_info, credentials):
|
||||
@ -910,6 +913,7 @@ def setup_samdb(path, setup_path, session_info, credentials, lp,
|
||||
message("Setting up sam.ldb schema")
|
||||
samdb.add_ldif(schema.schema_dn_add)
|
||||
samdb.modify_ldif(schema.schema_dn_modify)
|
||||
samdb.write_prefixes_from_schema()
|
||||
samdb.add_ldif(schema.schema_data)
|
||||
setup_add_ldif(samdb, setup_path("aggregate_schema.ldif"),
|
||||
{"SCHEMADN": names.schemadn})
|
||||
|
Reference in New Issue
Block a user