Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 13 lines 863 B view raw
1diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp 2index a879c8d..3d7863b 100644 3--- a/src/util/externalcommandhelper.cpp 4+++ b/src/util/externalcommandhelper.cpp 5@@ -387,7 +387,7 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr 6 if (dirname == QStringLiteral("bin") || dirname == QStringLiteral("sbin")) { 7 prefix.cdUp(); 8 } 9- if (trustedPrefixes.find(prefix.path()) == trustedPrefixes.end()) { // TODO: C++20: replace with contains 10+ if (!prefix.path().startsWith(QStringLiteral("/nix/store")) && !prefix.path().startsWith(QStringLiteral("/run/current-system/sw"))) { // TODO: C++20: replace with contains 11 qInfo() << prefix.path() << "prefix is not one of the trusted command prefixes"; 12 reply[QStringLiteral("success")] = false; 13 return reply;