samba-tool: Remove --use-xattrs support without --use-ntvfs
authorAndrew Bartlett <abartlet@samba.org>
Sun, 4 Sep 2016 09:33:30 +0000 (21:33 +1200)
committerGarming Sam <garming@samba.org>
Tue, 6 Sep 2016 02:21:42 +0000 (04:21 +0200)
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 <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Sep  6 04:21:42 CEST 2016 on sn-devel-144

python/samba/netcmd/domain.py

index 928caa3ffda66aa1358d8e62b3bb6dd6b4ae6505..966182869a38692671fa04901159d2b81bb9264d 100644 (file)
@@ -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://<FQHN>:<PORT>/  (where <PORT> 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))