bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] findprog: Support searching in a specified path string


From: Bruno Haible
Subject: Re: [PATCH] findprog: Support searching in a specified path string
Date: Sun, 08 Sep 2019 19:48:44 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-159-generic; KDE/5.18.0; x86_64; ; )

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 via email to

[Prev in Thread] Current Thread [Next in Thread]