[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:
parent
a620d68411
commit
054b42044b
1 changed files with 21 additions and 2 deletions
23
attributs.py
23
attributs.py
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue