summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f941e8b)
yaffs_mkdir would create a directory if you passed the name of
a mount point. This change fails such attempts with -EEXIST.
tested with:
"yaffs2"
"/yaffs2"
"/yaffs2/"
"/yaffs2///////"
"yaffs2////"
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,path,&name,0);
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,path,&name,0);
- if(parent && parent->myDev->readOnly){
+ if(parent && yaffs_strnlen(name,5) == 0){
+ /* Trying to make the root itself */
+ yaffsfs_SetError(-EEXIST);
+ } else if(parent && parent->myDev->readOnly){
yaffsfs_SetError(-EINVAL);
} else {
if(parent)
yaffsfs_SetError(-EINVAL);
} else {
if(parent)