Samba-tool ntacl sysvolcheck Problem [Solved]

samba-ad
samba
samba4

#1

Can someone help me to fix this:

samba-tool ntacl sysvolcheck returned a problem with the sysvol ACLs.

STDOUT:
ERROR(): uncaught exception - ‘NoneType’ object has no attribute ‘endswith’
File “/usr/lib/python2.7/dist-packages/samba/netcmd/init.py”, line 176, in _run
return self.run(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/samba/netcmd/ntacl.py”, line 270, in run
lp)
File “/usr/lib/python2.7/dist-packages/samba/provision/init.py”, line 1776, in checksysvolacl
for dir_path in [os.path.join(sysvol, dnsdomain)]:
File “/usr/lib/python2.7/posixpath.py”, line 77, in join
elif path == ‘’ or path.endswith(’/’):

You can run samba-tool ntacl sysvolreset to fix the issue.

Thanks.


#2

Did you try the solution suggested by the command?


#3

Yep, then, same:

root@linux:~# samba-tool ntacl sysvolreset
ERROR(<type ‘exceptions.AttributeError’>): uncaught exception - ‘NoneType’ object has no attribute ‘startswith’
File “/usr/lib/python2.7/dist-packages/samba/netcmd/init.py”, line 176, in _run
return self.run(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/samba/netcmd/ntacl.py”, line 239, in run
resume_on_error=True)
File “/usr/lib/python2.7/dist-packages/samba/provision/init.py”, line 1575, in setsysvolacl
file = tempfile.NamedTemporaryFile(dir=os.path.abspath(sysvol))
File “/usr/lib/python2.7/posixpath.py”, line 367, in abspath
if not isabs(path):
File “/usr/lib/python2.7/posixpath.py”, line 61, in isabs
return s.startswith(’/’)


#4

Hey,

that’s an interesting error. After looking at the source code, I’ve whipped up the following small Python script which may give us some more insight into what might be wrong. Please save the following to e.g. info.py, run it with python2.7 info.py and paste its output here.

#!/usr/bin/python2.7

import optparse
import samba.getopt as options
import pprint

parser    = optparse.OptionParser("test1.py [options]")
sambaopts = options.SambaOptions(parser)
lp        = sambaopts.get_loadparm()
pp        = pprint.PrettyPrinter(indent=4)

pp.pprint([ lp.get("path", "sysvol"), lp.get("realm") ])

The output should look similar to this:

['/var/lib/samba/sysvol', 'MBU-TEST.INTRANET']

Kind regards,
mosu


#5

mosu, I got:

root@linux:~# python2.7 info.py
[None, ‘MY.INTRANET’]
root@linux:~#


#6

Hey,

OK, that None is the culprit. Please verify that /etc/samba/smb.conf contains a section called [sysvol] and that its path setting is present and set to /var/lib/samba/sysvol. In fact, please post the output of running the testparm and univention-check-templates commands.

Kind regards,
mosu


#7

You right bro, now I have:

[sysvol]
        path = /var/lib/samba/sysvol
        public = no 
        preserve case = yes
        case sensitive = no
        vfs objects = dfs_samba4 acl_xattr
        read only = no
        browseable = no
        acl xattr update mtime = yes

Then works.

Thanks a lot :slight_smile: You save me!


#8

Great! :+1: And you’re welcome.