UI: Blocked: Rename default block reason

This commit is contained in:
Nodir Temirkhodjaev 2023-01-17 15:00:59 +03:00
parent cb6558e1f2
commit fbfbcb9016
4 changed files with 7 additions and 8 deletions

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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";
} }