From owner-freebsd-questions Thu Nov 16 15:42:47 2000 Delivered-To: freebsd-questions@freebsd.org Received: from eeyore.sebster.com (e163161.upc-e.chello.nl [213.93.163.161]) by hub.freebsd.org (Postfix) with SMTP id 929CA37B4E5 for ; Thu, 16 Nov 2000 15:42:41 -0800 (PST) Received: (qmail 10042 invoked by uid 1000); 16 Nov 2000 23:42:39 -0000 Date: Fri, 17 Nov 2000 00:42:39 +0100 From: Sebastiaan van Erk To: Alfred Perlstein Cc: freebsd-questions@freebsd.org Subject: Re: argument list too long Message-ID: <20001117004239.A3656@sebster.com> References: <20001116091607.A97857@sebster.com> <00111621362707.00522@shalimar.net.au> <20001116122313.A69018@sebster.com> <00111700205500.61931@shalimar.net.au> <20001116145641.A22842@sebster.com> <20001116105654.G830@fw.wintelcom.net> <20001116231731.A14470@c187104187.telekabel.chello.nl> <20001116143843.S830@fw.wintelcom.net> <20001117000816.B15150@c187104187.telekabel.chello.nl> <20001116152421.A18037@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001116152421.A18037@fw.wintelcom.net>; from bright@wintelcom.net on Thu, Nov 16, 2000 at 03:24:21PM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > And what about Bob down the hall that's screwed because your program > just allocated all the kernel memory to pass your super long arglist? > > What about the next program you want to run? What about them? Are you saying nobody can think up a way of passing long argument lists without crashing the machine? What about: int main() { while(1) malloc(1024); } THEN what about Bob? Why don't you limit argument lists in the same way that you limit users? The user allocates the list and passes a pointer to it to execve? I don't see any reason for the kernel ever needing to copy the list. > I'm not assuming very little memory, I'm assuming that it wouldn't > be good if one was able to cause a machine to fail all further > execs by just passing a multimegabyte arglist. True. That wouldn't be good. But it just wouldn't have to happen. > So why not use the tools already available before trying to foster > these silly new ways apon us. Well I think it's not so silly to be able to do a tar `find / -name '*.jsp'`. Actually what would really be neat in my opinion would be if you could specify (in a generic way) that you want to read your program to read the arguments from a file. That way you don't have to rely on the program to give you this option, and you don't have to be limitted by arg list lengths either, because you can actually implement something as command `command1` fixed args `command 2` (schematically) as (command1; echo fixed args; command2) | command --args-from - This would be a much more efficient (lazy evaluation and such) implementation of backquote substitution, and it would give you unlimitted argument lists as well! Greetings, Sebastiaan van Erk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message