mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:42:13 +00:00
Kernel: Use LexicalPath to avoid two consecutive slashes in unveil path
This patch fixes a bug in the unveil syscall where an UnveilNode's path would start with two slashes if it's parent node was "/".
This commit is contained in:
parent
68ce69db88
commit
9d41dd2ed0
1 changed files with 4 additions and 1 deletions
|
@ -105,7 +105,10 @@ KResultOr<int> Process::sys$unveil(Userspace<const Syscall::SC_unveil_params*> u
|
|||
it,
|
||||
lexical_path.parts().end(),
|
||||
{ new_unveiled_path, (UnveilAccess)new_permissions, true },
|
||||
[](auto& parent, auto& it) -> Optional<UnveilMetadata> { return UnveilMetadata { String::formatted("{}/{}", parent.path(), *it), parent.permissions(), false, parent.permissions_inherited_from_root() }; });
|
||||
[](auto& parent, auto& it) -> Optional<UnveilMetadata> {
|
||||
auto path = LexicalPath::join(parent.path(), *it).string();
|
||||
return UnveilMetadata { path, parent.permissions(), false, parent.permissions_inherited_from_root() };
|
||||
});
|
||||
VERIFY(m_veil_state != VeilState::Locked);
|
||||
m_veil_state = VeilState::Dropped;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue