4 ms·
Nope, sudo uses hardcoded PATH and not user-supplied one. Doing otherwise would be a huge security hole, and would get fixed quickly. It also clears related var
by theamk 3y ago
Nope, sudo uses hardcoded PATH and not user-supplied one. Doing otherwise would be a huge security hole, and would get fixed quickly. It also clears related variables like PYTHONPATH (the exact list depends on distro)
In general, sudo is pretty good with single command grants as long as you use this on the scripts made for the purpose (like shell scripts which take no or a single fixed argument). But granting arbitrary arguments permission to a random system binary is a bad idea, something like --log-output might become an escalation.
(And unfortunately the default PATH means to of you want to sudo-exe c binaries from your user's bin, you need full path. I hit this all the time.)