aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pserve.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2007-10-12 12:55:19 -0400
committerRuss Cox <rsc@swtch.com>2007-10-12 12:55:19 -0400
commit9b25329723e3284db7b060bbb301a139b8f2ace1 (patch)
tree1882a59f3df0a01bf3d60bb18e2142b7d7368b34 /src/cmd/9pserve.c
parent4ff69507837bb2501cba25dfa219c252333cc185 (diff)
downloadplan9port-9b25329723e3284db7b060bbb301a139b8f2ace1.tar.gz
plan9port-9b25329723e3284db7b060bbb301a139b8f2ace1.tar.bz2
plan9port-9b25329723e3284db7b060bbb301a139b8f2ace1.zip
9pserve: add -n flag to reject auth by clients
Diffstat (limited to 'src/cmd/9pserve.c')
-rw-r--r--src/cmd/9pserve.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c
index 1868808e..88e0f6fb 100644
--- a/src/cmd/9pserve.c
+++ b/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");
}
@@ -165,6 +166,9 @@ threadmain(int argc, char **argv)
versioned = 1;
msize = atoi(EARGF(usage()));
break;
+ case 'n':
+ noauth = 1;
+ break;
case 'v':
verbose++;
break;
@@ -450,6 +454,10 @@ connthread(void *arg)
err(m, "authentication not required");
continue;
}
+ if(noauth){
+ err(m, "authentication rejected");
+ continue;
+ }
m->afid = fidnew(m->tx.afid);
if(puthash(c->fid, m->tx.afid, m->afid) < 0){
err(m, "duplicate fid");