mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-03 12:34:12 +00:00
Check for existing directories at Vfs::Dir_file_system
Return OPENDIR_ERR_NODE_ALREADY_EXISTS for existing directories. Remove deprecated 'is_directory' method. Fix #3083
This commit is contained in:
parent
c41fbe9ea5
commit
93fb79f357
@ -536,7 +536,7 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
{
|
{
|
||||||
path = _sub_path(path);
|
path = _sub_path(path);
|
||||||
if (!path)
|
if (!path)
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
if (strlen(path) == 0)
|
if (strlen(path) == 0)
|
||||||
return path;
|
return path;
|
||||||
@ -547,7 +547,7 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
return leaf_path;
|
return leaf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Open_result open(char const *path,
|
Open_result open(char const *path,
|
||||||
@ -686,6 +686,9 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
return OPENDIR_ERR_LOOKUP_FAILED;
|
return OPENDIR_ERR_LOOKUP_FAILED;
|
||||||
|
|
||||||
if (create) {
|
if (create) {
|
||||||
|
if (leaf_path(path) != nullptr)
|
||||||
|
return OPENDIR_ERR_NODE_ALREADY_EXISTS;
|
||||||
|
|
||||||
auto opendir_fn = [&] (File_system &fs, char const *path)
|
auto opendir_fn = [&] (File_system &fs, char const *path)
|
||||||
{
|
{
|
||||||
Vfs_handle *tmp_handle;
|
Vfs_handle *tmp_handle;
|
||||||
|
Loading…
Reference in New Issue
Block a user