mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
vfs: support UNLINK_ERR_NO_ENTRY in TAR file system
We report UNLINK_ERR_NO_PERM only for files in TAR archive, otherwise UNLINK_ERR_NO_ENTRY is returned. This permits the arbitrary layering of file systems with support for proper ENOENT reporting, for example, when using 'rm -f non_existent_file' that aborts if EPERM is wrongly reported.
This commit is contained in:
parent
b8cd56cb90
commit
b38c5006d8
@ -508,7 +508,14 @@ class Vfs::Tar_file_system : public File_system
|
||||
return DIRENT_OK;
|
||||
}
|
||||
|
||||
Unlink_result unlink(char const *) override { return UNLINK_ERR_NO_PERM; }
|
||||
Unlink_result unlink(char const *path) override
|
||||
{
|
||||
Node const *node = dereference(path);
|
||||
if (!node)
|
||||
return UNLINK_ERR_NO_ENTRY;
|
||||
else
|
||||
return UNLINK_ERR_NO_PERM;
|
||||
}
|
||||
|
||||
Readlink_result readlink(char const *path, char *buf, file_size buf_size,
|
||||
file_size &out_len) override
|
||||
|
Loading…
Reference in New Issue
Block a user