Created attachment 358212 [details, diff] Add secure-path use flag We currently force the secure_path option to the value of ROOTPATH at build time. Attached patch allows this feature to be disabled for those of us that find it annoying. When this is diabled, sudo inherits the PATH setting from the calling environment.
By the way, is it possible to drop in new value for PATH in sudoers? If it is, I think we should be rather doing that than hardcoding the value at build-time.
i'm not sure we should bother. you're going to see this behavior on every system out there that uses sudo. if you really want to override PATH, the portable solution is to use `env`. $ sudo env PATH='...your custom PATH...' whatever-program
I somehow missed that this actually can be switched off in the sudoers file. I thought it was a hard-coded value. Anyway, here's how to disable it, in case someone finds this in a search a few years from now. Defaults !secure_path