From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 31 23:00:24 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 485511065675 for ; Mon, 31 Jan 2011 23:00:24 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id C617B8FC13 for ; Mon, 31 Jan 2011 23:00:23 +0000 (UTC) Received: from park.js.berklix.net (p5B22F01B.dip.t-dialin.net [91.34.240.27]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id p0VMJOh6084623; Mon, 31 Jan 2011 22:19:25 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id p0VMJ4I2046326; Mon, 31 Jan 2011 23:19:04 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id p0VMIs90003417; Mon, 31 Jan 2011 23:18:59 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201101312218.p0VMIs90003417@fire.js.berklix.net> To: hackers@freebsd.org, netbsd-users@NetBSD.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Linux Unix Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Mon, 31 Jan 2011 23:18:54 +0100 Sender: jhs@berklix.com Cc: Subject: usr.bin/tar/ ignores error codes from read() just silently pads nulls X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 23:00:24 -0000 Hi hackers@freebsd.org & netbsd-users@NetBSD.org usr.bin/tar ignores device error codes from read() & silently pads nulls. See FreeBSD 6.2 6.4 7.3, 8.0, 8.1, & current src/usr.bin/tar/write.c NetBSD 5.1 & current src/external/bsd/libarchive/dist/tar/write.c ^write_file_data( last 3 lines ... bytes_read = read I filed a send-pr yesterday Mon, 31 Jan 2011 04:52:29 +0100 (CET) http://www.freebsd.org/cgi/query-pr.cgi?pr=154407 diffs slightly cleaned up here: http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/usr.bin/tar/ Tar author will probably issue cleaner code as soon as he has time. Meantime, if you may have copied in data without realising media was flakey, bsdtar will not have warned (though /var/log/messages does), so you may want to scan with find & a detector eg http://berklix.com/~jhs/src/bsd/jhs/bin/public/8f/ Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text; Not quoted-printable, Not HTML, Not base 64. Reply below text sections not at top, to avoid breaking cumulative context.