You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll need a sacrificial command for this. In my case, I'm going to user ruby.
Define command
alt def ruby test-sys /usr/bin/ruby
Make sure the shims exist
alt shim
Run your command as root
sudo ruby --version
alt will call itself in a loop complaining that it's not configured properly.
Why is this happening?
sudo invokes alt (through a shim)
It passes your user's PATH env var (including your user's shim dir $HOME/.local/alt/shims)
alt tries to find the system version of the command (presuming that alt is not configured for the user you're sudoing into)
alt finds your original user's shim dir ($HOME/.local/alt/shims/ruby) (it didn't filter it out because it thinks the shims dir is the one for the user you sudoed into ex: /root/.local/alt/shims)
alt invokes its own shim
goto 1
Deeper problem
alt can invoke itself in a loop. Seems like it's pretty bad at detecting when it's calling itself.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
You'll need a sacrificial command for this. In my case, I'm going to user
ruby
.Define command
Make sure the shims exist
Run your command as root
alt
will call itself in a loop complaining that it's not configured properly.Why is this happening?
sudo
invokesalt
(through a shim)PATH
env var (including your user's shim dir$HOME/.local/alt/shims
)alt
tries to find the system version of the command (presuming thatalt
is not configured for the user you're sudoing into)alt
finds your original user's shim dir ($HOME/.local/alt/shims/ruby
) (it didn't filter it out because it thinks the shims dir is the one for the user you sudoed into ex:/root/.local/alt/shims
)alt
invokes its own shimgoto 1
Deeper problem
alt
can invoke itself in a loop. Seems like it's pretty bad at detecting when it's calling itself.The text was updated successfully, but these errors were encountered: