summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-01-15 21:53:30 +1100
committerAndrew Bartlett <abartlet@samba.org>2013-03-02 21:52:19 +0100
commit669c302f2d78ab4bbd35982373ae079246c8979d (patch)
treedc595132505f26419cc0419c7a2b49c1dc8fc512
parent68f13f5d7e80f2041e140a12fc2f7139561c83ce (diff)
downloadsamba-669c302f2d78ab4bbd35982373ae079246c8979d.tar.gz
samba-669c302f2d78ab4bbd35982373ae079246c8979d.tar.bz2
samba-669c302f2d78ab4bbd35982373ae079246c8979d.zip
samba-tool domain classicupgrade: Print a better error when the ldap backend PW was not found
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--python/samba/upgrade.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/samba/upgrade.py b/python/samba/upgrade.py
index d680a7ca23..e013d2c831 100644
--- a/python/samba/upgrade.py
+++ b/python/samba/upgrade.py
@@ -598,7 +598,10 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None,
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