From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucio De Re To: 9fans@cse.psu.edu Subject: Re: [9fans] Attach/Auth Message-ID: <20020827083520.W29921@cackle.proxima.alt.za> References: <20020827070622.V29921@cackle.proxima.alt.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20020827070622.V29921@cackle.proxima.alt.za>; from Lucio De Re on Tue, Aug 27, 2002 at 07:06:23AM +0200 Date: Tue, 27 Aug 2002 08:35:21 +0200 Topicbox-Message-UUID: e18e9b1c-eaca-11e9-9e20-41e7f4b1d025 On Tue, Aug 27, 2002 at 07:06:23AM +0200, Lucio De Re wrote: > > which is followed by a puzzling Tattach exchange: > > <-4- Tattach tag 13 fid 349 afid 333 uname lucio aname > -4-> Rerror tag 13 ename unknown fid > > I assume the "unknown fid" comes from srv() which I don't quite > understand. > The following code in /sys/src/lib9p/srv.c is suspicious: 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 second allocfid() seems to work a lot better if replaced by: lookupfid(srv->fpool, r->ifcall.afid) The Tattach exchange now looks like: <-4- Tattach tag 11 fid 324 afid 339 uname lucio aname -4-> Rattach tag 11 qid (0000000000000000 0 d) which seems a little healthier except for the Qid value, which repeats the value that was assigned to the auth file. ++L