From owner-freebsd-bugs Mon Nov 19 7:50: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 156C737B41A for ; Mon, 19 Nov 2001 07:50:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fAJFo1r11790; Mon, 19 Nov 2001 07:50:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E437037B416 for ; Mon, 19 Nov 2001 07:49:10 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fAJFnAl10476; Mon, 19 Nov 2001 07:49:10 -0800 (PST) (envelope-from nobody) Message-Id: <200111191549.fAJFnAl10476@freefall.freebsd.org> Date: Mon, 19 Nov 2001 07:49:10 -0800 (PST) From: Magnus Backstrom To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/32106: Scripts with #!/interpreter paths longer than 64 bytes don't work. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 32106 >Category: kern >Synopsis: Scripts with #!/interpreter paths longer than 64 bytes don't work. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 19 07:50:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Magnus Backstrom >Release: 4.4-STABLE and 5.0-CURRENT >Organization: Chalmers UofT >Environment: FreeBSD j0.etek.chalmers.se 4.4-STABLE FreeBSD 4.4-STABLE #0: Thu Nov 1 09:35:50 CET 2001 b@j0.etek.chalmers.se:/usr/src/sys/compile/J0 i386 >Description: If an interpreter pathname is longer than about 64 characters, i.e. #!/you/have/a/slightly/longer/than/usual/path/to/your/interpreter, /bin/sh gets used instead and your script may break. >How-To-Repeat: x> mkdir -p /tmp/this/is/a/slightly/too/long/path/to/the/interpreter x> ln -s /usr/bin/awk \ /tmp/this/is/a/slightly/too/long/path/to/the/interpreter x> cat > /tmp/test.awk #!/tmp/this/is/a/slightly/too/long/path/to/the/interpreter/awk -f { 1 } x> chmod +x /tmp/test.awk x> /tmp/test.awk {: Command not found. x> >Fix: Change line 39 of /usr/src/sys/sys/imgact.h from #define MAXSHELLCMDLEN 64 to something more sensible, e g #define MAXSHELLCMDLEN 512 This doesn't seem to break anything. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message