From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chet Ramey Subject: bug#22354: Hash-bang line length Date: Wed, 13 Jan 2016 11:23:34 -0500 Message-ID: <56967A06.8040104__25967.2860535376$1452710382$gmane$org@case.edu> References: <87lh7t7p4w.fsf@gnu.org> <20160113131902.GU27325@eeg.ccf.org> <87y4bt60zb.fsf@gnu.org> <20160113140441.GZ27325@eeg.ccf.org> Reply-To: chet.ramey@case.edu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJOEM-0003lF-HS for bug-guix@gnu.org; Wed, 13 Jan 2016 11:25:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJOEI-0006eb-D6 for bug-guix@gnu.org; Wed, 13 Jan 2016 11:25:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:60224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJOEI-0006eW-9x for bug-guix@gnu.org; Wed, 13 Jan 2016 11:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aJOEI-0002kS-5N for bug-guix@gnu.org; Wed, 13 Jan 2016 11:25:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20160113140441.GZ27325@eeg.ccf.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Greg Wooledge , Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 22354@debbugs.gnu.org, bug-bash@gnu.org, chet.ramey@case.edu On 1/13/16 9:04 AM, Greg Wooledge wrote: > On Wed, Jan 13, 2016 at 02:52:08PM +0100, Ludovic Courtès wrote: >> Sure, but the fact that it???s smaller than that of the kernel Linux is >> problematic: when a hash-bang line > 127 chars is encountered, ???execve??? >> fails with ENOENT, so Bash???s fallback code is executed, fails as well, >> but it prints a misleading error message with an even more truncated >> hash-bang line. > > Let's suppose bash is changed to read a shebang line of unlimited length. > In your scenario, the script with the 150 character shebang fails at the > kernel level with ENOENT, so bash's fallback code runs, and the script > is executed by a new instance of bash. No, it isn't. The execve fails with ENOENT, so bash just prints an error message containing the interpreter name, which Ludo is reporting is truncated. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/