diff options
author | kvik <kvik@a-b.xyz> | 2020-08-01 15:27:28 +0200 |
---|---|---|
committer | kvik <kvik@a-b.xyz> | 2020-08-01 15:27:28 +0200 |
commit | e5894dcceaedeaf7d4f5537dd306170b1b6d4814 (patch) | |
tree | 1cc00acf23373f15f69218ba1ccbb372a9cb3899 /sys/src/cmd/paqfs | |
parent | 88a468f205af2bfdaa015a5bc33424ae0d56de08 (diff) |
pre-lib9p servers: fix incorrect Tversion handling
version(5) says:
If the server does not understand the client's version
string, it should respond with an Rversion message (not
Rerror) with the version string the 7 characters
``unknown''.
Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror.
lib9p(2) follows the above spec, although ignoring the next part
concerning comparison after period-stripping. It assumes an
Fcall.version starting with "9P" is correctly formed and returns
the only supported version of the protocol, which seems alright.
This patch brings pre-lib9p servers in accordance with the spec.
Diffstat (limited to 'sys/src/cmd/paqfs')
-rw-r--r-- | sys/src/cmd/paqfs/paqfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/src/cmd/paqfs/paqfs.c b/sys/src/cmd/paqfs/paqfs.c index 029534a85..34e05051e 100644 --- a/sys/src/cmd/paqfs/paqfs.c +++ b/sys/src/cmd/paqfs/paqfs.c @@ -135,7 +135,6 @@ char Excl[] = "exclusive use file already open"; char Ename[] = "illegal name"; char Erdonly[] = "read only file system"; char Ebadblock[] = "bad block"; -char Eversion[] = "bad version of P9"; char Edirtoobig[] = "directory entry too big"; int debug; @@ -270,9 +269,9 @@ rversion(Fid*) thdr.msize = mesgsize; else thdr.msize = rhdr.msize; - if(strcmp(rhdr.version, "9P2000") != 0) - return Eversion; thdr.version = "9P2000"; + if(strncmp(rhdr.version, "9P", 2) != 0) + thdr.version = "unknown"; return 0; } |