]> git.ipfire.org Git - thirdparty/samba.git/commit
Do not create an empty DB when accessing a sam.ldb
authorAndrew Bartlett <abartlet@samba.org>
Mon, 23 Nov 2020 06:35:37 +0000 (19:35 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 26 Nov 2020 06:52:41 +0000 (06:52 +0000)
commitd49e96bc45ea5e2d3364242dad36fe9094b7cc42
treeaa6b4100152d271feb436f5659fb4ffa4d7ef60f
parentf226bea5de892e3dbda3c0737edf054399ec0104
Do not create an empty DB when accessing a sam.ldb

Samba already does this for samba-tool and doing this should make
our errors more sensible, particularly in BIND9 if not provisioned
with the correct --dns-backend=DLZ_BIND9

The old error was like:

 named[62954]: samba_dlz: Unable to get basedn for
 /var/lib/samba/private/dns/sam.ldb
  - NULL Base DN invalid for a base search.

The new error will be like (in this case from the torture test):
 Failed to connect to Failed to connect to
 ldb:///home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb:
 Unable to open tdb '/home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb':
 No such file or directory: Operations error

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14579

Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/samdb.c