Web lists-archives.com

Re: [Samba] classic upgrade fails with 4.6-test




On Sun, 2017-01-29 at 22:43 +0000, Rowland Penny via samba wrote:
> On Sun, 29 Jan 2017 17:07:39 -0500
> Sonic <sonicsmith@xxxxxxxxx> wrote:
> 
> > On Sun, Jan 29, 2017 at 4:54 PM, Rowland Penny <rpenny@xxxxxxxxx>
> > wrote:
> > 
> > > When you built Samba, did you use the '--with-ntvfs-fileserver'
> > > or
> > > '--enable-selftest' options with configure ?
> > > 
> > 
> > I used '--without-ntvfs-fileserver'.
> 
> OK, this is the code that is producing the error:

Thanks for the analysis!

I think the attached should fix it.  I've filed a bug for it so we get
it into 4.6.

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
From 08edb5a93e79f02630e37b27b04a214b20129b76 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet@xxxxxxxxx>
Date: Mon, 30 Jan 2017 15:34:09 +1300
Subject: [PATCH] samba-tool: Correct handling of default value for use_ntvfs
 and use_xattrs

Because these options are optional based on build-time rules, we need to encode the
default value from the additonal Option() blocks in the run() declaration.

Then we can correctly check only for the expected options, and not inconsistently for
None (causing classicupgrade to fail).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12543
Signed-off-by: Andrew Bartlett <abartlet@xxxxxxxxx>
---
 python/samba/netcmd/domain.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
index 9661828..b4081e6 100644
--- a/python/samba/netcmd/domain.py
+++ b/python/samba/netcmd/domain.py
@@ -298,9 +298,9 @@ class cmd_domain_provision(Command):
             partitions_only=None,
             targetdir=None,
             ol_mmr_urls=None,
-            use_xattrs=None,
+            use_xattrs="auto",
             slapd_path=None,
-            use_ntvfs=None,
+            use_ntvfs=False,
             use_rfc2307=None,
             ldap_backend_nosync=None,
             ldap_backend_extra_port=None,
@@ -413,9 +413,9 @@ class cmd_domain_provision(Command):
 
         if use_xattrs == "yes":
             eadb = False
-        elif use_xattrs == "auto" and use_ntvfs == False or use_ntvfs == None:
+        elif use_xattrs == "auto" and use_ntvfs == False:
             eadb = False
-        elif use_ntvfs == False or use_ntvfs == None:
+        elif use_ntvfs == False:
             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"):
@@ -1491,7 +1491,7 @@ class cmd_domain_classicupgrade(Command):
     takes_args = ["smbconf"]
 
     def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
-            quiet=False, verbose=False, use_xattrs=None, sambaopts=None, versionopts=None,
+            quiet=False, verbose=False, use_xattrs="auto", sambaopts=None, versionopts=None,
             dns_backend=None, use_ntvfs=False):
 
         if not os.path.exists(smbconf):
@@ -1532,9 +1532,9 @@ 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:
+        elif use_xattrs == "auto" and use_ntvfs == False:
             eadb = False
-        elif use_ntvfs == False or use_ntvfs == None:
+        elif use_ntvfs == False:
             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"):
-- 
2.9.3

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba