sudo - impossible to retain/specify PATH

Bug #226595 reported by mortench on 2008-05-04
This bug report is a duplicate of:  Bug #192651: hardy sudo path is always reset. Edit Remove
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)

Bug Description

Binary package hint: sudo

I need to be able to run sudo with additional non-std binary folders in the PATH. Having already added my requirements to /etc/environment I was surprised when I got errors about missing commands when running them under sudo.....

I tried the following to fix this without sucess:
1) Using the "sudo -E" option - did not work. My existing PATH was still reset by sudo
2) Changing "Defaults env_reset" to "Defaults !env_reset" in /etc/sudoers - also did not work (even when combined with sudo -E)
3) Uncommenting env_reset (e.g. "#Defaults env_reset") in /etc/sudoers - also did not work.
4) Adding 'Defaults env_keep += "PATH"' to /etc/sudoers - also did not work.

Clearly - despite the man documentation - sudo is completely hardcoded regarding PATH and does not allow any flexibility regarding retaining the users PATH. Very annoying as I can't run non-default software under root permissions using sudo.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers