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

rbenv not compatible with lshell #89

Closed hostingnuggets closed 8 years ago

hostingnuggets commented 9 years ago

I am using rbenv (https://github.com/sstephenson/rbenv) in order to setup my ruby environment correctly but unfortunately lshell does not work with rbenv. What I need to do to get rbenv working is to be able to execute the following command from the command line or from the lshell login_script:

eval "$(rbenv init -)"

what this does it to simply execute the following shell script commands:

export PATH="/home/user/.rbenv/shims:${PATH}"
export RBENV_SHELL=bash
source '/home/user/.rbenv/libexec/../completions/rbenv.bash'
rbenv rehash 2>/dev/null
rbenv() {
  local command
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  rehash|shell)
    eval "`rbenv "sh-$command" "$@"`";;
  *)
    command rbenv "$command" "$@";;
  esac
}

any chances to get rbenv working with shell?

see also #77

ghantoos commented 9 years ago

What error are you getting when executing the command?

hostingnuggets commented 9 years ago

nothing happens when I execute that eval command that's the problem. it should for example export and set the RBENV_SHELL variable and define the rbenv shell function but it does nothing really. I have allowed export, rbenv, eval through the allowed parameter of lshell.

ghantoos commented 9 years ago

@hostingnuggets, were you able to find a workaround for your issue?

hostingnuggets commented 9 years ago

unfortunately no, still impossible to use rbenv in combination with lshell

ghantoos commented 8 years ago

Have you tried adding

The other functions of rbenv seem to be very bash specific, which will not be compatible with lshell, as it uses subprocess which usually hit sh(1) and not bash(1).

Feel free to reopen the bug if this does not correct your behavior.

hostingnuggets commented 6 years ago

@ghantoos please reopen the bug as it still does not work with 0.9.18 and I can't even run a git clone, see #175, thanks!