[PATCH] argv[0] of execvp when ENOEXEC
Rob Landley
rob at landley.net
Wed Aug 21 18:16:56 UTC 2013
On 08/21/2013 12:52:26 PM, Rich Felker wrote:
> On Wed, Aug 21, 2013 at 12:36:00PM -0500, Rob Landley wrote:
> > On 08/21/2013 09:16:29 AM, Wei-cheng Wang wrote:
> > >On Wed, Aug 21, 2013 at 6:12 PM, Denys Vlasenko
> > ><vda.linux at googlemail.com> wrote:
> > >> On Tue, Aug 20, 2013 at 6:42 PM, Wei-cheng Wang
> > ><cole945 at gmail.com> wrote:
> > >> You mean, this happens if foo.sh is a non-executable file
> > > Yes. foo.sh a shell script with execute permission without #! at
> > >the very first line.
> > > For example,
> > > $ echo "echo hello" > ./foo.sh
> > > $ chmod a+x ./foo.sh
> > > $ ./foo.sh
> > > hello
> > >> and /bin/sh is a symlink to busybox?
> > > Yes. busybox, toybox, toolbox (android) and similar tools use
> > >this way to
> > > provides multiple Unix tools with a single executable binary.
> >
> > gzip/gunzip detecting whether to force the -d flag predates them all
> > by a decade, and I'm told the bell labs guys were already doing it
> > in the 70's in Programmer's Workbench...
>
> This analogy is not relevant because gzip/gunzip are not part of POSIX
> and the specification of execvp does not require invoking them in a
> way that breaks with the multicall binary idiom.
It's relevant in that it's a common usage going back almost 40 years,
and individual problematic cases can have a trivial wrapper.
Rob
More information about the uClibc
mailing list