zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Leah Neukirchen <leah@vuxu.org>
Cc: zsh-workers@zsh.org
Subject: Re: _sh doing _normal completion
Date: Wed, 28 Mar 2018 14:59:09 +0100	[thread overview]
Message-ID: <20180328135909.GA17923@chaz.gmail.com> (raw)
In-Reply-To: <87d0zoe2iv.fsf@gmail.com>

2018-03-28 15:46:32 +0200, Leah Neukirchen:
[...]
> The main problem is that it floods the reasonable expansions (from .)
> with the full contents of $PATH.
[...]

Some sh implementations (bash, zsh, AT&T ksh) look-up slash-less
commands in $PATH if not found in the currently directory, some
(mksh, dash, yash) don't. Both behaviours are allowed by POSIX.

ksh88 actually looked it up in $PATH *before* the current
directory, causing security vulnerabilities on systems with
support for setuid scripts for instance.

If you want to run a script in the current directory, I would
suggest you get  used to typing:

sh ./myscr<Tab>

to avoid surprises on those systems that lookup scripts in
$PATH. The fact that zsh completes commands in $PATH when you do
sh myscr<Tab> is actually useful as a reminder that it's not a
wise thing to do.

-- 
Stephane


      reply	other threads:[~2018-03-28 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 13:34 Leah Neukirchen
2018-03-27 19:33 ` Peter Stephenson
2018-03-28 13:46   ` Leah Neukirchen
2018-03-28 13:59     ` Stephane Chazelas [this message]

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=20180328135909.GA17923@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=leah@vuxu.org \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).