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
434 stars 113 forks source link

env_path before os $PATH env variable #180

Open hostingnuggets opened 6 years ago

hostingnuggets commented 6 years ago

For rbenv to work with lshell I need to have the env_path config paramter in lshell.conf config file to have precedence over the operating system $PATH meaning that line 577 of checkconfig.py which is currently:

os.environ['PATH'] = os.environ['PATH'] + self.conf['env_path']

should be for rbenv to work:

os.environ['PATH'] = self.conf['env_path'] + os.environ['PATH']

Would it be possible to add a boolean parameter in lshell.conf to define the precedence of the env_path parameter? It could named be something like env_path_before_os_path with 1 env_path would be before the os_path and with a value of 0 the opposite.

Or is there maybe another workaround this?

brigriffin commented 6 years ago

@ghantoos please have a look at my PR #181