Red Hat Bugzilla – Bug 472541
sudo fails to find scripts that aren't executable by current user
Last modified: 2013-07-02 23:20:12 EDT
Description of problem:
I have a few scripts that have to be executed as root, which I do via "sudo scriptname". The scripts
are in my PATH, but to keep from forgetting to use sudo, I have them root-owned and permissioned 0744 (rwxr--r--).
This arrangement has worked fine for many years, but as of latest Fedora 9 it fails.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create shell script permissioned as described
2. as non-root user, sudo scriptname
sudo: scriptname: command not found
script should run
I observe that "which scriptname" fails to find the script also, which is probably reasonable but
I do not remember whether it used to work like that. Conceivably this is really a bash issue not
a sudo issue? But bash hasn't changed recently, and this broke very recently (not more than a
couple weeks ago). Anyway, for completeness bash is bash-3.2-22.fc9.x86_64
After further experimentation, I think my initial description may be wrong: it seems what is really happening is that PATH is being reset to a default value, even though sudo -V claims PATH will be preserved as it has been in the past.
*** This bug has been marked as a duplicate of bug 471603 ***