[chsh] On évite que les gens se mettent rssh comme login shell...

darcs-hash:20101107103014-ffbb2-bb528dc7d2c60b182f64e94caacbac845db6f6e5.gz
This commit is contained in:
Nicolas Dandrimont 2010-11-07 11:30:14 +01:00
parent 8bac310298
commit 0407a87413

View file

@ -38,9 +38,11 @@ fd=open('/etc/shells')
lines=fd.readlines() lines=fd.readlines()
fd.close() fd.close()
if not shell in map(str.strip,lines) : shells = [line for line in lines if not (line.startswith('#') or line.endswith('/rssh'))]
if not shell in shells:
print 'Shell invalide. Les shells valides sont :' print 'Shell invalide. Les shells valides sont :'
print ''.join(lines[1:]) print ''.join(shells)
sys.exit(4) sys.exit(4)
adh.chsh(shell) adh.chsh(shell)