ATTACH(9P)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

✨ NAME ✨

okay bestie, this is the ATTACH(9P) page β€” the 9P manual for attach and auth, aka messages to establish a connection. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

size[4] Tauth tag[2] afid[4] uname[s] aname[s]
size[4] Rauth tag[2] aqid[13]

size[4] Tattach tag[2] fid[4] afid[4] uname[s] aname[s]
size[4] Rattach tag[2] qid[13]

🌸 DESCRIPTION 🌸

The attach message is basically a fresh introduction from a user on the client machine to the server. πŸ’Œ It identifies the user (uname) and may select the file tree to access (aname). The 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, represented by fid. An error is returned if fid is already in use. The server's idea of the root of the file tree is represented by the returned qid.

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 (u32int)~0 in <fcall.h>. If the client does wish to authenticate, it must acquire and validate an afid using an auth message before doing the attach.

The auth message contains afid, a new fid to be established for authentication, and the uname and aname that will be those of the following attach message. If the server does not require authentication, it returns Rerror to the Tauth message.

If the server does require authentication, it returns aqid defining a file of type QTAUTH (see intro(9P)) that may be read and written (using read and write messages in the usual way) to execute an authentication protocol. That protocol's 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 uname and aname. πŸ”₯

πŸŽ€ ENTRY POINTS πŸŽ€

Fsmount and fsauth (see 9pclient(3)) generate attach and auth transactions.

🌈 SEE ALSO 🌈


btw the footer is just the same ATTACH(9P) stamp β€” no extra source, version, or date info hiding down there. πŸ’…πŸŽ€