Bug 475990

Summary: sudo -V not consistent with sudo actual behavior
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: sudoAssignee: Daniel Kopeček <dkopecek>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: dkopecek, kasmith, kzak, slacker
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.7.1-2.fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-16 02:43:21 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 Horsley 2008-12-11 13:39:34 UTC
Description of problem:

In previous fedora versions, sudo retained my $PATH. On fedora 10,
running sudo sudo -V claims that it retains my $PATH, yet running
sudo sh -c 'echo $PATH' clearly shows that it does not retain my $PATH.
One or the other of these behaviours has got to be a bug :-).

I'd prefer that it really did retain my $PATH since I have sudo commands
scattered around all over the place which will now not work if they
are trying to run something in (for example) /usr/local/bin.


Version-Release number of selected component (if applicable):
sudo-1.6.9p17-2.fc10.i386

How reproducible:
every time

Steps to Reproduce:
1. Put a sample script in /usr/local/bin that echoes $PATH
2. sudo sample - doesn't work
3. sudo /usr/local/bin/sample - does work but shows reduced $PATH
  
Actual results:
tomh> echo $PATH
/usr/local/bin:/home/tweety/scripts:/usr/lib/qt-3.3/bin:/usr/lib/ccache:/usr/bin:/bin:/usr/local/sbin:/usr/NX/bin:/home/tweety/profile/progs/bin/i86-lx:/sbin:/usr/sbin:/usr/X11R6/bin
tomh> sudo sample
sudo: sample: command not found
tomh> sudo /usr/local/bin/sample
/sbin:/bin:/usr/sbin:/usr/bin


Expected results:
tomh> echo $PATH
/usr/local/bin:/home/tweety/scripts:/usr/lib/qt-3.3/bin:/usr/lib/ccache:/usr/bin:/bin:/usr/local/sbin:/usr/NX/bin:/home/tweety/profile/progs/bin/i86-lx:/sbin:/usr/sbin:/usr/X11R6/bin
tomh> sudo sample
/usr/local/bin:/home/tweety/scripts:/usr/lib/qt-3.3/bin:/usr/lib/ccache:/usr/bin:/bin:/usr/local/sbin:/usr/NX/bin:/home/tweety/profile/progs/bin/i86-lx:/sbin:/usr/sbin:/usr/X11R6/bin

Additional info:
This worked in fedora 8 for sure, though I am not positive it retained
my entire path, but I am sure I was able to find things in /usr/local/bin

Comment 1 Karl Hastings 2008-12-11 21:38:46 UTC
The -V might be a documentation bug.  But I've already reported the regression wrt secure-path here:  https://bugzilla.redhat.com/show_bug.cgi?id=471603

Comment 2 Tom Horsley 2008-12-11 22:07:03 UTC
Yea, I decided I couldn't decide which one was the bug, but clearly
the -V options claims that PATH is preserved, and it ain't, so I put
in this bug to let the maintainers decide which one to fix :-).

Meanwhile, I downloaded the source and rebuilt it with /usr/local/bin
added to the end of the secure path. I think that fixes most of my
problems, and still helps prevent excess path pollution. Maybe
/usr/local/bin/should be added to the official release?

Comment 3 Fedora Update System 2009-05-12 12:50:43 UTC
sudo-1.7.1-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/sudo-1.7.1-2.fc10

Comment 4 Fedora Update System 2009-05-13 00:22:03 UTC
sudo-1.7.1-2.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sudo'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-4874

Comment 5 Fedora Update System 2009-06-16 02:43:09 UTC
sudo-1.7.1-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.