[PATCH v5 6/9] ash: use BB_EXECVPE to execute commands with FEATURE_SH_STANDALONE

Nadav Tasher tashernadav at gmail.com
Fri Jan 31 13:53:05 UTC 2025


On Thu, Jan 30, 2025 at 09:33:16AM +0000, Ron Yorston wrote:
> Nadav Tasher <tashernadav at gmail.com> wrote:
> >This change makes the standalone shell use the BB_EXECVPE utility.
> >BB_EXECVPE calls BB_EXECVP which has NOEXEC and applets only logic.
> 
> Hold on, this isn't right.  In standalone shell mode BB_EXECVPE()
> uses execvpe() to execute a command that isn't an applet, thus
> resulting in a path search.
> 
> But the shell doesn't perform path lookup the same way as execvpe().
> The shell's path lookup is handled by the explicit PATH search loop
> in shellexec().  It shouldn't be preempted by a call to execvpe() in
> tryexec().
> 
> Cheers,
> 
> Ron
Why is this important?

I assumed they did a close-enough logic that it didn't matter,
which is why I switched the logic to BB_EXECVPE.

Nadav


More information about the busybox mailing list