changeset 592:778f74d0706f

Verify the binary directly without relying on settings (which might differ)
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 28 May 2014 08:36:05 +0000
parents 26a18e3c3db4
children d0e7a80a11fe
files ui/mainwindow.cpp
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed May 28 07:56:21 2014 +0000
+++ b/ui/mainwindow.cpp	Wed May 28 08:36:05 2014 +0000
@@ -233,8 +233,16 @@
 
 void MainWindow::installNewSW(const QString& fileName, const QDateTime& modDate) {
     QFileInfo instProcInfo = QFileInfo(fileName);
-    verifySWData();
     QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath());
+
+    if (verify_binary(filePath.toUtf8().constData(),
+            filePath.toUtf8().size()) != VerifyValid) {
+        qDebug() << "Invalid software. Not installing";
+        return;
+      }
+    QFileInfo fi(QCoreApplication::applicationFilePath());
+    QDir installDir = fi.absoluteDir();
+
 #ifdef WIN32
     SHELLEXECUTEINFOW shExecInfo;
     memset (&shExecInfo, 0, sizeof(SHELLEXECUTEINFOW));

http://wald.intevation.org/projects/trustbridge/