Home_greyopenFATE - openSUSE feature tracking > #310311
Dashboard | Search | Sign up | Login

Please login or register to be able to edit or vote this feature.

Unify default PATH

Feature state

openSUSE Distribution
Unconfirmed

Description

The default PATH settings for root and normal users are inconsistent at various places in the distribution: 
glibc - /usr/include/paths.h:
#define _PATH_DEFPATH "/usr/bin:/bin"
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
coreutils - /etc/default/su:
PATH=/usr/local/bin:/bin:/usr/bin
SUPATH=/usr/sbin:/bin:/usr/bin:/sbin
coreutils - /bin/su:
#define DEFAULT_LOGIN_PATH "/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin"
#define DEFAULT_ROOT_LOGIN_PATH "/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin"
pwdutils - /etc/login.defs:
ENV_PATH /usr/local/bin:/usr/bin:/bin
ENV_ROOTPATH /sbin:/bin:/usr/sbin:/usr/bin
aaa_base - /etc/profile and /etc/csh.login
PATH=/usr/local/bin:/usr/bin:/bin
PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
sudo:
--with-secure-path=/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin

... and probably many more ...

The default PATH setting should be made consistent across all tools.

Discussion


icons/user_comment.png J. E. wrote: (3 years ago)

Certainly. Many administrator-level tools (that are in sbin) are also executable and meaningful to a user - like /sbin/ip. The two groups should have the same base PATH.

icons/user_comment.png J. M. wrote: (3 years ago)

most administrator-level tools that are meaningful to users are already symlinked to 'bin' - my guess is that if there is a tool that is not symlinked, that is a bug of the current solution, not a conceptual problem

icons/user_comment.png J. W. wrote: (13 months ago)

Currently (12.3) I can see only two such symlinks in /bin: ip -> /usr/sbin/ip, pidof -> /sbin/killall5

But as yast, ifconfig, modinfo, and tcpdump are already known to be missing, I'd say, only a few meaningful tools are symlinked. Please also note, that Ludwig asked for path consolidation, not for workarounds. I'd consider symlinks an acceptable solution, though.

icons/user_comment.png G. M. wrote: (3 years ago)

modinfo and tcpdump (e.g. use it to read from a file) are just two of them. I could search for more of them...

icons/user_comment.png J. W. wrote: (3 years ago)

How about looking at the opposite list: Are there any admin-level tools that must not (or should not) be in a user's PATH?

icons/user_comment.png J. E. wrote: (3 years ago)

Well it seems like a good idea that users do not have their time wasted in tab completion by tools they can definitely not be used as an unprivileged user, or tools where it does not make sense (like /sbin/init).  I also think that tools that are normally not run as a user (sshd, apache) should remain in sbin, even if they can be configured, tricked and abused to run on an unprivileged configuration.

icons/user_comment.png A. J. wrote: (2 years ago)

I think the first step here is coming up with a proposal how the paths should look like.
What about the following, is content and order ok?

* normal user: /usr/local/bin:/usr/bin:/bin
* root: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin

I suggest to remove /usr/X11R6/bin from the binaries but let profile add it if the path exists.

icons/user_comment.png A. J. wrote: (2 years ago)

Double checking the list above: Where should /usr/local/bin get included and where not?

icons/user_comment.png J. E. wrote: (2 years ago)

Dropping /usr/local from root's PATH is somewhat counter to... root having installed local packages in the first place.

Last change: 13 months ago
Voting
Score: 16
  • Negative: 1
  • Neutral: 1
  • Positive: 17
Feature Export
Application-xmlXML   Text-x-logPlaintext   PrinterPrint