[chsh] On évite que les gens se mettent rssh comme login shell...
darcs-hash:20101107103014-ffbb2-bb528dc7d2c60b182f64e94caacbac845db6f6e5.gz
This commit is contained in:
parent
8bac310298
commit
0407a87413
1 changed files with 4 additions and 2 deletions
|
@ -38,9 +38,11 @@ fd=open('/etc/shells')
|
|||
lines=fd.readlines()
|
||||
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 ''.join(lines[1:])
|
||||
print ''.join(shells)
|
||||
sys.exit(4)
|
||||
|
||||
adh.chsh(shell)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue