Date: Wed, 3 May 2017 13:18:23 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: Bruce Evans <brde@optusnet.com.au>, Jilles Tjoelker <jilles@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317709 - head/usr.bin/csplit Message-ID: <a32fabbd-c100-795d-e63c-3d87ef1221e2@FreeBSD.org> In-Reply-To: <2c7bd200-957d-2c36-076e-41d4d04a2956@FreeBSD.org> References: <201705022156.v42LuKbp088899@repo.freebsd.org> <20170503162918.U1062@besplex.bde.org> <2c7bd200-957d-2c36-076e-41d4d04a2956@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05/03/17 09:56, Pedro Giffuni wrote:
>
> ...
>
>> Grepping for fputs in /usr/src shows too many instances to check (mostly
>> without any error handling). The simplest filter 'if (fputs' found the
>> dependency on the old FreeBSD behaviour in csplit and 2 other places:
>>
>> contrib/mdocml/main.c: if (fputs(cp, stdout)) {
>> contrib/mdocml/main.c- fclose(stream);
I can't find the above on the version in FreeBSD-current (or 11-stable).
>> contrib/libreadline/examples/rlcat.c: if (fputs (x, stdout) != 0)
>> contrib/libreadline/examples/rlcat.c- return 1;
>>
This is an example so it's luckily not under use. Hopefully libreadline is
going away from base but it's still important to report this upstream
(will do).
>> More complicated filters like 'if ([^(]]*[^a-z_]fputs' failed to find
>> any problems since I messed up the regexp.
>>
>
> I admittedly ignored contrib, plus I only skimmed for comparisons to
> zero.
>
> Now I am worried: the classic BSD implementation is ubiquitous and
> this bug
> is not easy to find, particularly in ports.
>
I went though the OpenOffice code, and it's dependencies, and I couldn't
find any
place where a similar issue happens. I did find several places where
there was a
correct comparison to EOF or >=0, but the vast majority of code just
call fputs()
without checking the return value.
> Do you guys think it we should revert to the previous behavior, at
> least for 11.1?
> The bugs should be reported upstream but it is not really our battle
> to fix the world
> for Apple is it?
>
It seems like most code may have already adapted to the Apple variant.
Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a32fabbd-c100-795d-e63c-3d87ef1221e2>
