From 571c5bc9596f78ae678b4369a9ee8ece22f0bbe0 Mon Sep 17 00:00:00 2001 From: Olivier Huber Date: Thu, 3 Sep 2009 22:04:11 +0200 Subject: [PATCH] =?UTF-8?q?[./gestion/gen=5Fconfs/droits.py]=20Le=20shell?= =?UTF-8?q?=20sur=20ragnarok=20est=20maintenant=20le=20m=C3=AAme=20que=20c?= =?UTF-8?q?elui=20configur=C3=A9=20dans=20ldap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20090903200411-8fbb1-8239a520c6806649b3b5e531b1069431ebb16575.gz --- gestion/gen_confs/droits.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gestion/gen_confs/droits.py b/gestion/gen_confs/droits.py index bbeaa64e..e5030962 100644 --- a/gestion/gen_confs/droits.py +++ b/gestion/gen_confs/droits.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: iso-8859-15 -*- -import sys, signal, os +import sys, signal, os, re # Imports pour LDAP sys.path.append('/usr/scripts/gestion') @@ -200,6 +200,15 @@ class droits_openbsd(droits) : if fonction == "Nounou": # On rajoute à /etc/group group = "%s,%s" % (group, a._data['uid'][0]) + #On conserve le shell + #Il faut ôter les emplacements spécifique à linux (type + #/usr/bin/zsh) + if re.search("zsh",a._data['loginShell'][0]): + shell = "/bin/zsh" + elif re.search("bash",a._data['loginShell'][0]): + shell = "/bin/bash" + else: + shell = "/bin/zsh" # On ajoute dans master # Le mot de passe est bidon master = "%s%s:$1$rQcJgpD8$ZZjjszWKnSp9rR6iZ9GPm2:%s:1000:ldap:0:0:%s:%s:%s\n" % (master, @@ -207,7 +216,7 @@ class droits_openbsd(droits) : a._data['uidNumber'][0], a._data['gecos'][0], a._data['homeDirectory'][0], - "/bin/zsh") + shell) group = "%s\n" % group # On va réécrire /etc/master.passwd