From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <49d245c073df3ab667bc09d0ba2e93b3@hamnavoe.com> To: 9fans@cse.psu.edu From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] corrections for tarfs(4) and tpfs(4) Date: Fri, 12 Dec 2003 20:13:12 +0000 Topicbox-Message-UUID: a0d11274-eacc-11e9-9e20-41e7f4b1d025 This went to 9trouble last month, but submissions to 9fans seem to get a quicker response ... I stumbled over this one by doing a 'cp -x' from a tar file which had some unexpected mode bits set (by cygwin tar). *** /n/sources/plan9//sys/src/cmd/tapefs/tarfs.c Sun Jul 14 19:49:24 2002 --- /sys/src/cmd/tapefs/tarfs.c Tue Nov 18 15:20:15 2003 *************** *** 58,63 **** --- 58,64 ---- /* the mode test is ugly but sometimes necessary */ if (dblock.dbuf.linkflag == '5' || (f.mode&0170000) == 040000) f.mode |= DMDIR; + f.mode &= DMDIR|0777; linkflg = dblock.dbuf.linkflag=='s' || dblock.dbuf.linkflag=='1'; isabs = dblock.dbuf.name[0]=='/'; if (chksum != checksum()){ And, for the tape historians, a tiny improvement to the reconstruction of TP archives. Note the 1-byte uid and gid ("why would a Unix system ever need more than 256 userids?"). *** /n/sources/plan9//sys/src/cmd/tapefs/tpfs.c Thu Mar 16 21:43:28 2000 --- /sys/src/cmd/tapefs/tpfs.c Mon Jun 4 11:35:35 2001 *************** *** 57,62 **** --- 57,64 ---- f.mdate = (tpp->tmod[2]<<0) + (tpp->tmod[3]<<8) +(tpp->tmod[0]<<16) + (tpp->tmod[1]<<24); f.mode = tpp->mode[0]&0777; + f.uid = tpp->uid[0]; + f.gid = tpp->gid[0]; isabs = tpp->name[0]=='/'; f.name = (char *)tpp->name+isabs; poppath(f, 1); -- Richard Miller