mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
pledge: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
8c2cdb7bc7
commit
77f021f5f1
Notes:
sideshowbarker
2024-07-17 06:29:49 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/77f021f5f1 Pull-request: https://github.com/SerenityOS/serenity/pull/18801
@ -119,6 +119,7 @@ target_link_libraries(notify PRIVATE LibGfx LibGUI)
|
|||||||
target_link_libraries(open PRIVATE LibDesktop)
|
target_link_libraries(open PRIVATE LibDesktop)
|
||||||
target_link_libraries(passwd PRIVATE LibCrypt)
|
target_link_libraries(passwd PRIVATE LibCrypt)
|
||||||
target_link_libraries(paste PRIVATE LibGUI)
|
target_link_libraries(paste PRIVATE LibGUI)
|
||||||
|
target_link_libraries(pledge PRIVATE LibFileSystem)
|
||||||
target_link_libraries(pgrep PRIVATE LibRegex)
|
target_link_libraries(pgrep PRIVATE LibRegex)
|
||||||
target_link_libraries(pkill PRIVATE LibRegex)
|
target_link_libraries(pkill PRIVATE LibRegex)
|
||||||
target_link_libraries(pls PRIVATE LibCrypt)
|
target_link_libraries(pls PRIVATE LibCrypt)
|
||||||
|
@ -5,20 +5,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
|
||||||
#include <LibCore/MappedFile.h>
|
#include <LibCore/MappedFile.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <LibELF/Image.h>
|
#include <LibELF/Image.h>
|
||||||
|
#include <LibFileSystem/FileSystem.h>
|
||||||
#include <LibMain/Main.h>
|
#include <LibMain/Main.h>
|
||||||
|
|
||||||
static ErrorOr<bool> is_dynamically_linked_executable(StringView filename)
|
static ErrorOr<bool> is_dynamically_linked_executable(StringView filename)
|
||||||
{
|
{
|
||||||
auto maybe_executable = Core::DeprecatedFile::resolve_executable_from_environment(filename);
|
auto executable = TRY(FileSystem::resolve_executable_from_environment(filename));
|
||||||
|
auto file = TRY(Core::MappedFile::map(executable));
|
||||||
if (!maybe_executable.has_value())
|
|
||||||
return ENOENT;
|
|
||||||
|
|
||||||
auto file = TRY(Core::MappedFile::map(maybe_executable.release_value()));
|
|
||||||
ELF::Image elf_image(file->bytes());
|
ELF::Image elf_image(file->bytes());
|
||||||
return elf_image.is_dynamic();
|
return elf_image.is_dynamic();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user