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?
|
* what are legal characters in a name?
|
||||||
* only disallow control characters.
|
* only disallow control characters.
|
||||||
* a) utf avoids control characters.
|
* utf avoids control characters, so we
|
||||||
* b) '/' may not be the separator
|
* only need to inspect the ascii range.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
checkname(char *n)
|
checkname(char *n)
|
||||||
|
@ -556,7 +556,7 @@ checkname(char *n)
|
||||||
c = n[i] & 0xff;
|
c = n[i] & 0xff;
|
||||||
if(c == 0)
|
if(c == 0)
|
||||||
return 0;
|
return 0;
|
||||||
if(c < 040)
|
if(c < 040 || c == '/')
|
||||||
return Ename;
|
return Ename;
|
||||||
}
|
}
|
||||||
return Etoolong;
|
return Etoolong;
|
||||||
|
|
Loading…
Reference in a new issue