mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
Kernel: No need to check is_superuser() after may_execute().
Since may_execute() incorporates a superuser check. :^)
This commit is contained in:
parent
5e40aa4f1a
commit
159fa99539
Notes:
sideshowbarker
2024-07-19 15:33:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/159fa995398
1 changed files with 2 additions and 2 deletions
|
@ -295,7 +295,7 @@ KResultOr<Retained<Inode>> VFS::open_directory(const String& path, Inode& base)
|
|||
auto inode = inode_or_error.value();
|
||||
if (!inode->is_directory())
|
||||
return KResult(-ENOTDIR);
|
||||
if (!inode->metadata().may_execute(*current) && !current->is_superuser())
|
||||
if (!inode->metadata().may_execute(*current))
|
||||
return KResult(-EACCES);
|
||||
return Retained<Inode>(*inode);
|
||||
}
|
||||
|
@ -589,7 +589,7 @@ KResultOr<InodeIdentifier> VFS::resolve_path(const String& path, InodeIdentifier
|
|||
#endif
|
||||
return KResult(-ENOTDIR);
|
||||
}
|
||||
if (!metadata.may_execute(*current) && !current->is_superuser())
|
||||
if (!metadata.may_execute(*current))
|
||||
return KResult(-EACCES);
|
||||
auto parent = crumb_id;
|
||||
crumb_id = crumb_inode->lookup(part);
|
||||
|
|
Loading…
Add table
Reference in a new issue