Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 175129 - Propose to remove /usr/local/bin from PATH
Summary: Propose to remove /usr/local/bin from PATH
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 18:34 UTC by Michael Hordijk
Modified: 2007-04-18 19:52 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hordijk 2007-04-18 18:34:38 UTC
/etc/profile unconditionally adds /usr/local/bin (and /usr/local/sbin for root) to PATH.  I don't believe this is the correct place to do this.

1. I don't know of any ebuild that installs into /usr/local/bin
2. If a user installs something into /usr/local/bin, they may add it to the PATH via /etc/env.d/
3. ebuilds that install to /opt/<somepackage> usually install something into /etc/env.d.
4. "/opt/bin" is added via 00basic
5. There is no way to REMOVE /usr/local/bin (or even change it's relative ordering) without directly editing /etc/profile (which is a non-starter if I wanted to do it via a custom ebuild).

Basically, item 5 is the thing that concerns me.  I would like to be able to configure /usr/local/bin in a programmatic way just like any other path outside of /bin and /usr/bin.  Not only is editing /etc/profile a pain on multiple machines, it makes etc-update that much more error prone.

I'm thinking if the user installs something into /usr/local, then they can add something to, say, /etc/env.d/99local?

Reproducible: Always

Steps to Reproduce:
Comment 1 Michael Hordijk 2007-04-18 18:37:29 UTC
One other note, I'm not sure how legitimate this is.

We don't include /etc/profile.env for root PATHs for security reasons.  (See bug #156404.)  Since gentoo does not install anything into /usr/local, is it a security issue to prepend it to the path?
Comment 2 SpanKY gentoo-dev 2007-04-18 19:10:37 UTC
edit your /etc/profile to suite your needs
Comment 3 Michael Hordijk 2007-04-18 19:31:04 UTC
(In reply to comment #2)
> edit your /etc/profile to suite your needs

Uh, ick.

That blows when it's more than a handful of machines.  I use gentoo because I have many machines that do not have similar configurations.  I use custom ebuild overlays to manage configurations and such.  Using a common /etc is not really an option.  Is this to be one facet that Gentoo forces to be a certain way (i.e. I can't make this choice without editing a file that will get blown away in the next baselayout upgrade)?
Comment 4 SpanKY gentoo-dev 2007-04-18 19:43:17 UTC
who said /etc/profile gets blown away ?  it's config protected, so unless you blow it away, it wont be

your solution of /etc/env.d/ will get blown away automatically though as that directory is config masked

as for this being some sort of weird Gentooism, every other distro out there ive checked does the same exact thing

you could easily drop a file into /etc/profile.d/ that would delete elements from your PATH you (for some reason) find objectable
Comment 5 Michael Hordijk 2007-04-18 19:52:05 UTC
(In reply to comment #4)
> who said /etc/profile gets blown away ?  it's config protected, so unless you
> blow it away, it wont be

Eh, etc-update can still be a pain on multiple machines... :)

> your solution of /etc/env.d/ will get blown away automatically though as that
> directory is config masked

Not if I put a file in there via a custom ebuild?

> as for this being some sort of weird Gentooism, every other distro out there
> ive checked does the same exact thing

Didn't say it was weird, just not easily configurable.  However:

> you could easily drop a file into /etc/profile.d/ that would delete elements
> from your PATH you (for some reason) find objectable

Ah-hah!  Great idea!  Thank you very much.  I was indeed looking for exactly that.  Perfect!  I appreciate you sticking through this and helping me out! :)