Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2000 00:42:39 +0100
From:      Sebastiaan van Erk <sebster@sebster.com>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: argument list too long
Message-ID:  <20001117004239.A3656@sebster.com>
In-Reply-To: <20001116152421.A18037@fw.wintelcom.net>; from bright@wintelcom.net on Thu, Nov 16, 2000 at 03:24:21PM -0800
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001117004239.A3656>