Reviewed-by: Stefan Metzmacher <metze@samba.org>
if samba3.lp.get("passdb backend").split(":")[0].strip() == "ldapsam":
base_dn = samba3.lp.get("ldap suffix")
ldapuser = samba3.lp.get("ldap admin dn")
- ldappass = (secrets_db.get_ldap_bind_pw(ldapuser)).strip('\x00')
+ ldappass = secrets_db.get_ldap_bind_pw(ldapuser)
+ if ldappass is None:
+ raise ProvisioningError("ldapsam passdb backend detected but no LDAP Bind PW found in secrets.tdb for user %s. Please point this tool at the secrets.tdb that was used by the previous installation.")
+ ldappass = ldappass.strip('\x00')
ldap = True
else:
ldapuser = None