From af7c87a32f5d67eb2ada908a6a700f4e74831943 Mon Sep 17 00:00:00 2001 From: v3llocet <108526529+v3llocet@users.noreply.github.com> Date: Wed, 15 May 2024 17:54:17 +0200 Subject: [PATCH] core: fix inShellPath, Permission denied (#213) --- src/helpers/MiscFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 98b70cc..d3f4f42 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -56,7 +56,7 @@ bool inShellPath(const std::string& exec) { if (nextBegin < pathString.size()) paths.push_back(pathString.substr(nextBegin, pathString.size() - nextBegin)); - return std::ranges::any_of(paths, [&exec](std::string& path) { return std::filesystem::exists(path + "/" + exec); }); + return std::ranges::any_of(paths, [&exec](std::string& path) { return access((path + "/" + exec).c_str(), X_OK) == 0; }); } void sendEmptyDbusMethodReply(sdbus::MethodCall& call, u_int32_t responseCode) {