Bug 472541

Summary: sudo fails to find scripts that aren't executable by current user
Product: [Fedora] Fedora Reporter: Tom Lane <tgl>
Component: sudoAssignee: Daniel Kopeček <dkopecek>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: dkopecek, hhorak, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-24 11:26:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Lane 2008-11-21 16:51:46 UTC
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):
sudo-1.6.9p13-7.fc9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  create shell script permissioned as described
2.  as non-root user, sudo scriptname
  
Actual results:
sudo: scriptname: command not found

Expected results:
script should run

Additional info:
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

Comment 1 Tom Lane 2008-11-23 23:54:14 UTC
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.

Comment 2 Daniel Kopeček 2008-11-24 11:26:45 UTC

*** This bug has been marked as a duplicate of bug 471603 ***