bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: psmith@gnu.org
Cc: bug-gnulib@gnu.org
Subject: Re: [PATCH] findprog: Support searching in a specified path string
Date: Sun, 08 Sep 2019 19:48:44 +0200	[thread overview]
Message-ID: <2906116.4hz8Lom1yu@omega> (raw)
In-Reply-To: <d53163f0e1059d0a02db63842fab5ea856206fc2.camel@gnu.org>

Hi Paul,

> > > I find that VERY odd, and possibly a security risk.  According to
> > > POSIX, the behavior if PATH is not present or is empty is
> > > implementation-defined and my preference/expectation would be to behave
> > > as if the program is not found.  However, that's a different
> > > discussion.
> > 
> > Your preference does not match what systems do.
> > 
> > Things are most robust if - the other differences set aside -
> >   find_in_path (prog)
> > is equivalent to
> >   find_in_path_str (prog, getenv ("PATH")).
> 
> My suggestion was that BOTH these functions should not assume the CWD
> if PATH is empty or missing, not that they should behave differently.

OK. But what, do you suggest, should the functions do when confronted to
an empty path? What is 'make' supposed to do when the Makefile defines
  PATH =
?

> My personal opinion is that it's not difficult to come up with ways
> findprog can be useful _in addition_ to simply being a precursor to
> exec

In this case we should probably add a flag argument that tells the
function to do the complete lookup also when the progname contains a
slash. For now, until someone claims that this functionality would
be actually useful, I'll leave it as is.

Bruno



  reply	other threads:[~2019-09-08 17:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 23:10 [PATCH] findprog: Support searching in a specified path string Paul Smith
2019-09-06 23:21 ` Paul Smith
2019-09-07 10:42 ` Bruno Haible
2019-09-07 13:17   ` Paul Smith
2019-09-08 11:38     ` Bruno Haible
2019-09-08 14:03       ` Paul Smith
2019-09-08 14:59         ` Bruno Haible
2019-09-08 16:25           ` Bruno Haible
2019-09-08 17:34           ` Paul Smith
2019-09-08 17:48             ` Bruno Haible [this message]
2019-09-08 17:59               ` Paul Smith
2019-09-09 18:54                 ` Bruno Haible
2019-09-10 13:18                   ` Paul Smith
2019-09-14 11:20                     ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=2906116.4hz8Lom1yu@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=psmith@gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).