ghantoos / lshell

lshell is a shell coded in Python, that lets you restrict a user's environment to limited sets of commands, choose to enable/disable any command over SSH (e.g. SCP, SFTP, rsync, etc.), log user's commands, implement timing restriction, and more.
GNU General Public License v3.0
436 stars 112 forks source link

Aliases error #42

Closed whinote closed 11 years ago

whinote commented 11 years ago

Updating to say that this is still and issue. Has anyone else experienced this?

I am using lshell v 0.9.15.1-1. When adding aliases to lshell.conf I receive an error message. I have tried different aliases always adding the command to the allowed list. Currently I only have ll set as an alias.

RHEL 5.9 python-2.4.3-56.el5

lshell.conf file

allowed : ['sudo','sudoedit','passwd','mkdir','rmdir','ls','ll','cd','pwd','less','grep','tar','gzip']

aliases : {'ll':'ls -l'}

executed command

ll

Error message

Traceback (most recent call last): File "/usr/bin/lshell", line 27, in ? lshell.main() File "/usr/lib/python2.4/site-packages/lshell.py", line 1450, in main cli.cmdloop() File "/usr/lib/python2.4/site-packages/lshell.py", line 556, in cmdloop stop = self.onecmd(line) File "/usr/lib/python2.4/site-packages/lshell.py", line 678, in onecmd func = getattr(self, 'do_' + cmd) File "/usr/lib/python2.4/site-packages/lshell.py", line 163, in getattr self.g_line = get_aliases(self.g_line, self.conf['aliases']) File "/usr/lib/python2.4/site-packages/lshell.py", line 1425, in get_aliases line = re.sub(reg2, "%s%s%s" % (before, aliaskey, \ UnboundLocalError: local variable 'aliaskey' referenced before assignment

ghantoos commented 11 years ago

Hi,

This has been fixed in the following commit: ceb5b335a3e7b6fc0213a8ba3d425db17e06fea8

I should be releasing a new version soon. In the meantime, you can clone the project for github.

Cheers