# Samba 4.10 Bug



## Paul-LKW (Aug 24, 2019)

Hi All:
I just tried to compile via the ports tree and successfully installed Samba-4.10.6 but when I carry out the following;

`samba-tool domain provision --server-role=dc --use-rfc2307 --dns-backend=SAMBA_INTERNAL --realm=AD.DOMAIN.INVALID --domain=AD --adminpass=P@ssw0rd`

I get 

```
INFO 2019-08-24 23:18:23,813 pid:93491 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2096: Looking up IPv4 addresses
INFO 2019-08-24 23:18:23,814 pid:93491 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2113: Looking up IPv6 addresses
WARNING 2019-08-24 23:18:23,814 pid:93491 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2120: No IPv6 address will be assigned
INFO 2019-08-24 23:18:24,374 pid:93491 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2286: Setting up share.ldb
Unable to find backend for '/var/db/samba4/private/share.ldb' - do you need to set LDB_MODULES_PATH?
ERROR(ldb): uncaught exception - None
  File "/usr/local/lib/python3.6/site-packages/samba/netcmd/__init__.py", line 185, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/samba/netcmd/domain.py", line 537, in run
    backend_store=backend_store)
  File "/usr/local/lib/python3.6/site-packages/samba/provision/__init__.py", line 2287, in provision
    share_ldb = Ldb(paths.shareconf, session_info=session_info, lp=lp)
  File "/usr/local/lib/python3.6/site-packages/samba/__init__.py", line 115, in __init__
    self.connect(url, flags, options)
```
It seems a bug since 4.10.4 upgrade !!!
Any help is appreciated.


----------



## Terry_Kennedy (Aug 25, 2019)

Paul-LKW said:


> I just tried to compile via the ports tree and successfully installed Samba-4.10.6 but when I carry out the following;
> [snip]
> It seems a bug since 4.10.4 upgrade !!!
> Any help is appreciated.


I don't use that feature in Samba, but I see that 4.10.7 just landed in the ports tree. You might want to update your ports tree and try building 4.10.7 to see if that fixes it.


----------



## Paul-LKW (Aug 25, 2019)

Hi Terry:
It is the same issue.


----------



## acheron (Aug 25, 2019)

Looks similar to PR 239105


----------



## Terry_Kennedy (Aug 25, 2019)

Paul-LKW said:


> Hi Terry:
> It is the same issue.


Oh well, it was worth trying.


----------



## itstmyi (Nov 18, 2019)

the same problem until now on FreeBSD 12.1 release by pkg installation .
any new answer about it ?


----------



## Paul-LKW (Jan 2, 2020)

itstmyi and all
I just tried out and could be solved with mounting a new ZFS drive with acls enabled and then  linking the directory could be successfully deploy AD
eg. I have a ZFS created as SMB/sysvol then I use

`rm -fR /var/db/samba410/sysvol`
`ln -s /SMB/sysvol /var/db/samba410/sysvol`

then issue the following command
`samba-tool domain provision --server-role=dc --use-rfc2307 --dns-backend=SAMBA_INTERNAL --realm=DC.SOMEDOMAIN.INVALID --domain=AD --adminpass=your_password --option="vfs objects"="dfs_samba4 zfsacl"`

Below is the output I get wothout any error;

```
INFO 2020-01-02 15:42:50,307 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2096: Looking up IPv4 addresses
INFO 2020-01-02 15:42:50,308 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2113: Looking up IPv6 addresses
WARNING 2020-01-02 15:42:50,308 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2120: No IPv6 address will be assigned
INFO 2020-01-02 15:42:51,116 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2290: Setting up secrets.ldb
INFO 2020-01-02 15:42:51,523 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2296: Setting up the registry
INFO 2020-01-02 15:42:51,566 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2299: Setting up the privileges database
INFO 2020-01-02 15:42:51,666 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2302: Setting up idmap db
INFO 2020-01-02 15:42:51,722 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2309: Setting up SAM db
INFO 2020-01-02 15:42:51,776 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #882: Setting up sam.ldb partitions and settings
INFO 2020-01-02 15:42:51,778 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #894: Setting up sam.ldb rootDSE
INFO 2020-01-02 15:42:51,783 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1302: Pre-loading the Samba 4 and AD schema
Unable to determine the DomainSID, can not enforce uniqueness constraint on local domainSIDs

INFO 2020-01-02 15:42:51,869 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1379: Adding DomainDN: DC=dc,DC=SOMEDOMAIN,DC=invalid
INFO 2020-01-02 15:42:51,901 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1411: Adding configuration container
INFO 2020-01-02 15:42:51,954 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1426: Setting up sam.ldb schema
INFO 2020-01-02 15:42:55,251 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1444: Setting up sam.ldb configuration data
INFO 2020-01-02 15:42:55,519 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1485: Setting up display specifiers
INFO 2020-01-02 15:42:57,964 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1493: Modifying display specifiers and extended rights
INFO 2020-01-02 15:42:58,021 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1500: Adding users container
INFO 2020-01-02 15:42:58,024 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1506: Modifying users container
INFO 2020-01-02 15:42:58,026 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1509: Adding computers container
INFO 2020-01-02 15:42:58,029 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1515: Modifying computers container
INFO 2020-01-02 15:42:58,031 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1519: Setting up sam.ldb data
INFO 2020-01-02 15:42:58,273 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1549: Setting up well known security principals
INFO 2020-01-02 15:42:58,321 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1563: Setting up sam.ldb users and groups
INFO 2020-01-02 15:42:58,570 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1571: Setting up self join
INFO 2020-01-02 15:43:00,898 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/sambadns.py #1135: Adding DNS accounts
INFO 2020-01-02 15:43:00,921 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/sambadns.py #1169: Creating CN=MicrosoftDNS,CN=System,DC=dc,DC=SOMEDOMAIN,DC=invalid
INFO 2020-01-02 15:43:00,951 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/sambadns.py #1182: Creating DomainDnsZones and ForestDnsZones partitions
INFO 2020-01-02 15:43:01,140 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/sambadns.py #1187: Populating DomainDnsZones and ForestDnsZones partitions
INFO 2020-01-02 15:43:01,416 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2000: Setting up sam.ldb rootDSE marking as synchronized
INFO 2020-01-02 15:43:01,420 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2005: Fixing provision GUIDs
INFO 2020-01-02 15:43:03,072 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2362: A Kerberos configuration suitable for Samba AD has been generated at /var/db/samba4/private/krb5.conf
INFO 2020-01-02 15:43:03,072 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2363: Merge the contents of this file with your system krb5.conf or replace it with this one. Do not create a symlink!
INFO 2020-01-02 15:43:03,138 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2070: Setting up fake yp server settings
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #491: Once the above files are installed, your Samba AD server will be ready to use
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #495: Server Role:           active directory domain controller
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #496: Hostname:              DC
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #497: NetBIOS Domain:        AD
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #498: DNS Domain:            dc.SOMEDOMAIN.invalid
INFO 2020-01-02 15:43:03,246 pid:732 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #499: DOMAIN SID:            S-1-5-21-1685085346-624412366-4000000536
root@DC:/var/db/samba4 #
```
Remark: seems the python error already gone and this time it is complaning ACLs error only so I think this work around to try.


----------



## spanglefox (Apr 15, 2020)

Didn't work for me 

I noticed a directory difference:
`ln -s /SMB/sysvol /var/db/samba410/sysvol`
was different to:

`root@DC:/var/db/samba4 #`

My Samba did not include any mention of samba410 directory.
Could that be the issue?

EDIT:
I have just successfully provisioned the domain on ZFS backed disk by using:
`ln -s /SMB/sysvol /var/db/samba4/sysvol`

So I'm in the weird position of being able to provision with ZFS but not UFS.


----------

