mirror of
https://github.com/samba-team/samba.git
synced 2025-02-18 17:57:55 +03:00
Far less cryptic traceback when you have an existing smb.conf
When the user has an existing smb.conf, but no [netlogon] or [sysvol] share, the provision script would trigger a traceback. While we still need to abort in this situation, we do so now with a useful error. Andrew Bartlett (This used to be commit 10a8b7ea487f9725f69b02c4dd9cf5e1f67a23ab)
This commit is contained in:
parent
67faa71c5b
commit
393007315d
@ -87,6 +87,7 @@ class ProvisionNames:
|
|||||||
self.domain = None
|
self.domain = None
|
||||||
self.hostname = None
|
self.hostname = None
|
||||||
self.sitename = None
|
self.sitename = None
|
||||||
|
self.smbconf = None
|
||||||
|
|
||||||
class ProvisionResult:
|
class ProvisionResult:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -262,6 +263,8 @@ def provision_paths_from_lp(lp, dnsdomain):
|
|||||||
|
|
||||||
paths.netlogon = lp.get("path", "netlogon")
|
paths.netlogon = lp.get("path", "netlogon")
|
||||||
|
|
||||||
|
paths.smbconf = lp.configfile()
|
||||||
|
|
||||||
return paths
|
return paths
|
||||||
|
|
||||||
|
|
||||||
@ -1009,12 +1012,24 @@ def provision(setup_dir, message, session_info,
|
|||||||
ldap_backend_type=ldap_backend_type)
|
ldap_backend_type=ldap_backend_type)
|
||||||
|
|
||||||
if lp.get("server role") == "domain controller":
|
if lp.get("server role") == "domain controller":
|
||||||
policy_path = os.path.join(paths.sysvol, names.dnsdomain, "Policies",
|
if paths.netlogon is None:
|
||||||
"{" + policyguid + "}")
|
message("Existing smb.conf does not have a [netlogon] share, but you are configuring a DC.")
|
||||||
os.makedirs(policy_path, 0755)
|
message("Please either remove %s or see the template at %s" %
|
||||||
os.makedirs(os.path.join(policy_path, "Machine"), 0755)
|
( paths.smbconf, setup_path("provision.smb.conf.dc")))
|
||||||
os.makedirs(os.path.join(policy_path, "User"), 0755)
|
assert(paths.netlogon is not None)
|
||||||
if not os.path.isdir(paths.netlogon):
|
|
||||||
|
if paths.sysvol is None:
|
||||||
|
message("Existing smb.conf does not have a [sysvol] share, but you are configuring a DC.")
|
||||||
|
message("Please either remove %s or see the template at %s" %
|
||||||
|
(paths.smbconf, setup_path("provision.smb.conf.dc")))
|
||||||
|
assert(paths.sysvol is not None)
|
||||||
|
|
||||||
|
policy_path = os.path.join(paths.sysvol, names.dnsdomain, "Policies",
|
||||||
|
"{" + policyguid + "}")
|
||||||
|
os.makedirs(policy_path, 0755)
|
||||||
|
os.makedirs(os.path.join(policy_path, "Machine"), 0755)
|
||||||
|
os.makedirs(os.path.join(policy_path, "User"), 0755)
|
||||||
|
if not os.path.isdir(paths.netlogon):
|
||||||
os.makedirs(paths.netlogon, 0755)
|
os.makedirs(paths.netlogon, 0755)
|
||||||
|
|
||||||
if samdb_fill == FILL_FULL:
|
if samdb_fill == FILL_FULL:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user