unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Greg Wooledge <wooledg@eeg.ccf.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 22354@debbugs.gnu.org, bug-bash@gnu.org
Subject: bug#22354: Hash-bang line length
Date: Wed, 13 Jan 2016 09:04:41 -0500	[thread overview]
Message-ID: <20160113140441.GZ27325__7010.29465203664$1452693920$gmane$org@eeg.ccf.org> (raw)
In-Reply-To: <87y4bt60zb.fsf@gnu.org>

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.

This just masks the problem.  Now, your script ONLY works when you
run it from a bash shell.  Not from any other shell, not via C's exec(),
not via find -exec, etc.

That said, it's not bash's place to try to guess how the host system's
kernel will handle the shebang.  I certainly wouldn't expect bash to
tell me "Hey, this is Linux, so your shebang won't work because it's
more than 127 bytes."

I'm not sure what error message or behavior you think bash should employ
in this scenario.  I don't see any clear "best" choice here.

  parent reply	other threads:[~2016-01-13 14:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87lh7t7p4w.fsf@gnu.org>
2016-01-13 13:19 ` bug#22354: Hash-bang line length Greg Wooledge
     [not found] ` <20160113131902.GU27325@eeg.ccf.org>
2016-01-13 13:52   ` Ludovic Courtès
     [not found]   ` <87y4bt60zb.fsf@gnu.org>
2016-01-13 14:04     ` Greg Wooledge [this message]
2016-01-13 16:21     ` Chet Ramey
     [not found]     ` <20160113140441.GZ27325@eeg.ccf.org>
2016-01-13 16:23       ` Chet Ramey
     [not found]       ` <56967A06.8040104@case.edu>
2016-01-13 16:39         ` Greg Wooledge
     [not found]     ` <56967976.2080908@case.edu>
2016-01-13 17:41       ` Ludovic Courtès
     [not found]       ` <87vb6x2x7u.fsf@gnu.org>
2016-01-13 20:47         ` Chet Ramey
2016-01-13 16:18 ` Chet Ramey
2016-01-12  9:14 bug#22354: Test failure when running distcheck from out-of-tree build Taylan Ulrich Bayırlı/Kammer
2016-01-13 10:25 ` bug#22354: Hash-bang line length Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20160113140441.GZ27325__7010.29465203664$1452693920$gmane$org@eeg.ccf.org' \
    --to=wooledg@eeg.ccf.org \
    --cc=22354@debbugs.gnu.org \
    --cc=bug-bash@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).