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.
This commit is contained in:
cinap_lenrek 2024-08-24 23:45:51 +00:00
parent 07aa9bfeef
commit a97ee572b9
2 changed files with 2 additions and 0 deletions

View file

@ -233,6 +233,7 @@ struct Srv {
Ref rref; /* requests in flight */ Ref rref; /* requests in flight */
int spid; /* pid of srv() caller */ int spid; /* pid of srv() caller */
int authok; /* auth was done on this channel (for none) */
void (*forker)(void (*)(void*), void*, int); void (*forker)(void (*)(void*), void*, int);
void (*free)(Srv*); void (*free)(Srv*);

View file

@ -30,6 +30,7 @@ listensrv(Srv *os, char *addr)
memset(&s->sref, 0, sizeof(s->sref)); memset(&s->sref, 0, sizeof(s->sref));
memset(&s->rref, 0, sizeof(s->rref)); memset(&s->rref, 0, sizeof(s->rref));
s->spid = 0; s->spid = 0;
s->authok = 0;
s->free = nil; s->free = nil;
if(s->forker == nil) if(s->forker == nil)