diff options
author | Russ Cox <rsc@swtch.com> | 2007-10-12 12:56:57 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2007-10-12 12:56:57 -0400 |
commit | 151b86a03703255445a2165f714e914032f6c4a8 (patch) | |
tree | 51f268a91a3bca9f432ac632b8b0f0582019a5fd /src/cmd | |
parent | 9b25329723e3284db7b060bbb301a139b8f2ace1 (diff) | |
download | plan9port-151b86a03703255445a2165f714e914032f6c4a8.tar.gz plan9port-151b86a03703255445a2165f714e914032f6c4a8.tar.bz2 plan9port-151b86a03703255445a2165f714e914032f6c4a8.zip |
srv: add -n flag to reject auth by clients
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/srv.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/srv.c b/src/cmd/srv.c index f6704fc2..e89b85eb 100644 --- a/src/cmd/srv.c +++ b/src/cmd/srv.c @@ -41,6 +41,9 @@ threadmain(int argc, char **argv) case 'a': doauth = 1; break; + case 'n': + doauth = -1; + break; case 'k': keypattern = EARGF(usage()); break; @@ -55,7 +58,7 @@ threadmain(int argc, char **argv) if((fd = dial(addr, nil, nil, nil)) < 0) sysfatal("dial %s: %r", addr); - if(doauth) + if(doauth > 0) xauth(); if(argc == 2) @@ -216,7 +219,7 @@ post9pservice(int fd, char *name) dup(fd, 1); for(i=3; i<20; i++) close(i); - if(doauth) + if(doauth > 0) execlp("9pserve", "9pserve", "-u", "-M", smprint("%d", msize), @@ -224,8 +227,9 @@ post9pservice(int fd, char *name) aname, smprint("%d", afid), s, (char*)0); - else - execlp("9pserve", "9pserve", "-u", s, (char*)0); + else + execlp("9pserve", "9pserve", + doauth < 0 ? "-nu" : "-u", s, (char*)0); fprint(2, "exec 9pserve: %r\n"); _exits("exec"); default: |