[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: $HOME/bin



Michal Hlavinka wrote:
Paul W. Frields wrote:
On Mon, Jul 13, 2009 at 02:08:55PM +0200, Ondřej Vašík wrote:
Stefan Assmann wrote:
Hi all,

I was wondering why there's no $HOME/bin directory and $HOME/bin not
mentioned in the $PATH variable. Any particular reason not to have that
by default?
$HOME/bin is not on every system and the other default directories in
default PATH are(at least on the most of systems ;) ). However, some
Linux distros do add something as:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
as default - so this dir gets added automatically when does exist.
I'm generally +1 for changing the default that way - as it would not
change anything for users without that directory.
I would only want this at the *end* of the current PATH, not the
beginning, for obvious security reasons.
1. Your practice to a wide extend defeats one prime rationale for ~/bin:
Replacing/Overriding vendor-provided applications by per-user installed
versions.

2. Unless using ~/bin as root, these files are user-installed binaries,
which under normal circumstances may only have security impacts on user
files => What you call "obvious security reasons" are minor concerns.

if "su" (instead of "su -") is used, root will inherit user's environment including PATH.
Yes, but ... we are talking about ordinary users here, not about users who have root access. These people have other means to install packages.

For ordinary users, prepending ~/bin to $PATH is the only approach e.g. to replace vendor-supplied applications, the "security risks" are almost non-existent.

Ralf


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]