9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Attach/Auth
@ 2002-08-27 11:25 Russ Cox
  2002-08-27 11:54 ` Lucio De Re
  0 siblings, 1 reply; 14+ messages in thread
From: Russ Cox @ 2002-08-27 11:25 UTC (permalink / raw)
  To: 9fans

That's my fault.

    case Tauth:
	if((r->fid = allocfid(srv->fpool, r->ifcall.fid)) == nil){
		respond(r, Edupfid);
		break;
	}
	r->afid = nil;
	if(r->ifcall.afid != NOFID && (r->afid = allocfid(srv->fpool, r->ifcall.fid)) == nil){
		respond(r, Eunknownfid);
		break;
	}

The line in question should actually be

	if(r->ifcall.afid != NOFID && (r->afid = allocfid(srv->fpool, r->ifcall.afid)) == nil){

Note the s/fid/afid/ near the end of the line.
Goes to show that we've never actually used authentication, I suppose.

Russ


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] Attach/Auth
@ 2002-08-30  3:10 Russ Cox
  2002-08-30  3:38 ` Roman V. Shaposhnick
  2002-08-30  3:41 ` Alexander Viro
  0 siblings, 2 replies; 14+ messages in thread
From: Russ Cox @ 2002-08-30  3:10 UTC (permalink / raw)
  To: 9fans

Oh, you mean the section 5 man pages rather than
the lib9p man pages.  Ephase is a property of the
implementation, which can do whatever it pleases.
There can be file servers that will never give
you Ephase (like u9fs running on a typical Unix
file system).

Russ


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] Attach/Auth
@ 2002-08-28 10:45 Russ Cox
  2002-08-30  2:58 ` Roman V. Shaposhnick
  0 siblings, 1 reply; 14+ messages in thread
From: Russ Cox @ 2002-08-28 10:45 UTC (permalink / raw)
  To: 9fans

>   Russ, can you also add something to the effect of "fids can be dangling"
>   to the 9P manpages ? May be I'm being too picky, but I have a good reason --
>   I've learned that in a pretty hard way.

what forsyth said.  also, fids can dangle in the sense that if you
don't take care of closing all of them, there will just be
garbage in memory but the fid table bookkeeping stays correct.
i hope that's not what you mean, though.

can you rephrase that?



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] Attach/Auth
@ 2002-08-28  9:24 Charles Forsyth
  0 siblings, 0 replies; 14+ messages in thread
From: Charles Forsyth @ 2002-08-28  9:24 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

but fids can't be `dangling'.  they're allocated by one request or another (eg, Tattach, Tauth, Twalk),
and deallocated by Tclunk or Tremove.  they can't `dangle'.
if the client has allocated a fid, it is valid until it explicitly deallocates it.
if the client hasn't allocated a fid but uses it in a request,
it's a protocol error by the client (eg, `fid in use', or `unknown fid').

[-- Attachment #2: Type: message/rfc822, Size: 2020 bytes --]

From: "Roman V. Shaposhnick" <vugluskr@unicorn.math.spbu.ru>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Attach/Auth
Date: Wed, 28 Aug 2002 10:15:31 +0400
Message-ID: <20020828101531.A3072@unicorn.math.spbu.ru>

On Tue, Aug 27, 2002 at 08:25:49AM -0400, Russ Cox wrote:
>
> Anyhow, I just fixed the various bugs you pointed out in the manual pages.
> Let me know about any incompletenesses.

  Russ, can you also add something to the effect of "fids can be dangling"
  to the 9P manpages ? May be I'm being too picky, but I have a good reason --
  I've learned that in a pretty hard way.

Thanks,
Roman.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] Attach/Auth
@ 2002-08-27 12:25 Russ Cox
  2002-08-28  6:15 ` Roman V. Shaposhnick
  0 siblings, 1 reply; 14+ messages in thread
From: Russ Cox @ 2002-08-27 12:25 UTC (permalink / raw)
  To: 9fans

> Hm.  I replaced the allocfid() with lookupfid(), plus the change you
> mentioned, because afid is already allocated in Tauth (did I really
> put Tauth up there?  I meant Tattach!).

Oh, right.  Fixed.

> > Goes to show that we've never actually used authentication, I suppose.

> That's perfectly reasonable, as long as somebody eventually irons out
> the creases :-)

The reason that we've never actually used authentication is that most
user-level file servers don't need to authenticate.  They post files
that are mode 0600 in srv (or don't post at all) and mount into the
namespace directly.  Thus, by default the kernel will make sure that
only you can get at the file server.  You don't need to protect it
further.  Kfs only needs to deal with authentication because it can
listen to the network, speaking 9P with arbitrary clients rather than
just with the kernel.  For what you're doing, it doesn't sound like you
need authentication.

It also sounds like you should just use upas/fs.  Given a message you
can just do:

	{
		echo 'From xxx' `{date}
		sed '/^$/,$ s/^From / From /'
		echo
	} >$TMP
	upas/fs -f $TMP

Anyhow, I just fixed the various bugs you pointed out in the manual pages.
Let me know about any incompletenesses.

Of course, it's impossible to write documentation without noticing
unnecessary complications in the implementation, so the library itself
has been slightly stirred around as well, to be easier to explain.
No programs should need to change unless they're relying on very subtle
implementation details (and even I don't have such programs).

/sys/src/lib9p/ramfs.c is now in the distribution.  Sorry about forgetting
it earlier.

Russ


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] Attach/Auth
@ 2002-08-26 23:24 Russ Cox
  2002-08-27  5:06 ` Lucio De Re
  0 siblings, 1 reply; 14+ messages in thread
From: Russ Cox @ 2002-08-26 23:24 UTC (permalink / raw)
  To: 9fans

The afd used in the attach message is the
one returned by a Tauth/Rauth exchange.
If Tauth returns an error then afd = -1 gets used.
The attach spec should be irrelevant, unless
the server in question (what is it?) behaves
differently on Tauth to nil and Tauth to /mail/box/lucio/mbox.

Russ


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [9fans] Attach/Auth
@ 2002-08-26 14:02 Lucio De Re
  0 siblings, 0 replies; 14+ messages in thread
From: Lucio De Re @ 2002-08-26 14:02 UTC (permalink / raw)
  To: 9fans mailing list

Given a test server, I get the expected authentication request:

	% mount /srv/sample /n/temp

which fails because I have no idea (yet) quite what to do next.
But my lack of understanding is not mysterious :-)

On the other hand:

	% mount /srv/sample /n/temp /mail/box/lucio/mbox

does not request authentication, it uses an afd of -1 in an attach
message.

I can't see a good reason for this, but I'm sure there is one I'm
missing, could someone please shed some light?

++L

PS: the whole exercise is quite exciting, just very slow progress.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-08-30  3:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 11:25 [9fans] Attach/Auth Russ Cox
2002-08-27 11:54 ` Lucio De Re
  -- strict thread matches above, loose matches on Subject: below --
2002-08-30  3:10 Russ Cox
2002-08-30  3:38 ` Roman V. Shaposhnick
2002-08-30  3:41 ` Alexander Viro
2002-08-28 10:45 Russ Cox
2002-08-30  2:58 ` Roman V. Shaposhnick
2002-08-28  9:24 Charles Forsyth
2002-08-27 12:25 Russ Cox
2002-08-28  6:15 ` Roman V. Shaposhnick
2002-08-26 23:24 Russ Cox
2002-08-27  5:06 ` Lucio De Re
2002-08-27  6:35   ` Lucio De Re
2002-08-26 14:02 Lucio De Re

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).