fix(integrity): restore bootstrap runtime protection

This commit is contained in:
Comely
2026-07-12 17:36:53 -07:00
parent c5e8f34f75
commit b098792001
4 changed files with 45 additions and 35 deletions
+3 -20
View File
@@ -19,6 +19,7 @@
#include <algorithm>
#include <cmath>
#include "ConfigHelper.h"
#include "RuntimeProtectionPolicy.h"
#ifdef HAVE_OPENSSL
#include <openssl/pem.h>
@@ -810,26 +811,8 @@ bool UpdaterLogic::downloadSingleFile(const QString& url, const QString& savePat
bool UpdaterLogic::isRuntimeProtectedPath(const QString& path) const
{
const QString normalized = QDir::fromNativeSeparators(path).toCaseFolded();
QSet<QString> protectedPaths{
QStringLiteral("bootstrap.exe"),
QStringLiteral("client.ini"),
QStringLiteral("config/app_config.json"),
QStringLiteral("config/local_state.json"),
QStringLiteral("config/client_identity.dat"),
QStringLiteral("config/version_policy.dat")
};
const QString runtimePrefix = ConfigHelper::instance().runtimeRelativePath().toCaseFolded();
if (!runtimePrefix.isEmpty()) {
const QStringList runtimeProtected{
QStringLiteral("bootstrap.exe"), QStringLiteral("client.ini"),
QStringLiteral("config/app_config.json"), QStringLiteral("config/local_state.json"),
QStringLiteral("config/client_identity.dat"), QStringLiteral("config/version_policy.dat")
};
for (const QString& protectedPath : runtimeProtected)
protectedPaths.insert(runtimePrefix + "/" + protectedPath);
}
return protectedPaths.contains(normalized);
return UpdateClient::isRuntimeProtectedPath(
path, ConfigHelper::instance().runtimeRelativePath());
}
bool UpdaterLogic::isSafeRelativePath(const QString& path) const