Hacker News new | ask | show | jobs
by zahlman 18 days ago
`which sudo`?

`/usr/bin/sudo`?

1 comments

If they can override sudo, they can override which.
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.