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
435 stars 112 forks source link

Command exit code is not returned over ssh #137

Open maethor opened 8 years ago

maethor commented 8 years ago

Hello,

When called through ssh, lshell doesn't seem to return the exit code of the command.

# sudo chsh -s /bin/bash test
# ssh test@localhost ls toto
ls: impossible d'accéder à 'toto': Aucun fichier ou dossier de ce type
# echo $?
2

# sudo chsh -s /usr/bin/lshell test
# ssh test@localhost ls toto
ls: impossible d'accéder à 'toto': Aucun fichier ou dossier de ce type
# echo $?
0

This is really annoying, because it forbids to use lshell in many contexts when the return code is an absolute necessity, like nagios check_by_ssh.

I just discovered lshell 2 hours ago, did I miss something?

Thanks.

ghantoos commented 8 years ago

This is a bug. I've it to the todo list. Thanks for reporting!

maethor commented 8 years ago

OK. Thank you :)

maethor commented 6 years ago

Any news @ghantoos ?