From a02f6954fa217ded1fbc230d0b0509bda2b357ba Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Tue, 16 Apr 2013 02:40:05 +0200 Subject: [PATCH] =?UTF-8?q?[firewall4]=20On=20n'=C3=A9tablit=20la=20connex?= =?UTF-8?q?ion=20=C3=A0=20la=20base=20LDAP=20que=20quand=20on=20en=20a=20b?= =?UTF-8?q?esoin.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/gen_confs/firewall4.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gestion/gen_confs/firewall4.py b/gestion/gen_confs/firewall4.py index 6fe9166d..baa5cd33 100755 --- a/gestion/gen_confs/firewall4.py +++ b/gestion/gen_confs/firewall4.py @@ -21,8 +21,6 @@ from affich_tools import anim, OK, cprint squeeze = os.uname()[2] < '3' -#: Connection à labase ldap -conn = lc_ldap.lc_ldap_admin() #: Nom de la machine exécutant le script hostname = socket.gethostname() @@ -181,12 +179,15 @@ class firewall_base(object) : return str def __init__(self): + global conn #initialisation des structures communes : récupération des ipset if os.getuid() != 0: from affich_tools import coul sys.stderr.write(coul("Il faut être root pour utiliser le firewall\n", 'gras')) sys.exit(1) + # Connection à la base ldap + conn = lc_ldap.lc_ldap_admin() self.reloadable = { 'blacklist_hard' : self.blacklist_hard,