From 5fa6339cd0c1f3c82407335641c0c0ac03f3dced Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Sun, 19 May 2013 21:51:27 +0200 Subject: [PATCH] =?UTF-8?q?[ldap.py]=20ldap=5Fhost=20contient=20d=C3=A9sor?= =?UTF-8?q?mais=20un=20host?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python/etc/freeradius/modules/ldap | 7 ++----- Python/etc/nsswitch.conf | 2 ++ etc/genshi/postfix_ldap.txt | 2 +- etc/python/ldap.py | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Python/etc/freeradius/modules/ldap b/Python/etc/freeradius/modules/ldap index 082eb58..e651916 100644 --- a/Python/etc/freeradius/modules/ldap +++ b/Python/etc/freeradius/modules/ldap @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- include("secrets") +include("ldap") -if has("db-replicat"): - server = 'localhost' -else: - server = 'ldap.adm.crans.org' print """ # -*- text -*- # ceci est le fichier /etc/freeradius/modules/ldap @@ -177,4 +174,4 @@ ldap { # default: 0x0000 (no debugging messages) # Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS) #ldap_debug = 0x0028 -}""" % {'password': secrets.ldap_readonly_password, 'server': server} +}""" % {'password': secrets.ldap_readonly_password, 'server': ldap_host} diff --git a/Python/etc/nsswitch.conf b/Python/etc/nsswitch.conf index 97a9a19..277f5d0 100644 --- a/Python/etc/nsswitch.conf +++ b/Python/etc/nsswitch.conf @@ -7,6 +7,8 @@ Databases) et du service de noms (Name Service Switch). if has("ldap"): db="ldap" +else: + db="" def database(name, res): print name + ": " + " ".join(res) diff --git a/etc/genshi/postfix_ldap.txt b/etc/genshi/postfix_ldap.txt index 5c01998..37aa11f 100644 --- a/etc/genshi/postfix_ldap.txt +++ b/etc/genshi/postfix_ldap.txt @@ -16,7 +16,7 @@ {% include /var/lib/bcfg2/etc/genshi/secrets.txt %}\ # Connexion LDAP -server_host = $ldap_host +server_host = $ldap_socket search_base = ou=data,dc=crans,dc=org version = 3 bind = yes diff --git a/etc/python/ldap.py b/etc/python/ldap.py index 6f002ea..8a0b13e 100644 --- a/etc/python/ldap.py +++ b/etc/python/ldap.py @@ -12,12 +12,12 @@ include("ip") if has("db-server") and not has("db-replicat-test"): # Pour ceux qui ont la base ou une copie en locale # on regarde dans celle-ci - ldap_host = "ldap://127.0.0.1/" + ldap_host = "127.0.0.1" ldap_socket = "ldapi://%2fvar%2frun%2fslapd%2fldapi/" else: # On regarde dans la base principale - ldap_host = "ldap://%s/" % admipof("ldap") - ldap_socket = ldap_host + ldap_host = admipof("ldap") + ldap_socket = "ldap://%s/" % ldap_host # Filtre de droits pour la connexion if has("users") or has("vert"):