git: 9front

Download patch

ref: 00c57fbf1e3f811067da39f2b8555930fcc91b4e
parent: 3e3fe026185a70ee69097a0754c0592e989b097b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Aug 24 19:45:51 EDT 2024

lib9p: add "authok" flag to Srv struct

We want to implement "none" attaches for hjfs,
but only if the 9p-"channel" ran a successfull
authentication before, to prevent anonymous
remote mounts as "none".

Add a flag to the Srv struct for this.

--- a/sys/include/9p.h
+++ b/sys/include/9p.h
@@ -233,6 +233,7 @@
 	Ref	rref;	/* requests in flight */
 
 	int	spid;	/* pid of srv() caller */
+	int	authok;	/* auth was done on this channel (for none) */
 
 	void	(*forker)(void (*)(void*), void*, int);
 	void	(*free)(Srv*);
--- a/sys/src/lib9p/listen.c
+++ b/sys/src/lib9p/listen.c
@@ -30,6 +30,7 @@
 	memset(&s->sref, 0, sizeof(s->sref));
 	memset(&s->rref, 0, sizeof(s->rref));
 	s->spid = 0;
+	s->authok = 0;
 	s->free = nil;
 
 	if(s->forker == nil)
--