Better do the check for "." and ".." after stripping off superflous leafs as
otherwise a "rmdir ./" would still have caused the corruption. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29299 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5644,7 +5644,9 @@ dir_remove(int fd, char *path, bool kernel)
|
|||||||
// "name/" -> "name", or "name/." -> "name"
|
// "name/" -> "name", or "name/." -> "name"
|
||||||
lastSlash[0] = '\0';
|
lastSlash[0] = '\0';
|
||||||
}
|
}
|
||||||
} else if (!strcmp(path, ".") || !strcmp(path, ".."))
|
}
|
||||||
|
|
||||||
|
if (!strcmp(path, ".") || !strcmp(path, ".."))
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user