OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Any reason /usr/local is not at the top of PATH for root?
« previous next »
  • Print
Pages: [1]

Author Topic: Any reason /usr/local is not at the top of PATH for root?  (Read 4958 times)

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Any reason /usr/local is not at the top of PATH for root?
« on: January 28, 2016, 08:00:19 pm »
It's all in the title. I'm just wondering why it isn't set up that way.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Any reason /usr/local is not at the top of PATH for root?
« Reply #1 on: January 28, 2016, 08:41:35 pm »
A quick look at FreeBSD sources reveals...

$ cd etc/root/
$ git grep usr.local
dot.cshrc:set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
dot.profile:PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin

I suspect this is for security reasons, /usr/local not being able to override system binaries, but I don't know.

What I find also worrying is that stock FreeBSD doesn't honour /usr/local in /etc/rc, which defeats the point of installing scripting languages under /usr/local which are then used by system services.

What are your reasons for changing this? Does a local modification of root's PATH not suffice?
Logged

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Re: Any reason /usr/local is not at the top of PATH for root?
« Reply #2 on: January 28, 2016, 08:53:15 pm »
Quote
I suspect this is for security reasons, /usr/local not being able to override system binaries, but I don't know.

I thought it might be the reason, but at the same time it's not convenient and chances are high that we're going to run the wrong binary from time to time.

I'm thinking about openssl per example.

I usually put it first, but was wondering if it would break something within opnsense.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Any reason /usr/local is not at the top of PATH for root?
« Reply #3 on: January 29, 2016, 12:32:07 am »
Yes, openssl, which shouldn't be duplicated by the base system, but it still is. Do you have a second example?
Logged

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Re: Any reason /usr/local is not at the top of PATH for root?
« Reply #4 on: January 29, 2016, 01:04:35 am »
ld because I sometimes check that it's the gold version, but that's probably just me.
Then there might be some newer version of some tools, like archivers, but it's true that it's not like a real OS where one might replace more components with the newest versions from ports.

Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Any reason /usr/local is not at the top of PATH for root?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2