Hacker News new | ask | show | jobs
by bestham 10 days ago
If they can override sudo, they can override which.
2 comments

if you use \which it'll always be a shell built-in ;) though someone can put a different shell in your .zshrc

  $ which() { echo foo; }
  $ \which
  foo
The backslash only prevents alias expansion.
He meant `command which`
> it'll always be a shell built-in

`command which` wouldn't have been the built-in

`exec /tmp/fake-bash` in bashrc to intercept everything?
Then use the absolute path.