summaryrefslogtreecommitdiff
path: root/source4/setup/provision
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-10-14 11:22:20 +0200
committerMatthieu Patou <mat@matws.net>2011-10-16 00:01:36 +0200
commita1767f74afc0037d188a8ed578ce68a7e3cd07f3 (patch)
treeb597f6cd903e932258e2d74299ed251399edb4c2 /source4/setup/provision
parente02f9510d039242ac012658aa67e235c68d45fe1 (diff)
downloadsamba-a1767f74afc0037d188a8ed578ce68a7e3cd07f3.tar.gz
samba-a1767f74afc0037d188a8ed578ce68a7e3cd07f3.tar.bz2
samba-a1767f74afc0037d188a8ed578ce68a7e3cd07f3.zip
s4: check that the xattr are supported in the folder where we want to provision
By default we were checking this on the default folder for tempfile.NamedTemporaryFile (usualy /tmp) but this folder can be mounted on tmpfs (which didn't support xattr currently). Now we should check on the filesystem where the provision will be done.
Diffstat (limited to 'source4/setup/provision')
-rwxr-xr-xsource4/setup/provision6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/setup/provision b/source4/setup/provision
index d05af51fa3..94c5be3db8 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -32,6 +32,7 @@ sys.path.insert(0, "bin/python")
import samba
import samba.ntacls
+import os
from samba.credentials import DONT_USE_KERBEROS
from samba.auth import system_session
import samba.getopt as options
@@ -226,7 +227,10 @@ eadb = True
if opts.use_xattrs == "yes":
eadb = False
elif opts.use_xattrs == "auto" and not lp.get("posix:eadb"):
- file = tempfile.NamedTemporaryFile()
+ if opts.targetdir:
+ file = tempfile.NamedTemporaryFile(prefix=os.path.abspath(opts.targetdir))
+ else:
+ file = tempfile.NamedTemporaryFile(prefix=os.path.abspath(os.path.dirname(lp.get("private dir"))))
try:
samba.ntacls.setntacl(lp, file.name,
"O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")