mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Kernel: Allow unveiling subfolders regardless of parent's permissions
This fixes a bug where unveiling a subdirectory of an already unveiled path would sometimes be allowed and sometimes not (depending on what other unveil calls have been made). Now, it is always allowed to unveil a subdirectory of an already unveiled directory, even if it has higher permissions. This removes the need for the permissions_inherited_from_root flag in UnveilMetadata, so it has been removed.
This commit is contained in:
parent
9d41dd2ed0
commit
e8a317023d
3 changed files with 8 additions and 10 deletions
|
@ -27,13 +27,11 @@ struct UnveilMetadata {
|
|||
String full_path;
|
||||
UnveilAccess permissions { None };
|
||||
bool explicitly_unveiled { false };
|
||||
bool unveil_inherited_from_root { false }; // true if permissions are inherited from the tree root (/).
|
||||
};
|
||||
|
||||
struct UnveilNode final : public Trie<String, UnveilMetadata, Traits<String>, UnveilNode> {
|
||||
using Trie<String, UnveilMetadata, Traits<String>, UnveilNode>::Trie;
|
||||
|
||||
bool permissions_inherited_from_root() const { return this->metadata_value().unveil_inherited_from_root; }
|
||||
bool was_explicitly_unveiled() const { return this->metadata_value().explicitly_unveiled; }
|
||||
UnveilAccess permissions() const { return this->metadata_value().permissions; }
|
||||
const String& path() const { return this->metadata_value().full_path; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue