commit 9b25329723e3284db7b060bbb301a139b8f2ace1 from: Russ Cox date: Fri Oct 12 16:55:19 2007 UTC 9pserve: add -n flag to reject auth by clients commit - 4ff69507837bb2501cba25dfa219c252333cc185 commit + 9b25329723e3284db7b060bbb301a139b8f2ace1 blob - 9e319e60bd334c189a081f7d113eac50844fba28 blob + 388f24b6611ab2b7bb20dfbf4043f99bfda9778f --- man/man4/9pserve.4 +++ man/man4/9pserve.4 @@ -4,7 +4,7 @@ .SH SYNOPSIS .B 9pserve [ -.B -lv +.B -lnv ] [ .B -A @@ -55,6 +55,11 @@ The options are: logging; write a debugging log to .IB addr .log \fR. .TP +.B -n +no authentication; respond to Tauth +messages with an error (see +.IR attach (9P)). +.TP .B -v verbose; more verbose when repeated .TP blob - 1868808e5c313c5aee4a5fd2b25559d5d4deb22e blob + 88e0f6fbfbbe4baa5aa4785e869b1657293b3dd0 --- src/cmd/9pserve.c +++ src/cmd/9pserve.c @@ -92,6 +92,7 @@ u32int xafid = NOFID; int attached; int versioned; int dotu; +int noauth; void *gethash(Hash**, uint); int puthash(Hash**, uint, void*); @@ -135,7 +136,7 @@ int cvtustat(Fcall*, uchar**, int); void usage(void) { - fprint(2, "usage: 9pserve [-lv] [-A aname afid] [-M msize] address\n"); + fprint(2, "usage: 9pserve [-lnv] [-A aname afid] [-M msize] address\n"); fprint(2, "\treads/writes 9P messages on stdin/stdout\n"); threadexitsall("usage"); } @@ -164,6 +165,9 @@ threadmain(int argc, char **argv) case 'M': versioned = 1; msize = atoi(EARGF(usage())); + break; + case 'n': + noauth = 1; break; case 'v': verbose++; @@ -448,6 +452,10 @@ connthread(void *arg) case Tauth: if(attached){ err(m, "authentication not required"); + continue; + } + if(noauth){ + err(m, "authentication rejected"); continue; } m->afid = fidnew(m->tx.afid);