[attributs.py] On mets la liste des shells en dur

car se sont ceux installés sur zamok qui importent
This commit is contained in:
Valentin Samir 2011-10-25 22:46:43 +02:00
parent a620d68411
commit 054b42044b

View file

@ -524,8 +524,27 @@ class loginShell(Attr):
can_modify = ["self", "Nounou", "Cableur"]
def parse_value(self, shell, ldif):
with open('/etc/shells') as f:
shells = [ l.strip() for l in f.readlines() if not l.startswith('#') ]
#with open('/etc/shells') as f:
# shells = [ l.strip() for l in f.readlines() if not l.startswith('#') ]
shells=['/bin/csh',
'/bin/sh',
'/usr/bin/es',
'/usr/bin/ksh',
'/bin/ksh',
'/usr/bin/rc',
'/usr/bin/tcsh',
'/bin/tcsh',
'/usr/bin/esh',
'/bin/bash',
'/bin/rbash',
'/bin/zsh',
'/usr/bin/zsh',
'/usr/bin/screen',
'/bin/dash',
'/usr/bin/rssh',
'/usr/local/bin/disconnect_shell',
'/usr/scripts/surveillance/disconnect_shell',
'']
if (shell not in shells):
raise ValueError("Shell %s invalide" % shell)
self.value = shell