On 2024-12-10 14:33:26, Eli Schwartz wrote:
> On 12/10/24 1:31 PM, Michael Orlitzky wrote:
> > On 2024-12-10 00:54:11, Eli Schwartz wrote:
> >>
> >> What circumstances other than a shebang might break without a full path?
> > 
> > When PATH is not reliable, like inside a cron job. Or arguments to execve().
> 
> execve doesn't make any sense to me as an argument. I don't think I've
> ever in my life either seen or heard of software that did a
> configure-time check for the full abspath of a file in order to solve
> the fact that execve doesn't search on PATH. They simply used execvpe
> instead.
> 
> ...
> 
> For the execve case it's possible to write a proof of concept
> demonstrating the issue, but writing a PoC to demonstrate that people
> can write incorrect code doesn't prove that people *do* write incorrect
> code so the logic is circular.

I think you think I'm making an argument that I'm not making. Here's
the scenario I imagine:

  * I want to run sed from another program
  * I put AC_PROG_SED in configure.ac
  * I notice that $SED is an absolute path, so I use execve() to run
    it

Or, maybe more realistically, suppose I don't know WTF I'm doing and
choose execve() from the list of exec* methods because I tried it and
works. I'm not using execve (as opposed to execvpe) to solve any
particular problem here, it's just what happened.

Reply via email to