From owner-svn-src-all@freebsd.org Wed May 3 18:18:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84ED8D5C3D7 for ; Wed, 3 May 2017 18:18:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm1-vm4.bullet.mail.ne1.yahoo.com (nm1-vm4.bullet.mail.ne1.yahoo.com [98.138.91.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9E1AA5 for ; Wed, 3 May 2017 18:18:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1493835505; bh=W47OE0Mfr0woV7idRw+6QcaWxMKEKwb8TzRsn823zwc=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From:Subject; b=Tj4c8lZHIq9qQ2pgNDiPdmrSdHm4CQ52QMeocsS9c//V/n1CAyjWdJFWPkdFjeytyOv156swsQO/dhGnjDjRaVw0yZBb+YGC7tPGalxUtCJ7+WcPGVEs8EvNqXekURyE6XgLh3EEE9S4JcyuchX36elryOEll5n5IHa3XRED/fSvAED5OZskTIpP/17sfQwGhDwK+2w5OBPrjdi0I4Q8OEvtkn4QAo77QjzN21yxJ/OwJRt8XTX7Gm3wMoPjuttqX9JkpBMUkh0BjjgOHiqE1bSWTT7jF7kij6yup7So2R45QWiRNHwTONW5fNbNEcOLbksJk0/EQTBpAjtuQkykVg== Received: from [98.138.101.128] by nm1.bullet.mail.ne1.yahoo.com with NNFMP; 03 May 2017 18:18:25 -0000 Received: from [98.138.84.47] by tm16.bullet.mail.ne1.yahoo.com with NNFMP; 03 May 2017 18:18:25 -0000 Received: from [127.0.0.1] by smtp115.mail.ne1.yahoo.com with NNFMP; 03 May 2017 18:18:25 -0000 X-Yahoo-Newman-Id: 896281.30057.bm@smtp115.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: NgMhlbsVM1nwIaHlCoXq004atu_OVF4vickvMOBM59LDuwA 8nOFdF_77JYWFyaV8h0vEPz97FCBRUmgR1g1DbwnPY5KxHiYf66jxzVBgEBV c0Djj4HMPONhJlyok8gF0wiol69FssSh8L6NXn9p4qj_c8_IYXroI9eH_RGV 9mDfSNfx5slWskBND2ctRfo4T2I3zNHnct4cMbj8hlTkLlXrBKK4PDIernwP PqxIR0P0rwYCB2o5ag33x7XYuBEjWPe1uzB5FGBJ9gYuniRlLG1quyuX5SY_ QsXt3vZ4ohZ_jN1h2phRw1I4hhBF0imllUoTrHKzoBViMMTfqa3BTHMtyr2n iutXBSgs0ZCml9Wa8jinNi4cBkTnFCFjGXOyBAvZUMaev.5GRYHqPDpATwNl SiWa4shdl0eloCHxMPMAtxiGI1MDbIGgSimbS3mRO7UhmRvoI.CRFqVD8uEs 5q_wS5BWnIYEzFyJlIWbkN.OLXZc08w8FHjZ1ANNM5tMsTaVhHdiW8fkz.r2 ECzBOx6f7i6wz5Q5gtiJktPdMnVS0spuzsE3OShhmoIMm X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r317709 - head/usr.bin/csplit From: Pedro Giffuni To: Bruce Evans , Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705022156.v42LuKbp088899@repo.freebsd.org> <20170503162918.U1062@besplex.bde.org> <2c7bd200-957d-2c36-076e-41d4d04a2956@FreeBSD.org> Organization: FreeBSD Message-ID: Date: Wed, 3 May 2017 13:18:23 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <2c7bd200-957d-2c36-076e-41d4d04a2956@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2017 18:18:33 -0000 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.