commit - 9b25329723e3284db7b060bbb301a139b8f2ace1
commit + 151b86a03703255445a2165f714e914032f6c4a8
blob - 5c5c80a094f0da9808bda55e52869e69ab45bde7
blob + ccd0f03427148e4187b520b9a977fc8cc0e2297d
--- man/man4/srv.4
+++ man/man4/srv.4
.SH SYNOPSIS
.B srv
[
-.B -a
+.B -an
]
[
.B -k
(by default, the empty string;
see
.IR attach (9p)).
+.PP
+The
+.B -n
+option causes
+.I srv
+to reject authentication attempts by clients,
+useful if the remote server is known not to require authentication.
+.PP
.I Srv
authenticates over the 9P connection to establish a valid auth fid.
.IR Keypattern ,
blob - f6704fc221623b69dc9533de0ad4fb03a6c4e526
blob + e89b85eb8464ed25c54a455901e90e82e42a04ed
--- src/cmd/srv.c
+++ src/cmd/srv.c
case 'a':
doauth = 1;
break;
+ case 'n':
+ doauth = -1;
+ break;
case 'k':
keypattern = EARGF(usage());
break;
if((fd = dial(addr, nil, nil, nil)) < 0)
sysfatal("dial %s: %r", addr);
- if(doauth)
+ if(doauth > 0)
xauth();
if(argc == 2)
dup(fd, 1);
for(i=3; i<20; i++)
close(i);
- if(doauth)
+ if(doauth > 0)
execlp("9pserve", "9pserve", "-u",
"-M",
smprint("%d", msize),
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: