From owner-freebsd-hackers Fri Nov 27 03:09:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA08552 for freebsd-hackers-outgoing; Fri, 27 Nov 1998 03:09:23 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id DAA08545 for ; Fri, 27 Nov 1998 03:09:16 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id KAA11281; Fri, 27 Nov 1998 10:14:18 +0100 From: Luigi Rizzo Message-Id: <199811270914.KAA11281@labinfo.iet.unipi.it> Subject: 64 char limit for #!/ command interpreters ? To: hackers@FreeBSD.ORG Date: Fri, 27 Nov 1998 10:14:17 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I use to put in my MagicPoint presentations a first line of the form #!/usr/local/bin/mgp ...bla bla bla... so that the interpreter is invoked automatically on the presentation file. Not without surprise, i just noticed that the process fails if the first line is longer than 64 characters (this is on 2.2.6). The limit is apparently in /sys/kern/imgact_shell.c: #define MAXSHELLCMDLEN 64 Now, any idea why the limit is so small, and is there any danger to raise it to a much larger value such as 256 or so ? The reason i am asking is because this mechanism becomes more useful as the number of parameters increases... (and i happen to have hit the limit!) I think i know why the limit is there -- to avoid that some arbitrary binary file can be mistaken for a shell script with an interpreter name if an newline is not found "soon". Still, as we can have a pathname up to 1KB (PATH_MAX in syslimits.h) the 64byte constraint seems a bit inconsistent... luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message