summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Syrovenko <andriys@gmail.com>2012-06-05 01:32:42 +0300
committerAndrew Bartlett <abartlet@samba.org>2012-06-05 04:27:36 +0200
commit1a2b65cd31243f36f2a0a63bdad7f6d6f39afc1d (patch)
tree2e174203f725a1aac19a73c2940310bba694eee1
parent9db04c481d981ee0ab285e0e34f32c49a7e84641 (diff)
downloadsamba-1a2b65cd31243f36f2a0a63bdad7f6d6f39afc1d.tar.gz
samba-1a2b65cd31243f36f2a0a63bdad7f6d6f39afc1d.tar.bz2
samba-1a2b65cd31243f36f2a0a63bdad7f6d6f39afc1d.zip
Add '--use-ntvfs' option to 'samba-tool domain join'
-rw-r--r--source4/scripting/python/samba/join.py17
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py13
2 files changed, 17 insertions, 13 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index fddb61b494..a683ee6963 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -47,12 +47,13 @@ class dc_join(object):
def __init__(ctx, server=None, creds=None, lp=None, site=None,
netbios_name=None, targetdir=None, domain=None,
- machinepass=None):
+ machinepass=None, use_ntvfs=False):
ctx.creds = creds
ctx.lp = lp
ctx.site = site
ctx.netbios_name = netbios_name
ctx.targetdir = targetdir
+ ctx.use_ntvfs = use_ntvfs
ctx.creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
ctx.net = Net(creds=ctx.creds, lp=ctx.lp)
@@ -595,7 +596,7 @@ class dc_join(object):
hostname=ctx.myname, domainsid=ctx.domsid,
machinepass=ctx.acct_pass, serverrole="domain controller",
sitename=ctx.site, lp=ctx.lp, ntdsguid=ctx.ntds_guid,
- dns_backend="NONE")
+ use_ntvfs=ctx.use_ntvfs, dns_backend="NONE")
print "Provision OK for domain DN %s" % presult.domaindn
ctx.local_samdb = presult.samdb
ctx.lp = presult.lp
@@ -882,11 +883,11 @@ class dc_join(object):
def join_RODC(server=None, creds=None, lp=None, site=None, netbios_name=None,
targetdir=None, domain=None, domain_critical_only=False,
- machinepass=None):
+ machinepass=None, use_ntvfs=False):
"""join as a RODC"""
ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, domain,
- machinepass)
+ machinepass, use_ntvfs)
lp.set("workgroup", ctx.domain_name)
print("workgroup is %s" % ctx.domain_name)
@@ -936,10 +937,10 @@ def join_RODC(server=None, creds=None, lp=None, site=None, netbios_name=None,
def join_DC(server=None, creds=None, lp=None, site=None, netbios_name=None,
targetdir=None, domain=None, domain_critical_only=False,
- machinepass=None):
+ machinepass=None, use_ntvfs=False):
"""join as a DC"""
ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, domain,
- machinepass)
+ machinepass, use_ntvfs)
lp.set("workgroup", ctx.domain_name)
print("workgroup is %s" % ctx.domain_name)
@@ -966,10 +967,10 @@ def join_DC(server=None, creds=None, lp=None, site=None, netbios_name=None,
def join_subdomain(server=None, creds=None, lp=None, site=None, netbios_name=None,
targetdir=None, parent_domain=None, dnsdomain=None, netbios_domain=None,
- machinepass=None):
+ machinepass=None, use_ntvfs=False):
"""join as a DC"""
ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, parent_domain,
- machinepass)
+ machinepass, use_ntvfs)
ctx.subdomain = True
ctx.parent_domain_name = ctx.domain_name
ctx.domain_name = netbios_domain
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index a53c06acd9..02b30c35b3 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -146,14 +146,17 @@ class cmd_domain_join(Command):
help="only replicate critical domain objects",
action="store_true"),
Option("--machinepass", type=str, metavar="PASSWORD",
- help="choose machine password (otherwise random)")
+ help="choose machine password (otherwise random)"),
+ Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)",
+ action="store_true")
]
takes_args = ["domain", "role?"]
def run(self, domain, role=None, sambaopts=None, credopts=None,
versionopts=None, server=None, site=None, targetdir=None,
- domain_critical_only=False, parent_domain=None, machinepass=None):
+ domain_critical_only=False, parent_domain=None, machinepass=None,
+ use_ntvfs=False):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
net = Net(creds, lp, server=credopts.ipaddress)
@@ -178,13 +181,13 @@ class cmd_domain_join(Command):
join_DC(server=server, creds=creds, lp=lp, domain=domain,
site=site, netbios_name=netbios_name, targetdir=targetdir,
domain_critical_only=domain_critical_only,
- machinepass=machinepass)
+ machinepass=machinepass, use_ntvfs=use_ntvfs)
return
elif role == "RODC":
join_RODC(server=server, creds=creds, lp=lp, domain=domain,
site=site, netbios_name=netbios_name, targetdir=targetdir,
domain_critical_only=domain_critical_only,
- machinepass=machinepass)
+ machinepass=machinepass, use_ntvfs=use_ntvfs)
return
elif role == "SUBDOMAIN":
netbios_domain = lp.get("workgroup")
@@ -192,7 +195,7 @@ class cmd_domain_join(Command):
parent_domain = ".".join(domain.split(".")[1:])
join_subdomain(server=server, creds=creds, lp=lp, dnsdomain=domain, parent_domain=parent_domain,
site=site, netbios_name=netbios_name, netbios_domain=netbios_domain, targetdir=targetdir,
- machinepass=machinepass)
+ machinepass=machinepass, use_ntvfs=use_ntvfs)
return
else:
raise CommandError("Invalid role '%s' (possible values: MEMBER, DC, RODC, SUBDOMAIN)" % role)