mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:45:22 +00:00
UI: Blocked: Rename default block reason
This commit is contained in:
parent
cb6558e1f2
commit
fbfbcb9016
@ -304,8 +304,7 @@ FORT_API FORT_APP_FLAGS fort_conf_app_find(const PFORT_CONF conf, const PVOID pa
|
|||||||
static BOOL fort_conf_app_blocked_check(const PFORT_CONF conf, INT8 *block_reason, BOOL app_found,
|
static BOOL fort_conf_app_blocked_check(const PFORT_CONF conf, INT8 *block_reason, BOOL app_found,
|
||||||
BOOL app_allowed, BOOL app_blocked)
|
BOOL app_allowed, BOOL app_blocked)
|
||||||
{
|
{
|
||||||
*block_reason =
|
*block_reason = app_found ? FORT_BLOCK_REASON_APP_GROUP_FOUND : FORT_BLOCK_REASON_FILTER_MODE;
|
||||||
app_found ? FORT_BLOCK_REASON_APP_GROUP_FOUND : FORT_BLOCK_REASON_APP_GROUP_DEFAULT;
|
|
||||||
|
|
||||||
/* Block All */
|
/* Block All */
|
||||||
if (conf->flags.app_block_all)
|
if (conf->flags.app_block_all)
|
||||||
|
@ -18,7 +18,7 @@ enum FortBlockReason {
|
|||||||
FORT_BLOCK_REASON_REAUTH,
|
FORT_BLOCK_REASON_REAUTH,
|
||||||
FORT_BLOCK_REASON_PROGRAM,
|
FORT_BLOCK_REASON_PROGRAM,
|
||||||
FORT_BLOCK_REASON_APP_GROUP_FOUND,
|
FORT_BLOCK_REASON_APP_GROUP_FOUND,
|
||||||
FORT_BLOCK_REASON_APP_GROUP_DEFAULT,
|
FORT_BLOCK_REASON_FILTER_MODE,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FORTDEF_H
|
#endif // FORTDEF_H
|
||||||
|
@ -92,7 +92,7 @@ TEST_F(ConfUtilTest, confWriteRead)
|
|||||||
|
|
||||||
ASSERT_TRUE(DriverCommon::confAppBlocked(
|
ASSERT_TRUE(DriverCommon::confAppBlocked(
|
||||||
data, DriverCommon::confAppFind(data, "System"), &blockReason));
|
data, DriverCommon::confAppFind(data, "System"), &blockReason));
|
||||||
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_APP_GROUP_DEFAULT);
|
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_FILTER_MODE);
|
||||||
|
|
||||||
ASSERT_FALSE(DriverCommon::confAppBlocked(data,
|
ASSERT_FALSE(DriverCommon::confAppBlocked(data,
|
||||||
DriverCommon::confAppFind(
|
DriverCommon::confAppFind(
|
||||||
@ -115,7 +115,7 @@ TEST_F(ConfUtilTest, confWriteRead)
|
|||||||
DriverCommon::confAppFind(
|
DriverCommon::confAppFind(
|
||||||
data, FileUtil::pathToKernelPath("C:\\Program Files\\Test.exe")),
|
data, FileUtil::pathToKernelPath("C:\\Program Files\\Test.exe")),
|
||||||
&blockReason));
|
&blockReason));
|
||||||
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_APP_GROUP_DEFAULT);
|
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_FILTER_MODE);
|
||||||
|
|
||||||
ASSERT_EQ(DriverCommon::confAppPeriodBits(data, 0, 0), 0x01);
|
ASSERT_EQ(DriverCommon::confAppPeriodBits(data, 0, 0), 0x01);
|
||||||
ASSERT_EQ(DriverCommon::confAppPeriodBits(data, 12, 0), 0);
|
ASSERT_EQ(DriverCommon::confAppPeriodBits(data, 12, 0), 0);
|
||||||
|
@ -184,8 +184,8 @@ QString ConnListModel::blockReasonText(const ConnRow &connRow)
|
|||||||
return tr("Programs logic");
|
return tr("Programs logic");
|
||||||
case FORT_BLOCK_REASON_APP_GROUP_FOUND:
|
case FORT_BLOCK_REASON_APP_GROUP_FOUND:
|
||||||
return tr("App. Group logic");
|
return tr("App. Group logic");
|
||||||
case FORT_BLOCK_REASON_APP_GROUP_DEFAULT:
|
case FORT_BLOCK_REASON_FILTER_MODE:
|
||||||
return tr("App. Group default logic");
|
return tr("Filter Mode logic");
|
||||||
default:
|
default:
|
||||||
return tr("Unknown");
|
return tr("Unknown");
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ QString ConnListModel::connIconPath(const ConnRow &connRow)
|
|||||||
return ":/icons/application.png";
|
return ":/icons/application.png";
|
||||||
case FORT_BLOCK_REASON_APP_GROUP_FOUND:
|
case FORT_BLOCK_REASON_APP_GROUP_FOUND:
|
||||||
return ":/icons/application_double.png";
|
return ":/icons/application_double.png";
|
||||||
case FORT_BLOCK_REASON_APP_GROUP_DEFAULT:
|
case FORT_BLOCK_REASON_FILTER_MODE:
|
||||||
default:
|
default:
|
||||||
return ":/icons/deny.png";
|
return ":/icons/deny.png";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user