summaryrefslogtreecommitdiff
path: root/source4/setup/provision
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-07 01:09:41 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-07 02:45:36 +0100
commitf2903e0c4f9fc3931415144e72b6b898c4fdbf49 (patch)
tree5caf49d7cfddfcb46dd601e717ed8471eba34c2d /source4/setup/provision
parent8dca1a022242d69e6d35c10ddb796081a6b497a2 (diff)
downloadsamba-f2903e0c4f9fc3931415144e72b6b898c4fdbf49.tar.gz
samba-f2903e0c4f9fc3931415144e72b6b898c4fdbf49.tar.bz2
samba-f2903e0c4f9fc3931415144e72b6b898c4fdbf49.zip
provision: Make sure target directory is created early.
This is necessary when using the target directory to store temporary files. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Tue Feb 7 02:45:37 CET 2012 on sn-devel-104
Diffstat (limited to 'source4/setup/provision')
-rwxr-xr-xsource4/setup/provision20
1 files changed, 13 insertions, 7 deletions
diff --git a/source4/setup/provision b/source4/setup/provision
index 80237058e4..a2327b339e 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -218,6 +218,10 @@ if opts.blank:
elif opts.partitions_only:
samdb_fill = FILL_DRS
+if opts.targetdir is not None:
+ if not os.path.isdir(opts.targetdir):
+ os.mkdir(opts.targetdir)
+
eadb = True
if opts.use_xattrs == "yes":
eadb = False
@@ -227,13 +231,15 @@ elif opts.use_xattrs == "auto" and not lp.get("posix:eadb"):
else:
file = tempfile.NamedTemporaryFile(dir=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")
- eadb = False
- except Exception:
- logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. "
- "If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
- file.close()
+ try:
+ samba.ntacls.setntacl(lp, file.name,
+ "O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")
+ eadb = False
+ except Exception:
+ logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. "
+ "If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
+ finally:
+ file.close()
session = system_session()
try: