bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] [PATCH] gawk 4.1.1 replace "/inet" with preprocessor macr


From: Dave Sines
Subject: Re: [bug-gawk] [PATCH] gawk 4.1.1 replace "/inet" with preprocessor macro
Date: Tue, 15 Apr 2014 18:30:09 +0100
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (Linux/3.0.0-1 (i686))

Andrew J. Schorr <address@hidden> wrote:
> On Tue, Apr 15, 2014 at 01:49:56PM +0100, Dave Sines wrote:

>> Ensuring that gawk never receives a filename beginning with "/inet/"
>> (including indirectly in shell scripts) is impractical on a system with
>> an existing /inet.

> Currently, io.c:inetfile() tests only whether the prefix is
> "/inet/" or "/inet4/" or "/inet6/" to decide whether it's a special
> socket file.  Should we do more parsing in that function and treat
> files as regular unless they match the full specification?  While there
> still could be problems, it seems fairly unlikely that a regular
> filename would collide with the full socket syntax.

The collision with just "/inet" is so unlikely that any system where it
occurs can be viewed as a statistical anomaly and the culprit invited to
a) rename the directory, b) disable the feature entirely or c) modify
gawk (and any scripts using the feature) to use a different pathname.

> The only downside I see is that if somebody enters a socket-style name
> incorrectly, it might be treated as a regular file instead of giving
> an error such as "special file name `%s' is incomplete".

I favour leaving the feature as-is -- it's been available for a while
so there are probably production scripts relying on it working (and
failing) exactly as it does now.




reply via email to

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