diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/netcmd/domain.py | 5 | ||||
-rwxr-xr-x | source4/setup/provision | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index ce9d7d8682..3906d69a2d 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -591,7 +591,10 @@ class cmd_domain_samba3upgrade(Command): if use_xattrs == "yes": eadb = False elif use_xattrs == "auto" and not s3conf.get("posix:eadb"): - tmpfile = tempfile.NamedTemporaryFile() + if targetdir: + tmpfile = tempfile.NamedTemporaryFile(prefix=os.path.abspath(targetdir)) + else: + tmpfile = tempfile.NamedTemporaryFile(prefix=os.path.abspath(os.path.dirname(lp.get("private dir")))) try: samba.ntacls.setntacl(lp, tmpfile.name, "O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native") 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") |