ref: a97ee572b943965f35d0e95ab90949f32843bbc6
parent: 07aa9bfeef55ca987d411115adcfbbd4390ecf34
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)
--
⑨