From 0eaee045cfb0a08abda443e6b9bd9dfd0949f43c Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 19 Aug 2022 12:38:19 +0300 Subject: [PATCH] SystemMonitor: Don't unveil /boot/Kernel.debug if it does not exist If the user decided for some reason to not include Kernel debug symbols in the disk image, let's not try to unveil it. --- Userland/Applications/SystemMonitor/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 0d9a42bc87..21d904ba74 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -253,8 +253,10 @@ ErrorOr serenity_main(Main::Arguments arguments) if (auto result = Core::System::unveil("/usr/local/lib", "r"); result.is_error() && result.error().code() != ENOENT) return result.release_error(); - // This file is only accessible when running as root - if (auto result = Core::System::unveil("/boot/Kernel.debug", "r"); result.is_error() && result.error().code() != EACCES) + // This file is only accessible when running as root if it is available on the disk image. + // It might be possible to not have this file on the disk image, if the user decided to not + // include kernel symbols for debug purposes so don't fail if the error is ENOENT. + if (auto result = Core::System::unveil("/boot/Kernel.debug", "r"); result.is_error() && (result.error().code() != EACCES && result.error().code() != ENOENT)) return result.release_error(); TRY(Core::System::unveil("/bin/Profiler", "rx"));