[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 12:41:03 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; )

I wrote:
> 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.

<https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html> says
  "In the cases where the other members of the exec family of functions
   would fail and set errno to [ENOEXEC], the execlp() and execvp() functions
   shall execute a command interpreter and the environment of the executed
   command shall be as if the process invoked the sh utility using execl()
   as follows:

     execl(<shell path>, arg0, file, arg1, ..., (char *)0);

   where <shell path> is an unspecified pathname for the sh utility ..."

So, the command interpreter must be sh-compatible; only its file name is

=> We need to change 'useless-if-before-free' not because of POSIX,
but only because of the musl bug and/or for systems that are compliant
with older versions of POSIX (older than POSIX:2017).


reply via email to

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