Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277537 - $PATH — /sbin and /bin should be after /usr/*
Summary: $PATH — /sbin and /bin should be after /usr/*
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 210077 288499
  Show dependency tree
 
Reported: 2009-07-12 21:00 UTC by Michał Górny
Modified: 2009-10-11 00:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to change $PATH set by ebuild.sh (portage-2.2_rc33-path.diff,1.14 KB, patch)
2009-07-12 21:43 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-12 21:00:28 UTC
=sys-apps/portage-2.2_rc33 in ebuild.sh defines PATH likes this:

PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin${ROOTPATH:+:}$ROOTPATH

Is there any real reason to keep /bin and /sbin before /usr ones? In my opinion, /usr/*bin should be placed before /*bin in $PATH.

Firstly, /*bin can contain some kind of stripped down versions of utilities which doesn't require /usr to be mounted. And then /usr/*bin would contain full-featured versions which should be used instead if /usr is available.

Secondly, this $PATH already contains /usr/local/*bin before /*bin and thus allows user to override root binaries with /usr/local ones. To keep the hierarchy clean we should allow /usr ones to override them too.

Moreover, this is the way /etc/profile by default (=baselayout-2.0.1) defines PATH. Thus, if there's no real reason to keep /*bin before /usr/*bin in portage-defined PATH, I think the PATH definition should be modified to:

PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin${ROOTPATH:+:}$ROOTPATH
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-12 21:43:48 UTC
Created attachment 197675 [details, diff]
Patch to change $PATH set by ebuild.sh
Comment 2 Zac Medico gentoo-dev 2009-08-06 19:27:24 UTC
Thanks, this is in svn r13935.

I copied the order from /etc/profile:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Comment 3 Zac Medico gentoo-dev 2009-08-10 00:25:23 UTC
This is fixed in 2.2_rc37.
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-08-24 11:49:23 UTC
Not released in 2.1.*.
Comment 5 Zac Medico gentoo-dev 2009-10-11 00:55:59 UTC
This is fixed in 2.1.7.