From 9fans@cse.psu.edu Wed Nov 29 21:44:59 EST 1995
Article: 919 of comp.os.plan9
Xref: cannon.ecf comp.os.plan9:919
Newsgroups: comp.os.plan9
Path: cannon.ecf!utnut!cs.utexas.edu!uwm.edu!lll-winken.llnl.gov!simtel!news.kei.com!newsfeed.internetmci.com!usenet.eel.ufl.edu!warwick!niss!bath.ac.uk!ccsis
From: forsyth@plan9.CS.york.ac.UK
Subject: Re: VGA Hell * 2 (Stealth 64 & Phantom 64)
Message-ID: <95Nov24.034941est.78385@colossus.cse.psu.edu>
Sender: ccsis@bath.ac.uk (Icarus Sparry)
Reply-To: 9fans@cse.psu.edu
Organization: Plan 9 mailing list
Date: Thu, 23 Nov 1995 22:48:04 GMT
Approved: plan9mod@bath.ac.uk
Lines: 11
Status: RO

>>tar file ok, however fs/tarfs gives a checksum error on the first
>>file.

try this:

vortex% diff /n/cd/sys/src/cmd/tapefs/tarfs.c .
132c132
< 		i += *cp;
---
> 		i += *cp & 0xFF;



From cse.psu.edu!9fans-outgoing-owner Sun Apr  7 01:00:23 1996
Received: from colossus.cse.psu.edu ([130.203.1.2]) by cannon.ecf.toronto.edu with SMTP id <347>; Sun, 7 Apr 1996 01:00:15 -0500
Received: by colossus.cse.psu.edu id <79531>; Sun, 7 Apr 1996 00:51:38 -0500
Received: from angora.cse.psu.edu ([128.118.73.23]) by colossus.cse.psu.edu with SMTP id <79529>; Sun, 7 Apr 1996 00:51:21 -0500
From:	scott@angora.cse.psu.edu
To:	9fans@cse.psu.edu
Date:	Sun, 7 Apr 1996 00:49:30 -0500
Message-Id: <96Apr7.005121est.79529@colossus.cse.psu.edu>
Sender: owner-9fans@cse.psu.edu
Precedence: bulk
Reply-To: 9fans@cse.psu.edu
Status: RO

tarfs reports checksum errors on some tarfiles (generated by gnutar, I think),
because it computes the checksum over all TBLOCK chars, but only reads the
header before doing so.  The following patch seems to fix the problem.

term% diff /n/cd/sys/src/cmd/tapefs/tarfs.c .
38c38
< 	long blkno, isabs, chksum, linkflg;
---
> 	long blkno, isabs, chksum, linkflg, t;
47c47
< 		if (read(tapefile, (char *)&dblock.dbuf, sizeof(dblock.dbuf))<sizeof(dblock.dbuf))
---
> 		if (read(tapefile, (char *)&dblock, sizeof(dblock))<sizeof(dblock))
60,61c60,61
< 		if (chksum != checksum()){
< 			fprint(1, "bad checksum on %.28s\n", dblock.dbuf.name);
---
> 		if (chksum != (t=checksum())){
> 			fprint(1, "bad checksum %o != %o on %.28s\n", chksum, t, dblock.dbuf.name);
132c132
< 		i += *cp;
---
> 		i += *cp & 0xff;


