bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: igawk unsafe temporary file handling


From: solar
Subject: Re: igawk unsafe temporary file handling
Date: Mon, 28 May 2001 05:27:27 +0400
User-agent: Mutt/1.2.5i

On Sun, May 27, 2001 at 05:45:49PM -0700, Paul Eggert wrote:
> > Date: Mon, 28 May 2001 04:02:10 +0400
> > From: address@hidden
> > 
> > why not implement the entire igawk in awk?
> 
> I didn't offhand see how to do it in awk.

Well, I think it would have to run another instance of gawk similarly
to what the shell script does.

> > Is /dev/stdin sufficiently portable?
> 
> Should be.  Gawk supports /dev/stdin even if the OS doesn't.

You're right.  I didn't think this applied to file names given on the
command line, but I've just checked that it does.

> > I suspect some shells may have low limits on the size of variables....
> > Now this is limited by the kernel.
> 
> I wouldn't worry about those limits too much.  It's just an example.

OK.

> > Linux allows for up to 32 pages
> > for argv[] + envp[] (128 KB on x86), but some other systems have a
> > lower limit, possibly as low as one page.
> 
> Such a limit is way too low.  Even Linux/x86's limit is too low.

I'm not so sure.

If someone uses long command lines instead of xargs, they better be
notified earlier than later.

SUSv2 says this:

ARG_MAX
       Maximum length of argument to the exec functions including
environment data. Minimum Acceptable Value: _POSIX_ARG_MAX 

_POSIX_ARG_MAX
       Maximum length of argument to the exec functions including
environment data. Value: 4 096

A related discussion:

http://mail.gnu.org/pipermail/bug-make/2000-November/002055.html
http://mail.gnu.org/pipermail/bug-make/2000-November/002057.html

> It might not hurt to add a comment about these undersized limits.  But
> I don't think the code needs to be rewritten to worry about this, any
> more than the existing gawk code has to worry about the issue of /tmp
> filesystems being too small.  It's just an example.

OK.

-- 
/sd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]