* [9fans] corrections for tarfs(4) and tpfs(4)
@ 2003-12-12 20:13 Richard Miller
0 siblings, 0 replies; only message in thread
From: Richard Miller @ 2003-12-12 20:13 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-12-12 20:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12 20:13 [9fans] corrections for tarfs(4) and tpfs(4) Richard Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).