9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ethan Grammatikidis <eekee57@fastmail.fm>
To: 9fans@9fans.net
Subject: Re: [9fans] Drawterm /mnt/term permissions issue
Date: Fri,  5 Jun 2009 06:20:17 +0100	[thread overview]
Message-ID: <20090605062017.4286b473.eekee57@fastmail.fm> (raw)
In-Reply-To: <dd6fe68a0906041723x7133551pc2c729cc8470c8bf@mail.gmail.com>

On Thu, 4 Jun 2009 17:23:08 -0700
Russ Cox <rsc@swtch.com> wrote:

> On Thu, Jun 4, 2009 at 4:58 PM, Ethan Grammatikidis <eekee57@fastmail.fm> 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



  reply	other threads:[~2009-06-05  5:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 23:58 Ethan Grammatikidis
2009-06-05  0:23 ` Russ Cox
2009-06-05  5:20   ` Ethan Grammatikidis [this message]
2009-06-06 18:39     ` Skip Tavakkolian
2009-06-05  5:23   ` Ethan Grammatikidis
2009-06-05  5:40     ` erik quanstrom
2009-06-05  8:14 ` sqweek
2009-06-05 13:09   ` [9fans] I fail at bind WAS: " Ethan Grammatikidis

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=20090605062017.4286b473.eekee57@fastmail.fm \
    --to=eekee57@fastmail.fm \
    --cc=9fans@9fans.net \
    /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).