From: Bill Maas <bill@stsx.org>
To: dash list <dash@vger.kernel.org>
Subject: Re: Shell source with relative pathname does not work
Date: Sun, 27 Apr 2008 21:41:34 +0200 [thread overview]
Message-ID: <1209325294.14630.15.camel@aurora.internal> (raw)
In-Reply-To: <slrng18mf9.pr0.!gmane?olecom.ENOMSG@flower.upol.cz>
Hello Oleg,
thanks for your reply.
On Sun, 2008-04-27 at 13:54 +0200, Oleg Verych wrote:
> http://www.opengroup.org/onlinepubs/009695399/utilities/dot.html
>
> So, behavior must be as for ordinary binaries -- searching PATH and
> not current dir. by default. IMHO quite good decision -- care where
> you are, and what you are executing.
. file fails
. path/to/file succeeds (note the missing leading /)
> `bash` seem to do searching in `.', but this must be its feature.
So in the second case, dash must be doing the same as bash. I think that
from the point of security, failing in the first case and not in the
second is a bit odd. The safe criterium should be "starts with a slash
or a dot" (not: contains a slash).
But since the sourcing program has either already been checked for exec
bit and leading [./] or presence in PATH or has been started as "sh
file", any limitation is probably overdone. And whether performed from a
script or from the commandline, it's just another case of "[builtin]
command arg".
The PATH thing applies to executables which are to be run with no
executing command (such as "sh"), hence the search path is limited.
Sourced files do not run on their own (so to speak), so PATH does not
apply here. Sourcing scripts should be trusted to know what they want,
no need to think for them.
IMHO;) Hope I'm being a bit clear.
Thanks,
Bill
next prev parent reply other threads:[~2008-04-27 19:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-27 7:53 Shell source with relative pathname does not work Bill Maas
2008-04-27 11:54 ` Oleg Verych
2008-04-27 12:19 ` executing with Bash (Re: Shell source with relative pathname does not work) Oleg Verych
2008-04-27 19:41 ` Bill Maas [this message]
2008-04-27 19:57 ` Shell source with relative pathname does not work Bill Maas
2008-04-27 20:18 ` H. Peter Anvin
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=1209325294.14630.15.camel@aurora.internal \
--to=bill@stsx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox