summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-17 23:16:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:51:25 +0100
commit12a513b47b1a1f2adeb2cb2a10ac36d02dd44065 (patch)
treeffd350db11a507777686060b8288b038670f0768 /source4/scripting
parent57b8a8fd42f5d89f439fd9d0781bd8f561a84131 (diff)
downloadsamba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.tar.gz
samba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.tar.bz2
samba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.zip
r26518: Fix provision of registry using Python.
(This used to be commit 12eb38e553993b2726a803af4ae9c05229d6ebe4)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision.py40
1 files changed, 26 insertions, 14 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index d88b8501ba..d9863420b6 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -287,11 +287,15 @@ def provision_default_paths(lp, subobj):
paths.keytab = os.path.join(private_dir, "secrets.keytab")
paths.dns = os.path.join(private_dir, subobj.dnsdomain + ".zone")
paths.winsdb = os.path.join(private_dir, "wins.ldb")
- paths.ldap_basedn_ldif = os.path.join(private_dir, subobj.dnsdomain + ".ldif")
- paths.ldap_config_basedn_ldif = os.path.join(private_dir, subobj.dnsdomain + "-config.ldif")
- paths.ldap_schema_basedn_ldif = os.path.join(private_dir, subobj.dnsdomain + "-schema.ldif")
+ paths.ldap_basedn_ldif = os.path.join(private_dir,
+ subobj.dnsdomain + ".ldif")
+ paths.ldap_config_basedn_ldif = os.path.join(private_dir,
+ subobj.dnsdomain + "-config.ldif")
+ paths.ldap_schema_basedn_ldif = os.path.join(private_dir,
+ subobj.dnsdomain + "-schema.ldif")
paths.s4_ldapi_path = os.path.join(private_dir, "ldapi")
- paths.phpldapadminconfig = os.path.join(private_dir, "phpldapadmin-config.php")
+ paths.phpldapadminconfig = os.path.join(private_dir,
+ "phpldapadmin-config.php")
paths.hklm = os.path.join(private_dir, "hklm.ldb")
return paths
@@ -370,8 +374,8 @@ def provision_become_dc(setup_dir, subobj, message, paths, lp, session_info,
setup_ldb(setup_dir, "secrets_init.ldif", session_info, credentials,
subobj, lp, paths.secrets)
- setup_ldb(setup_dir, "secrets.ldif", session_info, credentials, subobj, lp,
- paths.secrets, False)
+ setup_ldb(setup_dir, "secrets.ldif", session_info, credentials, subobj,
+ lp, paths.secrets, False)
def provision(lp, setup_dir, subobj, message, blank, paths, session_info,
@@ -397,26 +401,34 @@ def provision(lp, setup_dir, subobj, message, blank, paths, session_info,
# only install a new smb.conf if there isn't one there already
if not os.path.exists(paths.smbconf):
message("Setting up smb.conf")
- setup_file(setup_dir, "provision.smb.conf", message, paths.smbconf, subobj)
+ setup_file(setup_dir, "provision.smb.conf", message, paths.smbconf,
+ subobj)
lp.reload()
# only install a new shares config db if there is none
if not os.path.exists(paths.shareconf):
message("Setting up share.ldb")
- setup_ldb(setup_dir, "share.ldif", session_info, credentials, subobj, lp, paths.shareconf)
+ setup_ldb(setup_dir, "share.ldif", session_info, credentials, subobj,
+ lp, paths.shareconf)
message("Setting up %s" % paths.secrets)
- setup_ldb(setup_dir, "secrets_init.ldif", session_info, credentials, subobj, lp, paths.secrets)
- setup_ldb(setup_dir, "secrets.ldif", session_info, credentials, subobj, lp, paths.secrets, False)
+ setup_ldb(setup_dir, "secrets_init.ldif", session_info, credentials,
+ subobj, lp, paths.secrets)
+ setup_ldb(setup_dir, "secrets.ldif", session_info, credentials, subobj,
+ lp, paths.secrets, False)
message("Setting up registry")
reg = registry.Registry()
- # FIXME: Still fails for some reason:
- #reg.mount(paths.hklm, registry.HKEY_LOCAL_MACHINE, [])
- #reg.apply_patchfile(os.path.join(setup_dir, "provision.reg"))
+ hive = registry.Hive(paths.hklm, session_info=session_info,
+ credentials=credentials, lp_ctx=lp)
+ reg.mount_hive(hive, registry.HKEY_LOCAL_MACHINE, [])
+ provision_reg = os.path.join(setup_dir, "provision.reg")
+ assert os.path.exists(provision_reg)
+ reg.apply_patchfile(provision_reg)
message("Setting up templates into %s" % paths.templates)
- setup_ldb(setup_dir, "provision_templates.ldif", session_info, credentials, subobj, lp, paths.templates)
+ setup_ldb(setup_dir, "provision_templates.ldif", session_info,
+ credentials, subobj, lp, paths.templates)
message("Setting up sam.ldb partitions")
setup_ldb(setup_dir, "provision_partitions.ldif", session_info,