From aef1d45c9a3af5ac9a5f262604d1f364c397875c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Sep 2016 21:33:30 +1200 Subject: [PATCH] samba-tool: Remove --use-xattrs support without --use-ntvfs The only reasonable use --use-xattrs=no should be used is in selftest, and there is no need for that or --use-xattrs=auto without --use-ntvfs, all systems we support in production for the AD DC have xattrs, as using smbd needs posix ACLs. This also removes the option entirely if NTVFS support is omitted from the build. I would prefer to get rid of the option, but currently selftest relies on the default of --use-xattrs=auto, and we first should get rid of that auto-detection, which will then mean we need --use-xattrs=no specified wherever we specify --use-ntvfs. Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam Autobuild-User(master): Garming Sam Autobuild-Date(master): Tue Sep 6 04:21:42 CEST 2016 on sn-devel-144 --- python/samba/netcmd/domain.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 928caa3ffda..966182869a3 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -236,8 +236,6 @@ class cmd_domain_provision(Command): help="Set target directory"), Option("--ol-mmr-urls", type="string", metavar="LDAPSERVER", help="List of LDAP-URLS [ ldap://:/ (where has to be different than 389!) ] separated with comma (\",\") for use with OpenLDAP-MMR (Multi-Master-Replication), e.g.: \"ldap://s4dc1:9000,ldap://s4dc2:9000\""), - Option("--use-xattrs", type="choice", choices=["yes", "no", "auto"], help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"), - Option("--use-rfc2307", action="store_true", help="Use AD to store posix attributes (default = no)"), ] @@ -253,7 +251,13 @@ class cmd_domain_provision(Command): ] ntvfs_options = [ - Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + Option("--use-xattrs", type="choice", choices=["yes","no","auto"], + metavar="[yes|no|auto]", + help="Define if we should use the native fs capabilities or a tdb file for " + "storing attributes likes ntacl when --use-ntvfs is set. " + "auto tries to make an inteligent guess based on the user rights and system capabilities", + default="auto") ] if os.getenv('TEST_LDAP', "no") == "yes": @@ -409,6 +413,11 @@ class cmd_domain_provision(Command): if use_xattrs == "yes": eadb = False + elif use_xattrs == "auto" and use_ntvfs == False or use_ntvfs == None: + eadb = False + elif use_ntvfs == False or use_ntvfs == None: + raise CommandError("--use-xattrs=no requires --use-ntvfs (not supported for production use). " + "Please re-run with --use-xattrs omitted.") elif use_xattrs == "auto" and not lp.get("posix:eadb"): if targetdir: file = tempfile.NamedTemporaryFile(dir=os.path.abspath(targetdir)) @@ -1457,8 +1466,6 @@ class cmd_domain_classicupgrade(Command): help="Path prefix where the new Samba 4.0 AD domain should be initialised"), Option("--quiet", help="Be quiet", action="store_true"), Option("--verbose", help="Be verbose", action="store_true"), - Option("--use-xattrs", type="choice", choices=["yes","no","auto"], metavar="[yes|no|auto]", - help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"), Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND", choices=["SAMBA_INTERNAL", "BIND9_FLATFILE", "BIND9_DLZ", "NONE"], help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " @@ -1470,7 +1477,13 @@ class cmd_domain_classicupgrade(Command): ntvfs_options = [ Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", - action="store_true") + action="store_true"), + Option("--use-xattrs", type="choice", choices=["yes","no","auto"], + metavar="[yes|no|auto]", + help="Define if we should use the native fs capabilities or a tdb file for " + "storing attributes likes ntacl when --use-ntvfs is set. " + "auto tries to make an inteligent guess based on the user rights and system capabilities", + default="auto") ] if samba.is_ntvfs_fileserver_built(): takes_options.extend(ntvfs_options) @@ -1519,6 +1532,11 @@ class cmd_domain_classicupgrade(Command): eadb = True if use_xattrs == "yes": eadb = False + elif use_xattrs == "auto" and use_ntvfs == False or use_ntvfs == None: + eadb = False + elif use_ntvfs == False or use_ntvfs == None: + raise CommandError("--use-xattrs=no requires --use-ntvfs (not supported for production use). " + "Please re-run with --use-xattrs omitted.") elif use_xattrs == "auto" and not s3conf.get("posix:eadb"): if targetdir: tmpfile = tempfile.NamedTemporaryFile(dir=os.path.abspath(targetdir)) -- 2.11.4.GIT