All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guido Berhoerster <gber@opensuse.org>
To: dash@vger.kernel.org
Subject: Re: % in $PATH
Date: Mon, 10 Nov 2014 23:39:51 +0100	[thread overview]
Message-ID: <20141110223951.GB25437@hal.lan> (raw)
In-Reply-To: <20141110222332.GB3938@chaz.gmail.com>

* Stephane Chazelas <stephane.chazelas@gmail.com> [2014-11-10 23:23]:
> 2014-11-10 22:59:38 +0100, Guido Berhoerster:
> [...]
> > A much nicer solution would be to do something similar to the
> > original Korn shell and assign additional builtins a virtual
> > path which can be freely assigned in PATH and with which they can
> > be explicitly called. No more "%" in PATH and the feature can
> > be retained.
> [...]
> 
> Sounds to me like it's what dash does. It has %builtin (or
> /%builtin) where ksh93 has /opt/ast/bin.

That's kind of the point, this thread started about the trouble
that the "%" causes, using a virtual path like /usr/libexec/dash
or so instead should avoid the issue. That leaves the /path%func
case but there is precendence with FPATH as a solution if "%" is
to be completely eliminated from PATH.

> With ksh93, that's only for a few extra builtins that are only
> enabled if you add /opt/ast/bin to $PATH (or you can call them
> with "command /opt/ast/bin/cat").
> 
> I wouldn't say it's much better, it's still bad as being the
> hijacking of one namespace for something else.
> 
> dash's %builtin (as opposed to /path/to/functions%func) is
> potentially dangerous though because if you have that in your
> $PATH, you're vulnerable to attackers planting %builtin
> directories (in /tmp for instance) which will be considered by
> other things than dash/ash when looking up $PATH.
> 
> That's worked around by using /%builtin instead of %builtin
> though.
> 
> -- 
> Stephane
> --
> To unsubscribe from this list: send the line "unsubscribe dash" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Guido Berhoerster

  reply	other threads:[~2014-11-10 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 11:59 % in $PATH Stephane Chazelas
2014-11-10 13:20 ` Herbert Xu
2014-11-10 21:30   ` Stephane Chazelas
2014-11-10 21:59     ` Guido Berhoerster
2014-11-10 22:23       ` Stephane Chazelas
2014-11-10 22:39         ` Guido Berhoerster [this message]
2014-11-10 23:15           ` Stephane Chazelas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141110223951.GB25437@hal.lan \
    --to=gber@opensuse.org \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.