1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

provision: Remove final code for the LDAP backend

The LDAP backend for the Samba AD DC, aiming to store the AD DC in
an existing LDAP server was largely removed many years aga, but the
other parts were removed in 2b0fc74a09.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 23 06:12:20 UTC 2020 on sn-devel-184
This commit is contained in:
Andrew Bartlett
2020-04-20 17:09:52 +12:00
parent 4ab753f0d1
commit 54a3560498
4 changed files with 6 additions and 25 deletions

View File

@ -1005,7 +1005,7 @@ def secretsdb_self_join(secretsdb, domain,
secretsdb.add(msg)
def setup_secretsdb(paths, session_info, backend_credentials, lp):
def setup_secretsdb(paths, session_info, lp):
"""Setup the secrets database.
:note: This function does not handle exceptions and transaction on purpose,
@ -1041,22 +1041,6 @@ def setup_secretsdb(paths, session_info, backend_credentials, lp):
secrets_ldb.transaction_start()
try:
secrets_ldb.load_ldif_file_add(setup_path("secrets.ldif"))
if (backend_credentials is not None and
backend_credentials.authentication_requested()):
if backend_credentials.get_bind_dn() is not None:
setup_add_ldif(secrets_ldb,
setup_path("secrets_simple_ldap.ldif"), {
"LDAPMANAGERDN": backend_credentials.get_bind_dn(),
"LDAPMANAGERPASS_B64": b64encode(backend_credentials.get_password()).decode('utf8')
})
else:
setup_add_ldif(secrets_ldb,
setup_path("secrets_sasl_ldap.ldif"), {
"LDAPADMINUSER": backend_credentials.get_username(),
"LDAPADMINREALM": backend_credentials.get_realm(),
"LDAPADMINPASS_B64": b64encode(backend_credentials.get_password()).decode('utf8')
})
except:
secrets_ldb.transaction_cancel()
raise
@ -1332,7 +1316,7 @@ def setup_samdb(path, session_info, provision_backend, lp, names,
# Load the database, but don's load the global schema and don't connect
# quite yet
samdb = SamDB(session_info=session_info, url=None, auto_connect=False,
credentials=provision_backend.credentials, lp=lp,
lp=lp,
global_schema=False, am_rodc=am_rodc, options=options)
logger.info("Pre-loading the Samba 4 and AD schema")
@ -2304,8 +2288,7 @@ def provision(logger, session_info, smbconf=None,
logger.info("Setting up secrets.ldb")
secrets_ldb = setup_secretsdb(paths,
session_info=session_info,
backend_credentials=provision_backend.credentials, lp=lp)
session_info=session_info, lp=lp)
try:
logger.info("Setting up the registry")

View File

@ -43,7 +43,6 @@ class ProvisionBackend(object):
"""Provision a backend for samba4"""
self.paths = paths
self.lp = lp
self.credentials = None
self.names = names
self.logger = logger
@ -72,7 +71,6 @@ class ProvisionBackend(object):
class LDBBackend(ProvisionBackend):
def init(self):
self.credentials = None
# Wipe the old sam.ldb databases away
shutil.rmtree(self.paths.samdb + ".d", True)

View File

@ -46,7 +46,7 @@ def create_dummy_secretsdb(path, lp=None):
paths.binddns_dir = os.path.dirname(path)
paths.keytab = "no.keytab"
paths.dns_keytab = "no.dns.keytab"
secrets_ldb = setup_secretsdb(paths, None, None, lp=lp)
secrets_ldb = setup_secretsdb(paths, None, lp=lp)
secrets_ldb.transaction_commit()
return secrets_ldb
@ -64,7 +64,7 @@ class ProvisionTestCase(samba.tests.TestCaseInTempDir):
paths.binddns_dir = os.path.dirname(path)
paths.keytab = "no.keytab"
paths.dns_keytab = "no.dns.keytab"
ldb = setup_secretsdb(paths, None, None, lp=env_loadparm())
ldb = setup_secretsdb(paths, None, lp=env_loadparm())
try:
self.assertEqual("LSA Secrets",
ldb.searchone(basedn="CN=LSA Secrets", attribute="CN").decode('utf8'))

View File

@ -11,7 +11,7 @@ bld.INSTALL_WILDCARD('${SETUPDIR}', 'adprep/WindowsServerDocs/*.diff')
bld.INSTALL_FILES('${SETUPDIR}', 'dns_update_list')
bld.INSTALL_FILES('${SETUPDIR}', 'spn_update_list')
for p in '''schema-map-* DB_CONFIG *.inf *.ldif *.reg *.zone *.conf *.php *.txt
for p in '''*.inf *.ldif *.reg *.zone *.conf *.php *.txt
named.conf.update named.conf.dlz'''.split():
bld.INSTALL_WILDCARD('${SETUPDIR}', p)