Permalink
Browse files

corrected login_script implementation and bumped version to .16

  • Loading branch information...
Ignace Mouzannar
Ignace Mouzannar committed Jan 2, 2013
1 parent c58e2db commit 4039b67d8209f70ce90e7d8266ef35fdd1f3f91d
Showing with 20 additions and 21 deletions.
  1. +3 −0 CHANGES
  2. +2 −2 etc/lshell.conf
  3. +10 −17 lshellmodule/lshell.py
  4. +3 −0 man/lshell.1
  5. +1 −1 rpm/lshell.spec
  6. +1 −1 setup.py
View
@@ -8,6 +8,9 @@ Contact: ghantoos@ghantoos.org
http://sourceforge.net/projects/lshell/
#####################################
+=== v0.9.16 xx/xx/2013 ===
+ * Added support to login script. Thank you Laurent Debacker for the patch.
+
=== v0.9.15.2 08/05/2012 ===
* Corrected mismatch in aliaskey variable.
View
@@ -89,5 +89,5 @@ aliases : {'ll':'ls -l', 'vi':'vim'}
## set history file name (default is /home/%u/.lhistory)
#history_file : "/home/%u/.lshell_history"
-## defines the script to run once after login (leave it commented otherwise)
-#login_script : "myscript.sh"
+## define the script to run at user login
+#login_script : "/path/to/myscript.sh"
View
@@ -42,7 +42,7 @@
import glob
__author__ = "Ignace Mouzannar <ghantoos@ghantoos.org>"
-__version__ = "0.9.15.1"
+__version__ = "0.9.16"
# Required config variable list per user
required_config = ['allowed', 'forbidden', 'warning_counter']
@@ -530,28 +530,21 @@ def cmdloop(self, intro=None):
try:
if self.conf['intro']:
self.stdout.write(str(self.conf['intro'])+"\n")
- stop = None
if self.conf['login_script']:
- login_script = True
- else:
- login_script = False
+ os.system(self.conf['login_script'])
+ stop = None
while not stop:
if self.cmdqueue:
line = self.cmdqueue.pop(0)
else:
if self.use_rawinput:
- if not login_script:
- try:
- line = raw_input(self.prompt)
- except EOFError:
- line = 'EOF'
- except KeyboardInterrupt:
- self.stdout.write('\n')
- line = ''
- else:
- line = self.conf['login_script']
- login_script = False
-
+ try:
+ line = raw_input(self.prompt)
+ except EOFError:
+ line = 'EOF'
+ except KeyboardInterrupt:
+ self.stdout.write('\n')
+ line = ''
else:
self.stdout.write(self.prompt)
self.stdout.flush()
View
@@ -153,6 +153,9 @@ directory. A wildcard can be used:
.I intro
set the introduction to print at login
.TP
+.I login_script
+define the script to run at user login
+.TP
.I passwd
password of specific user (default is empty)
.TP
View
@@ -1,5 +1,5 @@
%define name lshell
-%define version 0.9.15.1
+%define version 0.9.16
%define release 1
%define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
View
@@ -24,7 +24,7 @@
if __name__ == '__main__':
setup(name='lshell',
- version='0.9.15.1',
+ version='0.9.16',
description='Limited Shell',
long_description="""Limited Shell (lshell) is lets you restrict the \
environment of any user. It provides an easily configurable shell: just \

0 comments on commit 4039b67

Please sign in to comment.