Bug 1506582 - sudo: Please change default secure_path to match Fedora default PATH for root
Summary: sudo: Please change default secure_path to match Fedora default PATH for root
Keywords:
Status: CLOSED DUPLICATE of bug 1166185
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Kopeček
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-26 11:02 UTC by Kevin Kofler
Modified: 2017-10-26 11:05 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-10-26 11:05:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1506422 0 medium CLOSED kf5-kdesu: Please patch hardcoded PATH prefix to match Fedora default PATH for root 2021-02-22 00:41:40 UTC

Internal Links: 1506422

Description Kevin Kofler 2017-10-26 11:02:55 UTC
Description of problem:
The default /etc/sudoers currently contains the following secure_path setting:
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Not only is this duplicating the paths (since UsrMove), but also, most crucially, the /usr/local/* paths are missing. Hence, it is not possible to use binaries in /usr/local. (The /usr/local paths should also come first to allow overriding system binaries with newer or modified versions in /usr/local. But sudo doesn't even search /usr/local at all.) Please note that /usr/local is only writable by root and thus perfectly secure. Please change the setting to:
Defaults    secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

Version-Release number of selected component (if applicable):
sudo-1.8.21p2-1.fc2[5678]

How reproducible:
Always

Steps to Reproduce:
1. sudo sh -c 'echo "$PATH"'
2. Compare with su - -c 'echo "$PATH"'

Actual results:
The output of step 1 is just "/sbin:/bin:/usr/sbin:/usr/bin", not honoring /usr/local. The comparison step 2 outputs a sensible path.

Expected results:
Step 1 outputs a path equivalent to step 2.

Additional info:
kdesu misbehaves similarly, I filed bug #1506422 for that, and I found this bug while debugging that.

Comment 1 Matthew Miller 2017-10-26 11:05:18 UTC

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


Note You need to log in before you can comment on or make changes to this bug.