This patch adds support for a -n flag to cpu(1), which may be used with the -R or -O flags to disable authentication for incoming requests. This option must be enabled explicitly as it can lead to some rather undesirable behavior in an untrusted environment. Notes: Sun Feb 23 01:27:40 EST 2014 geoff this seems really dubious and probably not worth distributing. Reference: /n/sources/patch/maybe/cpu-noauth Date: Sun Sep 22 09:12:58 CES 2013 Signed-off-by: sstallion@gmail.com Reviewed-by: geoff --- /sys/src/cmd/cpu.c Sun Sep 22 09:12:44 2013 +++ /sys/src/cmd/cpu.c Sun Sep 22 09:12:41 2013 @@ -31,6 +31,7 @@ int exportpid; char *system; int cflag; +int nflag; int dbg; char *user; char *patternfile; @@ -60,7 +61,7 @@ { { "p9", p9auth, srvp9auth,}, { "netkey", netkeyauth, netkeysrvauth,}, -// { "none", noauth, srvnoauth,}, + { "none", noauth, srvnoauth,}, { nil, nil} }; AuthMethod *am = authmethod; /* default is p9 */ @@ -171,6 +172,10 @@ case 'f': /* ignored but accepted for compatibility */ break; + case 'n': + /* must be specified before -R/-O */ + nflag++; + break; case 'O': p9authproto = "p9sk2"; remoteside(1); /* From listen */ @@ -695,6 +700,8 @@ int setam(char *name) { + if(nflag == 0 && strcmp("none", name) == 0) + return -1; for(am = authmethod; am->name != nil; am++) if(strcmp(am->name, name) == 0) return 0; --- /sys/man/1/cpu Sun Sep 22 09:12:47 2013 +++ /sys/man/1/cpu Sun Sep 22 09:12:45 2013 @@ -28,6 +28,8 @@ .PP .B cpu [ +.B -n +] [ .B -R | .B -O @@ -176,6 +178,14 @@ of the .I cpu protocol. +The +.B -n +option disables authentication for incoming connections and must be +specified before the +.B -R +and +.B -O +flags. .SH FILES The name space of the terminal side of the .I cpu