summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-05-07 17:06:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-05-08 04:51:59 +0200
commit0678eb6cdfa19f27de8093eee2a15b7493bbce67 (patch)
tree3fd1e86ee861b1f20a6b61b104d762db92c0c86a /source4/scripting/python
parent859aa43f7348e721a6ce0417d300d9db8086fc7b (diff)
downloadsamba-0678eb6cdfa19f27de8093eee2a15b7493bbce67.tar.gz
samba-0678eb6cdfa19f27de8093eee2a15b7493bbce67.tar.bz2
samba-0678eb6cdfa19f27de8093eee2a15b7493bbce67.zip
s4-provision Ensure we have posix ACLs before we permit a s3fs-based Samba4 to be configured
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index a60c05a677..db98d5146f 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -38,11 +38,13 @@ import uuid
import socket
import urllib
import string
+import tempfile
import ldb
from samba.auth import system_session, admin_session
import samba
+from samba.samba3 import smbd
from samba.dsdb import DS_DOMAIN_FUNCTION_2000
from samba import (
Ldb,
@@ -1658,6 +1660,18 @@ 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