[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:
https://sourceware.org/git/?p=glibc.git;a=commit;h=283d98512272a12cb84e7798c23edbdf1adb287d
* The musl author agrees as well:
https://www.openwall.com/lists/musl/2018/03/09/1
https://www.openwall.com/lists/musl/2018/03/09/2
https://www.openwall.com/lists/musl/2018/03/11/1
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.
Bruno
- Alpine: useless-if-before-free: Exec format error, Tim Rühsen, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Paul Eggert, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Tim Rühsen, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Bruno Haible, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Eric Blake, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Bruno Haible, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error,
Bruno Haible <=
- Re: Alpine: useless-if-before-free: Exec format error, Paul Eggert, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Bruno Haible, 2019/06/14
- Re: Alpine: useless-if-before-free: Exec format error, Paul Eggert, 2019/06/15
- Re: Alpine: useless-if-before-free: Exec format error, Bruno Haible, 2019/06/15
- Re: Alpine: useless-if-before-free: Exec format error, Darshit Shah, 2019/06/15
- Re: Emacs time stamp hook, Bruno Haible, 2019/06/15
- Re: Emacs time stamp hook, Darshit Shah, 2019/06/15
- Re: Emacs time stamp hook, Bruno Haible, 2019/06/15
- Re: Emacs time stamp hook, Paul Eggert, 2019/06/15
- Re: Emacs time stamp hook, Bruno Haible, 2019/06/15