fix(integrity): exclude installer-managed metadata
This commit is contained in:
@@ -430,22 +430,13 @@ QStringList UpdaterLogic::obsoleteFilesComparedTo(const QJsonObject& oldManifest
|
||||
}
|
||||
|
||||
QSet<QString> protectedPaths{
|
||||
QStringLiteral("bootstrap.exe"),
|
||||
QStringLiteral("launcher.exe"),
|
||||
QStringLiteral("updater.exe"),
|
||||
QStringLiteral("client.ini"),
|
||||
QStringLiteral("config/app_config.json"),
|
||||
QStringLiteral("config/local_state.json"),
|
||||
QStringLiteral("config/client_identity.dat"),
|
||||
QStringLiteral("config/version_policy.dat")
|
||||
QStringLiteral("updater.exe")
|
||||
};
|
||||
const QString runtimePrefix = ConfigHelper::instance().runtimeRelativePath().toCaseFolded();
|
||||
if (!runtimePrefix.isEmpty()) {
|
||||
const QStringList runtimeProtected{
|
||||
QStringLiteral("bootstrap.exe"), QStringLiteral("launcher.exe"), QStringLiteral("updater.exe"),
|
||||
QStringLiteral("client.ini"), QStringLiteral("config/app_config.json"),
|
||||
QStringLiteral("config/local_state.json"), QStringLiteral("config/client_identity.dat"),
|
||||
QStringLiteral("config/version_policy.dat")
|
||||
QStringLiteral("launcher.exe"), QStringLiteral("updater.exe")
|
||||
};
|
||||
for (const QString& path : runtimeProtected)
|
||||
protectedPaths.insert(runtimePrefix + "/" + path);
|
||||
@@ -456,6 +447,7 @@ QStringList UpdaterLogic::obsoleteFilesComparedTo(const QJsonObject& oldManifest
|
||||
const QString path = QDir::fromNativeSeparators(value.toObject().value("path").toString());
|
||||
const QString folded = path.toCaseFolded();
|
||||
if (!isSafeRelativePath(path) || protectedPaths.contains(folded)
|
||||
|| isRuntimeProtectedPath(path)
|
||||
|| newPaths.contains(folded) || seen.contains(folded))
|
||||
continue;
|
||||
seen.insert(folded);
|
||||
|
||||
Reference in New Issue
Block a user