summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-10 12:42:57 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-10 12:42:57 +1000
commitc0efa5192956cfa7b53da54851409ec5cac07b8d (patch)
tree212428b30e33e9f25cc37ed6ecb368ceeb9612d2 /source4
parent22c4ffa398a4c4855f79c36e75fdf467cdd47184 (diff)
downloadsamba-c0efa5192956cfa7b53da54851409ec5cac07b8d.tar.gz
samba-c0efa5192956cfa7b53da54851409ec5cac07b8d.tar.bz2
samba-c0efa5192956cfa7b53da54851409ec5cac07b8d.zip
s4/provision: another fix for breakage from b1dabb1133
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/provision.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index dafccb3a03..ca38a85805 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1114,6 +1114,7 @@ def provision(setup_dir, message, session_info,
# Now use the backend credentials to access the databases
credentials = provision_backend.credentials
secrets_credentials = provision_backend.adminCredentials
+ ldapi_url = provision_backend.ldapi_uri
# only install a new shares config db if there is none
if not os.path.exists(paths.shareconf):
@@ -1219,17 +1220,18 @@ def provision(setup_dir, message, session_info,
message("A Kerberos configuration suitable for Samba 4 has been generated at %s" % paths.krb5conf)
- ldapi_db = Ldb(provision_backend.ldapi_uri, lp=lp, credentials=credentials)
+ if provision_backend is not None:
+ ldapi_db = Ldb(provision_backend.ldapi_uri, lp=lp, credentials=credentials)
- # delete default SASL mappings
- res = ldapi_db.search(expression="(!(cn=samba-admin mapping))", base="cn=mapping,cn=sasl,cn=config", scope=SCOPE_ONELEVEL, attrs=["dn"])
+ # delete default SASL mappings
+ res = ldapi_db.search(expression="(!(cn=samba-admin mapping))", base="cn=mapping,cn=sasl,cn=config", scope=SCOPE_ONELEVEL, attrs=["dn"])
- for i in range (0, len(res)):
+ for i in range (0, len(res)):
dn = str(res[i]["dn"])
ldapi_db.delete(dn)
- # configure aci
- if ldap_backend_type == "fedora-ds":
+ # configure aci
+ if ldap_backend_type == "fedora-ds":
aci = """(targetattr = "*") (version 3.0;acl "full access to all by samba-admin";allow (all)(userdn = "ldap:///CN=samba-admin,%s");)""" % names.sambadn