From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 5 Jun 2009 06:20:17 +0100 From: Ethan Grammatikidis To: 9fans@9fans.net Message-Id: <20090605062017.4286b473.eekee57@fastmail.fm> In-Reply-To: References: <20090605005830.be53830c.eekee57@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Drawterm /mnt/term permissions issue Topicbox-Message-UUID: 04b130f0-ead5-11e9-9d60-3106f5b1d025 On Thu, 4 Jun 2009 17:23:08 -0700 Russ Cox wrote: > On Thu, Jun 4, 2009 at 4:58 PM, Ethan Grammatikidis wrote: > > I run a plan 9 cpu server in Qemu and use drawterm to connect from the Linux host. > > I thought the /mnt/term mechanism would be very convenient for exchanging files > > between host & guest, but the guest sees all user/group names as > > unknown/unknown, preventing writing. > > That's surprising. Drawterm isn't going around enforcing > permission bits: if it can write, it writes. What it shows > you in ls is what it gets from stat, but it doesn't rely on > that to make decisions about what you can open. It just > tries to open it. > > http://cvs.pdos.csail.mit.edu/cvs/drawterm/kern/devfs-posix.c?rev=1.5;content-type=text%2Fplain Looks like a prime candidate for modification. ;) The code unconditionally sets d.uid = "unknown" immediately after stat(path, &stbuf) calls. stbuf.st_uid could be compared with the un*x UID drawterm is running as, & if matching d.uid is filled with the logged-in plan 9 username instead of "unknown". Similar for stbuf.st_gid and g.gid. I could write a patch when I'm more awake. Rather a lot to look up when I'm falling asleep. :) -- Ethan Grammatikidis The lyf so short, the craft so long to lerne. -- Chaucer