mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
Vfs::Dir_file_system: do not use Vfs_handle for opening directories as files
The Dir_file_system uses static cast to convert handles from the application to a plugin local type. For this reason, only the local handle type may be returned from 'opendir' or 'open'. This fixes the unexpected behavior when opening directories as files. Fix #2533
This commit is contained in:
parent
2bbb183a18
commit
013eb506a8
@ -541,7 +541,7 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
*/
|
*/
|
||||||
if (directory(path)) {
|
if (directory(path)) {
|
||||||
try {
|
try {
|
||||||
*out_handle = new (alloc) Vfs_handle(*this, *this, alloc, 0);
|
*out_handle = new (alloc) Dir_vfs_handle(*this, *this, alloc, path);
|
||||||
return OPEN_OK;
|
return OPEN_OK;
|
||||||
}
|
}
|
||||||
catch (Genode::Out_of_ram) { return OPEN_ERR_OUT_OF_RAM; }
|
catch (Genode::Out_of_ram) { return OPEN_ERR_OUT_OF_RAM; }
|
||||||
|
Loading…
Reference in New Issue
Block a user