usr.bin/tar/ ignores error codes from read() just silently pads nulls

Julian H. Stacey jhs at berklix.com
Mon Jan 31 23:00:24 UTC 2011


Hi hackers at freebsd.org & netbsd-users at 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. 


More information about the freebsd-hackers mailing list