Disallow '/' in file names.
A bad rename call could send a path with a '/' to cwfs. This is invalid, and should be disallowed.
This commit is contained in:
parent
2f076f946f
commit
72a840b31d
1 changed files with 3 additions and 3 deletions
|
@ -540,8 +540,8 @@ loop:
|
|||
/*
|
||||
* 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 @@ checkname(char *n)
|
|||
c = n[i] & 0xff;
|
||||
if(c == 0)
|
||||
return 0;
|
||||
if(c < 040)
|
||||
if(c < 040 || c == '/')
|
||||
return Ename;
|
||||
}
|
||||
return Etoolong;
|
||||
|
|
Loading…
Reference in a new issue