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