diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-05 22:39:43 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-05 22:39:43 +0100 |
commit | 5c000bbe6378de33b55080bcc8be1cfb907c2d22 (patch) | |
tree | 3b6ab6e0730d7da4822118e267c8409d53d5de44 /sys/src | |
parent | 919863dab3490b624fdb6197566cf9e3b5980c2a (diff) |
cpu: add -n flag for the remote site to allow "none" authentification method (inspired from sources cpu-noauth patch)
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/cpu.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/cpu.c b/sys/src/cmd/cpu.c index a3bf5c371..a7e10fcbc 100644 --- a/sys/src/cmd/cpu.c +++ b/sys/src/cmd/cpu.c @@ -30,6 +30,7 @@ int notechan; int exportpid; char *system; int cflag; +int nflag; int dbg; char *user; char *patternfile; @@ -59,7 +60,7 @@ struct AuthMethod { { { "p9", p9auth, srvp9auth,}, { "netkey", netkeyauth, netkeysrvauth,}, -// { "none", noauth, srvnoauth,}, + { "none", noauth, srvnoauth,}, { nil, nil} }; AuthMethod *am = authmethod; /* default is p9 */ @@ -176,6 +177,10 @@ main(int argc, char **argv) case 'f': /* ignored but accepted for compatibility */ break; + case 'n': + /* must be specified before -R/-O */ + nflag++; + break; case 'A': anstring = EARGF(usage()); break; @@ -349,7 +354,7 @@ remoteside(int old) if(n < 0) fatal("authenticating: %r"); } - if(setamalg(cmd) < 0){ + if(setamalg(cmd) < 0 || (nflag == 0 && am->sf == srvnoauth)) { writestr(fd, "unsupported auth method", nil, 0); fatal("bad auth method %s", cmd); } else |