ref: 22f11771872bfc692923436cbe7d04830eb818c8
parent: ae81d166452f0649ca498794a85f3776f56beb1c
	author: Ori Bernstein <ori@eigenstate.org>
	date: Mon Sep 24 21:02:31 EDT 2018
	
Disallow '/' in file names. A bad rename call could send a path with a '/' to cwfs. This is invalid, and should be disallowed.
--- a/sys/src/cmd/cwfs/sub.c
+++ b/sys/src/cmd/cwfs/sub.c
@@ -540,8 +540,8 @@
/*
* what are legal characters in a name?
* only disallow control characters.
- * a) utf avoids control characters.
- * b) '/' may not be the separator
+ * utf avoids control characters, so we
+ * only need to inspect the ascii range.
*/
int
checkname(char *n)
@@ -556,7 +556,7 @@
c = n[i] & 0xff;
if(c == 0)
return 0;
- if(c < 040)
+ if(c < 040 || c == '/')
return Ename;
}
return Etoolong;
--
⑨