Provision pach: make partitions only not erase others ldb
Matthieu Patou
mat+Informatique.Samba at matws.net
Sun Mar 1 17:31:45 GMT 2009
Dear all,
This is a proposal for making provision --partitions-only not wipping
out some tdb like secrets, idmap and templates.
As far I understand using --partitions-only should only touch sam.ldb in
order to changes the partitions and/or the modules list and a few other
options.
Until now the provision --partitions-only wipeout secrets,idmap and
template before setting up the partitions and then returning.
As it's one of my first patch chances are that it's won't be good
directly feel free to comment.
Matthieu.
-------------- next part --------------
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 91cc074..c99b467 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1004,23 +1004,23 @@ def provision(setup_dir, message, session_info,
credentials=credentials, lp=lp)
share_ldb.load_ldif_file_add(setup_path("share.ldif"))
-
- message("Setting up secrets.ldb")
- secrets_ldb = setup_secretsdb(paths.secrets, setup_path,
- session_info=session_info,
- credentials=credentials, lp=lp)
-
- message("Setting up the registry")
- setup_registry(paths.hklm, setup_path, session_info,
- credentials=credentials, lp=lp)
-
- message("Setting up templates db")
- setup_templatesdb(paths.templates, setup_path, session_info=session_info,
- credentials=credentials, lp=lp)
-
- message("Setting up idmap db")
- idmap = setup_idmapdb(paths.idmapdb, setup_path, session_info=session_info,
+ if samdb_fill != FILL_DRS:
+ message("Setting up secrets.ldb")
+ secrets_ldb = setup_secretsdb(paths.secrets, setup_path,
+ session_info=session_info,
+ credentials=credentials, lp=lp)
+
+ message("Setting up the registry")
+ setup_registry(paths.hklm, setup_path, session_info,
+ credentials=credentials, lp=lp)
+
+ message("Setting up templates db")
+ setup_templatesdb(paths.templates, setup_path, session_info=session_info,
credentials=credentials, lp=lp)
+
+ message("Setting up idmap db")
+ idmap = setup_idmapdb(paths.idmapdb, setup_path, session_info=session_info,
+ credentials=credentials, lp=lp)
samdb = setup_samdb(paths.samdb, setup_path, session_info=session_info,
credentials=credentials, lp=lp, names=names,
@@ -1034,7 +1034,7 @@ def provision(setup_dir, message, session_info,
serverrole=serverrole, ldap_backend=ldap_backend,
ldap_backend_type=ldap_backend_type)
- if lp.get("server role") == "domain controller":
+ if lp.get("server role") == "domain controller" and smbdb_fill != FILL_DRS:
if paths.netlogon is None:
message("Existing smb.conf does not have a [netlogon] share, but you are configuring a DC.")
message("Please either remove %s or see the template at %s" %
More information about the samba-technical
mailing list