9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <miller@hamnavoe.demon.co.uk>
To: 9fans@cse.psu.edu
Subject: [9fans] corrections for tarfs(4) and tpfs(4)
Date: Fri, 12 Dec 2003 20:13:12 +0000	[thread overview]
Message-ID: <49d245c073df3ab667bc09d0ba2e93b3@hamnavoe.com> (raw)

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



                 reply	other threads:[~2003-12-12 20:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49d245c073df3ab667bc09d0ba2e93b3@hamnavoe.com \
    --to=miller@hamnavoe.demon.co.uk \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).