core: fix inShellPath, Permission denied (#213)

This commit is contained in:
v3llocet 2024-05-15 17:54:17 +02:00 committed by GitHub
parent 1f228ba2f1
commit af7c87a32f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {