diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 19ee1a8193d..9735de7824a 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -119,6 +119,7 @@ target_link_libraries(notify PRIVATE LibGfx LibGUI) target_link_libraries(open PRIVATE LibDesktop) target_link_libraries(passwd PRIVATE LibCrypt) target_link_libraries(paste PRIVATE LibGUI) +target_link_libraries(pledge PRIVATE LibFileSystem) target_link_libraries(pgrep PRIVATE LibRegex) target_link_libraries(pkill PRIVATE LibRegex) target_link_libraries(pls PRIVATE LibCrypt) diff --git a/Userland/Utilities/pledge.cpp b/Userland/Utilities/pledge.cpp index a056c6cd196..33f46c955f2 100644 --- a/Userland/Utilities/pledge.cpp +++ b/Userland/Utilities/pledge.cpp @@ -5,20 +5,16 @@ */ #include -#include #include #include #include +#include #include static ErrorOr is_dynamically_linked_executable(StringView filename) { - auto maybe_executable = Core::DeprecatedFile::resolve_executable_from_environment(filename); - - if (!maybe_executable.has_value()) - return ENOENT; - - auto file = TRY(Core::MappedFile::map(maybe_executable.release_value())); + auto executable = TRY(FileSystem::resolve_executable_from_environment(filename)); + auto file = TRY(Core::MappedFile::map(executable)); ELF::Image elf_image(file->bytes()); return elf_image.is_dynamic(); }