Web lists-archives.com

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




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:

ntvfs_options = [
        Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)",
               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)


    def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
            quiet=False, verbose=False, use_xattrs=None, sambaopts=None, versionopts=None,
            dns_backend=None, use_ntvfs=False):


        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))
            else:
                tmpfile = tempfile.NamedTemporaryFile(dir=os.path.abspath(os.path.dirname(lp.get("private dir"))))
            try:
                try:
                    samba.ntacls.setntacl(lp, tmpfile.name,
                                "O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")
                    eadb = False
                except Exception:
                    # FIXME: Don't catch all exceptions here
                    logger.info("You are not root or your system does not support xattr, using tdb backend for attributes. "
                                "If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
            finally:
                tmpfile.close()


I don't know if you understand python, but the first block sets the
options for the ntvfs server and these are only used if the ntvfs
server is built and it only gets built now if '--enable-selftest' is
passed to configure.

The 'def' block sets 'use_xattrs' to 'None' and 'use_ntvfs' to 'False'

The last block checks the options until it gets a match and the one
that seems to match is 'elif use_ntvfs == False or use_ntvfs == None:'
and the code prints the second message you received.

I think the fix will be to open (and this is on a build where
everything ends up in /usr/local/samba , yours may be different)

/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/domain.py

Find the class:

cmd_domain_classicupgrade(Command)

Go down to the line that starts:

def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None

Should be line 1493

Find (on the line below) 'use_xattrs=None' and change it to
'use_xattrs=auto'

This should then get the line 'elif use_xattrs == "auto" and use_ntvfs
== False or use_ntvfs == None:' to be used instead.

Save and close the file and then try the classicupgrade again.

Rowland

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