From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1B2471F462 for ; Fri, 14 Jun 2019 23:51:59 +0000 (UTC) Received: from localhost ([::1]:57684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbvz9-0007Ef-8Z for normalperson@yhbt.net; Fri, 14 Jun 2019 19:51:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51217) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbvz4-000773-8P for bug-gnulib@gnu.org; Fri, 14 Jun 2019 19:51:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbvz2-0001Ry-19 for bug-gnulib@gnu.org; Fri, 14 Jun 2019 19:51:50 -0400 Received: from mo6-p01-ob.smtp.rzone.de ([2a01:238:20a:202:5301::3]:29882) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbvz0-0001Kc-OR for bug-gnulib@gnu.org; Fri, 14 Jun 2019 19:51:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1560556302; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=V67HUtkSyrrgPNReADa5vsrFMZk60RUUMHKQWgaZewo=; b=pECB95wi8fKklgzJVWtUX4gjeOX66CjtG0OKBC73OXxw03YGe2A28j/2h7Q39edAzT wZd6PX4fhQQaMgRlcqlWNKK2ykVKzIFG4eOplOVLAQwWLtxC2LXraQnQNUxDjwwHjdE4 WNGlPpUsu3IYCrltOeAL2YgTKo0d0yGDLUKJK+KIw61c1zPVJ40CSWUqN2k5cAqg7p2C 4+U/wir5XfOumWCcsQA/PcL2wZtQbDo0519PY1BwnYo+rGpeol64XNcZFnnLZ0QM8f2O gUfLBTYymRFiC/4aYeyRvH/ppTLinkpoI6Wl7CqBFJjEczWK3TM55ji5uTvlgggmoSoo FoZw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0y5RW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.23 DYNA|AUTH) with ESMTPSA id 603f20v5ENpWBTA (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 15 Jun 2019 01:51:32 +0200 (CEST) From: Bruno Haible To: Eric Blake Subject: Re: Alpine: useless-if-before-free: Exec format error Date: Sat, 15 Jun 2019 01:51:31 +0200 Message-ID: <4819709.utxfUYQY1k@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1830524.EATPkW6D9P@omega> References: <365b73af-3fb2-bd69-e3a2-3cc4cebc4ef9@gmx.de> <80967afc-a43a-47a0-0234-0f6344d1bd7f@redhat.com> <1830524.EATPkW6D9P@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5301::3 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim =?ISO-8859-1?Q?R=FChsen?= , bug-gnulib@gnu.org, Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" > 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