diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-21 23:22:59 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-21 23:22:59 +0200 |
commit | 61e9d23eb24ce2e1fda045f74752a825f0545aa1 (patch) | |
tree | f7f48a6eca5cb96aa857834ad3fa157cfa67b988 | |
parent | 12d6eb0ce3d6701a7a5e44083e18a3cb32a64539 (diff) |
cpu, import: remove old9p support
-rw-r--r-- | sys/man/1/cpu | 12 | ||||
-rw-r--r-- | sys/man/4/srv | 108 | ||||
-rw-r--r-- | sys/src/cmd/cpu.c | 59 | ||||
-rw-r--r-- | sys/src/cmd/import.c | 72 |
4 files changed, 15 insertions, 236 deletions
diff --git a/sys/man/1/cpu b/sys/man/1/cpu index b523911a2..4988f58c7 100644 --- a/sys/man/1/cpu +++ b/sys/man/1/cpu @@ -36,8 +36,6 @@ cpu \- connection to CPU server .I address ] [ .B -R -| -.B -O ] .SH DESCRIPTION .I Cpu @@ -183,21 +181,13 @@ to run the server (remote) side of the protocol. It is run from service files such as .BR /bin/service/tcp17010 . The -.B -O -flag is similar but simulates the pre-9P2000 version -of the -.I cpu -protocol. -The .B -n option allows using the .B none authentication method for incoming connections and must be specified before the .B -R -and -.B -O -flags. +flag. .PP The .B -p diff --git a/sys/man/4/srv b/sys/man/4/srv index 9c83e26cd..5d2164791 100644 --- a/sys/man/4/srv +++ b/sys/man/4/srv @@ -1,6 +1,6 @@ .TH SRV 4 .SH NAME -srv, srvold9p, 9fs, srvssh \- start network file service +srv, srvssh, 9fs \- start network file service .SH SYNOPSIS .B srv [ @@ -41,35 +41,6 @@ srv, srvold9p, 9fs, srvssh \- start network file service .B 9fs .RI [ net !] system .RI [ mountpoint ] -.PP -.in +0.5i -.ti -0.5i -.B srvold9p -[ -.B -abcCdF -] [ -.B -p -.I servicename -] [ -.B -s -| -.B -m -.I mountpoint -] [ -.B -u -.I user -] [ -.B -x -.I command -| -.B -n -.I network-addr -| -.B -f -.I file -] -.br -.in -0.5i .SH DESCRIPTION .I Srv dials the given machine and initializes the connection to serve the @@ -208,67 +179,6 @@ see the introductory comment in .BR /rc/bin/srvssh . The arguments are the same as .IR srv . -.PP -.I Srvold9p -is a compatibilty hack to allow Fourth Edition Plan 9 systems -to connect to older 9P servers. -It functions as a variant of -.I srv -that performs a version translation on the 9P messages on the underlying connection. -Some of its options are the same as those of -.IR srv ; -the special ones are: -.TF "-x commandxx" -.PD -.TP -.B -d -Enable debugging. -.TP -.B -F -Insert a special (internal) filter process to the connection to maintain -message boundaries; usually only needed on TCP connections. -.TP -.BI -p\ servicename -Post the service under -.IR srv (3) -as -.BI /srv/ servicename\f1. -.TP -.BI -u\ user -When connecting to the remote server, log in as -.IR user . -Since -.I srvold9p -does no authentication, and since new kernels cannot authenticate to -old services, the likeliest value of -.I user -is -.BR none . -.TP -.BI -x\ command -Run -.I command -and use its standard input and output as the 9P service connection. -If the -.I command -string contains blanks, it should be quoted. -.TP -.BI -n\ network-addr -Dial -.I network-addr -to establish the connection. -.TP -.BI -f\ file -Use -.I file -(typically an existing -.IR srv (3) -file) as the connection. -.PP -.I Srvold9p -is run automatically when a -.IR cpu (1) -call is received on the service port for the old protocol. .SH EXAMPLES To see kremvax's and deepthought's files in .B /n/kremvax @@ -280,20 +190,6 @@ and 9fs hhgttg /n/deepthought .EE .PP -To mount as user -.B none -a connection to an older server kgbsun: -.IP -.EX -srvold9p -u none -m /n/kgbsun -p kgbsun -n il!kgbsun -.EE -.PP -Other windows may then mount the connection directly: -.IP -.EX -mount /srv/kgbsun /n/kgbsun -.EE -.PP To connect to an instance of the Unix server .IR u9fs (4) started via @@ -316,8 +212,6 @@ and .B /rc/bin/9fs .br .B /rc/bin/srvssh -.br -.B /sys/src/cmd/srvold9p .SH "SEE ALSO" .IR bind (1), .IR auth (2), diff --git a/sys/src/cmd/cpu.c b/sys/src/cmd/cpu.c index 44792fc90..1994aaf28 100644 --- a/sys/src/cmd/cpu.c +++ b/sys/src/cmd/cpu.c @@ -14,7 +14,7 @@ #define Maxfdata 8192 #define MaxStr 128 -void remoteside(int); +void remoteside(void); void fatal(char*, ...); void lclnoteproc(int); void rmtnoteproc(void); @@ -69,8 +69,6 @@ struct AuthMethod { }; AuthMethod *am = authmethod; /* default is p9 */ -char *p9authproto = "p9any"; - int setam(char*); char *aan = "/bin/aan"; @@ -188,12 +186,8 @@ main(int argc, char **argv) case 'A': anstring = EARGF(usage()); break; - case 'O': - p9authproto = "p9sk2"; - remoteside(1); /* From listen */ - break; case 'R': /* From listen */ - remoteside(0); + remoteside(); break; case 'h': system = EARGF(usage()); @@ -297,47 +291,9 @@ fatal(char *fmt, ...) char *negstr = "negotiating authentication method"; -int -old9p(int fd) -{ - int p[2]; - - if(pipe(p) < 0) - fatal("pipe: %r"); - - switch(rfork(RFPROC|RFMEM|RFFDG|RFNAMEG|RFREND)) { - case -1: - fatal("rfork srvold9p: %r"); - case 0: - if(fd != 1){ - dup(fd, 1); - close(fd); - } - if(p[0] != 0){ - dup(p[0], 0); - close(p[0]); - } - close(p[1]); - if(0){ - fd = open("/sys/log/cpu", OWRITE); - if(fd != 2){ - dup(fd, 2); - close(fd); - } - execl("/bin/srvold9p", "srvold9p", "-ds", nil); - } else - execl("/bin/srvold9p", "srvold9p", "-s", nil); - fatal("exec srvold9p: %r"); - default: - close(fd); - close(p[0]); - } - return p[1]; -} - /* Invoked with stdin and stdout connected to the network connection */ void -remoteside(int old) +remoteside(void) { char user[MaxStr], buf[MaxStr], xdir[MaxStr], cmd[MaxStr]; int i, n, fd, badchdir, gotcmd; @@ -351,7 +307,7 @@ remoteside(int old) if(n < 0) fatal("authenticating: %r"); filterp = nil; - if(!old && strcmp(cmd, "aan") == 0){ + if(strcmp(cmd, "aan") == 0){ filterp = aan; writestr(fd, "", nil, 1); n = readstr(fd, cmd, sizeof(cmd)); @@ -396,9 +352,6 @@ remoteside(int old) if(n != 2 || buf[0] != 'O' || buf[1] != 'K') exits("remote tree"); - if(old) - fd = old9p(fd); - /* make sure buffers are big by doing fversion explicitly; pick a huge number; other side will trim */ strcpy(buf, VERSION9P); if(fversion(fd, 64*1024, buf, sizeof buf) < 0) @@ -666,7 +619,7 @@ p9auth(int fd) { AuthInfo *ai; - ai = auth_proxy(fd, auth_getkey, "proto=%q role=client %s", p9authproto, keyspec); + ai = auth_proxy(fd, auth_getkey, "proto=p9any role=client %s", keyspec); if(ai == nil) return -1; fd = sslsetup(fd, ai->secret, ai->nsecret, 1); @@ -695,7 +648,7 @@ srvp9auth(int fd, char *user) { AuthInfo *ai; - ai = auth_proxy(fd, nil, "proto=%q role=server %s", p9authproto, keyspec); + ai = auth_proxy(fd, nil, "proto=p9any role=server %s", keyspec); if(ai == nil) return -1; if(auth_chuid(ai, nil) < 0) diff --git a/sys/src/cmd/import.c b/sys/src/cmd/import.c index 0dccaa10b..2f271928b 100644 --- a/sys/src/cmd/import.c +++ b/sys/src/cmd/import.c @@ -28,9 +28,8 @@ int doauth = 1; int timedout; int skiptree; -int connect(char*, char*, int); +int connect(char*, char*); int passive(void); -int old9p(int); void catcher(void*, char*); void sysfatal(char*, ...); void usage(void); @@ -94,11 +93,10 @@ void main(int argc, char **argv) { char *mntpt, *srvpost, srvfile[64]; - int backwards = 0, fd, mntflags, oldserver; + int backwards = 0, fd, mntflags; quotefmtinstall(); srvpost = nil; - oldserver = 0; mntflags = MREPL; ARGBEGIN{ case 'A': @@ -122,10 +120,6 @@ main(int argc, char **argv) case 'f': /* ignored but allowed for compatibility */ break; - case 'O': - case 'o': - oldserver = 1; - break; case 'E': if ((encproto = lookup(EARGF(usage()), encprotos)) < 0) usage(); @@ -188,11 +182,9 @@ main(int argc, char **argv) if (backwards) fd = passive(); else - fd = connect(argv[0], argv[1], oldserver); + fd = connect(argv[0], argv[1]); - if (!oldserver) - fprint(fd, "impo %s %s\n", filterp? "aan": "nofilter", - encprotos[encproto]); + fprint(fd, "impo %s %s\n", filterp? "aan": "nofilter", encprotos[encproto]); if (encproto != Encnone && ealgs && ai) { uchar key[16], digest[SHA1dlen]; @@ -259,50 +251,10 @@ catcher(void*, char *msg) } int -old9p(int fd) -{ - int p[2]; - - procsetname("old9p"); - if(pipe(p) < 0) - sysfatal("pipe: %r"); - - switch(rfork(RFPROC|RFMEM|RFFDG|RFNAMEG)) { - case -1: - sysfatal("rfork srvold9p: %r"); - case 0: - if(fd != 1){ - dup(fd, 1); - close(fd); - } - if(p[0] != 0){ - dup(p[0], 0); - close(p[0]); - } - close(p[1]); - if(0){ - fd = open("/sys/log/cpu", OWRITE); - if(fd != 2){ - dup(fd, 2); - close(fd); - } - execl("/bin/srvold9p", "srvold9p", "-ds", nil); - } else - execl("/bin/srvold9p", "srvold9p", "-s", nil); - sysfatal("exec srvold9p: %r"); - default: - close(fd); - close(p[0]); - } - return p[1]; -} - -int -connect(char *system, char *tree, int oldserver) +connect(char *system, char *tree) { char buf[ERRMAX], dir[128], *na; int fd, n; - char *authp; na = netmkaddr(system, 0, "exportfs"); procsetname("dial %s", na); @@ -310,15 +262,8 @@ connect(char *system, char *tree, int oldserver) sysfatal("can't dial %s: %r", system); if(doauth){ - if(oldserver) - authp = "p9sk2"; - else - authp = "p9any"; - - procsetname("auth_proxy auth_getkey proto=%q role=client %s", - authp, keyspec); - ai = auth_proxy(fd, auth_getkey, "proto=%q role=client %s", - authp, keyspec); + procsetname("auth_proxy auth_getkey proto=p9any role=client %s", keyspec); + ai = auth_proxy(fd, auth_getkey, "proto=p9any role=client %s", keyspec); if(ai == nil) sysfatal("%r: %s", system); } @@ -340,9 +285,6 @@ connect(char *system, char *tree, int oldserver) sysfatal("bad remote tree: %s", buf); } } - - if(oldserver) - return old9p(fd); return fd; } |