attach message serves as a fresh introduction from a user on
the client machine to the server.
The message identifies the user
(uname) and may select
the file tree to access
afid argument specifies a fid previously established by an
auth message, as described below.
As a result of the
attach transaction, the client will have a connection to the root
directory of the desired file tree,
fid. An error is returned if
fid is already in use.
The servers idea of the root of the file tree is represented by the returned
If the client does not wish to authenticate the connection, or knows that
authentication is not required, the
afid field in the
attach message should be set to
NOFID, defined as
<fcall.h>. If the client does wish to authenticate, it must acquire and validate an
afid using an
auth message before doing the
auth message contains
afid, a new fid to be established for authentication, and the
aname that will be those of the following
If the server does not require authentication, it returns
Rerror to the
If the server does require authentication, it returns
aqid defining a file of type
that may be read and written (using
write messages in the usual way) to execute an authentication protocol.
That protocols definition is not part of 9P itself.
Once the protocol is complete, the same
afid is presented in the
attach message for the user, granting entry.
The same validated
afid may be used for multiple
attach messages with the same