summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-05 09:58:41 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-05 04:27:36 +0200
commitdc799d4b42551842a9c1dc863568611d82c6168d (patch)
treea75765a0a524c4698eef479b5fbd330ef68ca3ca /source4/scripting
parentd2b635cc2f031364be1f25a7f8fb897a78764e5c (diff)
downloadsamba-dc799d4b42551842a9c1dc863568611d82c6168d.tar.gz
samba-dc799d4b42551842a9c1dc863568611d82c6168d.tar.bz2
samba-dc799d4b42551842a9c1dc863568611d82c6168d.zip
s4-provision: Test for posix ACLs in the actual sysvol path
This avoids issues in the previous location where lp may not be initialised at this point and instead simply waits until we have a known sysvol path, and test for ACL support there. Andrew Bartlett
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index a84bb5b7ea..5f64d773e3 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -1661,18 +1661,6 @@ def provision(logger, session_info, credentials, smbconf=None,
server_services.append("+s3fs")
global_param["dcerpc endpoint servers"] = ["-winreg", "-srvsvc"]
- if targetdir is not None:
- file = tempfile.NamedTemporaryFile(dir=os.path.abspath(targetdir))
- else:
- file = tempfile.NamedTemporaryFile(dir=os.path.abspath(os.path.dirname(lp.get("private dir"))))
- try:
- try:
- smbd.set_simple_acl(file.name, root_uid, wheel_gid)
- except Exception:
- raise ProvisioningError("Your filesystem or build does not support posix ACLs, s3fs is unworkable in this mode")
- finally:
- file.close()
-
if len(server_services) > 0:
global_param["server services"] = server_services
@@ -1744,6 +1732,22 @@ def provision(logger, session_info, credentials, smbconf=None,
if not os.path.exists(paths.state_dir):
os.mkdir(paths.state_dir)
+ if paths.sysvol and not os.path.exists(paths.sysvol):
+ os.makedirs(paths.sysvol, 0775)
+
+ if not use_ntvfs and serverrole == "domain controller":
+ if paths.sysvol is None:
+ raise MissingShareError("sysvol", paths.smbconf)
+
+ file = tempfile.NamedTemporaryFile(dir=os.path.abspath(paths.sysvol))
+ try:
+ try:
+ smbd.set_simple_acl(file.name, root_uid, wheel_gid)
+ except Exception:
+ raise ProvisioningError("Your filesystem or build does not support posix ACLs, s3fs is unworkable in this mode")
+ finally:
+ file.close()
+
ldapi_url = "ldapi://%s" % urllib.quote(paths.s4_ldapi_path, safe="")
schema = Schema(domainsid, invocationid=invocationid,