ConfUtil: Fix comparison with "System".

This commit is contained in:
Nodir Temirkhodjaev 2017-09-04 00:41:34 +05:00
parent 1dda1b2260
commit 1a6c63ba74
2 changed files with 5 additions and 5 deletions

View File

@ -17,8 +17,7 @@ void Test::confWriteRead()
conf.ipInclude()->setUseAll(true);
conf.ipExclude()->setUseAll(false);
conf.setAppLogBlocked(true);
conf.setAppBlockAll(false);
conf.setAppBlockAll(true);
conf.setAppAllowAll(false);
conf.ipInclude()->setText(QString());
@ -69,6 +68,7 @@ void Test::confWriteRead()
QVERIFY(!FortCommon::confIpInRange(data, NetUtil::textToIp4("193.0.0.0")));
QVERIFY(FortCommon::confAppBlocked(data, "System"));
QVERIFY(!FortCommon::confAppBlocked(data, FileUtil::pathToDosPath("C:\\programs\\skype\\phone\\skype.exe")));
QVERIFY(!FortCommon::confAppBlocked(data, FileUtil::pathToDosPath("C:\\utils\\dev\\git\\bin\\git.exe")));
QVERIFY(!FortCommon::confAppBlocked(data, FileUtil::pathToDosPath("C:\\Programs\\Skype\\Phone\\Skype.exe").toLower()));
QVERIFY(!FortCommon::confAppBlocked(data, FileUtil::pathToDosPath("C:\\Utils\\Dev\\Git\\").toLower()));
QVERIFY(FortCommon::confAppBlocked(data, FileUtil::pathToDosPath("C:\\Utils\\Firefox\\Bin\\firefox.exe").toLower()));
}

View File

@ -198,7 +198,7 @@ QString ConfUtil::parseAppPath(const QStringRef &line)
const QStringRef path = match.capturedRef(1);
const QString systemPath("System");
if (QStringRef::compare(path, systemPath, Qt::CaseInsensitive))
if (!QStringRef::compare(path, systemPath, Qt::CaseInsensitive))
return systemPath;
const QString dosPath = FileUtil::pathToDosPath(path.toString());