[Top][All Lists]

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

Re: Alpine: useless-if-before-free: Exec format error

From: Bruno Haible
Subject: Re: Alpine: useless-if-before-free: Exec format error
Date: Sat, 15 Jun 2019 01:51:31 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; )

>    Since xargs happens to use execvp(), the executable gets executed by "a
>    known command interpreter". This command interpreter might be sh, python,
>    emacs, or whatever.
> So, the *omission* of #! renders a script non-portable, when that script is
> invoked like an executable.

Anyway, there seems to be an agreement that execvp() needs to execute scripts
through a command interpreter, unlike execv().

  * The glibc source code does so, see glibc/posix/execvpe.c.
    Also the description of this commit:

  * The musl author agrees as well:

So, the ENOEXEC error is a bug in musl. But POSIX does not specify that the
command interpreter for scripts without shebang is /bin/sh; therefore IMHO
it would be good not to make this assumption.


reply via email to

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