shithub: riscv

Download patch

ref: 370ef39bf963fc715c06982cb863eb0d50eb3ad9
parent: 8ab397c23c2fdbbe64d10f756bb4eb15aab54075
author: Jacob Moody <moody@posixcafe.org>
date: Sat Jun 12 19:12:41 EDT 2021

lib9p: add auth* functions to man page

--- a/sys/man/2/9p
+++ b/sys/man/2/9p
@@ -14,7 +14,7 @@
 readstr,
 respond,
 responderror,
-srv
+srv,
 srvacquire,
 srvforker,
 srvrelease,
@@ -23,7 +23,11 @@
 threadpostsharesrv,
 threadpostsrv,
 threadsrv,
-threadsrvforker - 9P file service
+threadsrvforker,
+auth9p,
+authattach,
+authread,
+authwrite \- 9P file service
 .SH SYNOPSIS
 .ft L
 .nf
@@ -114,6 +118,15 @@
 .ft L
 extern int chatty9p;
 .fi
+.PP
+.nf
+.ft L
+.ta \w'\fLvoid* 'u
+void	auth9p(Req *r);
+int		authattach(Req *r);
+void	authread(Req *r);
+void	authwrite(Req *r);
+.fi
 .SH DESCRIPTION
 The function
 .I srv
@@ -813,6 +826,40 @@
 (see
 .IR exits (2)).
 .PD
+.PP
+.I Auth9p,
+.I authattach,
+.I authwrite,
+and
+.I authread
+are functions to assist in the creation of authenticated
+file servers.
+.I Auth9p
+sets
+.I afid
+to point to
+.B /mnt/factotum/rpc
+then calls
+.I respond.
+It can be used as the
+.I auth
+service function address.
+.I Authattach
+will return 0 if the session has properly
+authenticated or will return -1 and
+call
+.I respond
+with an apropiate error.
+.I Authread
+and
+.I authwrite
+can be called from the
+.I read
+and
+.I write
+service functions respectfully to handle
+calls on the
+.I afid.
 .PP
 If the 
 .B chatty9p