UI: AppGroup: Use "wildcard search" for "Kill Process" option

This commit is contained in:
Nodir Temirkhodjaev 2023-11-29 12:08:17 +03:00
parent 6dfd4373c2
commit ab7ef64bba
5 changed files with 9 additions and 6 deletions

View File

@ -41,7 +41,7 @@ typedef struct fort_conf_flags
UINT32 log_blocked_ip : 1;
UINT32 log_alerted_blocked_ip : 1;
UINT32 group_apply_child : 1;
UINT32 group_wildcard : 1;
UINT32 group_bits : 16;
} FORT_CONF_FLAGS, *PFORT_CONF_FLAGS;

View File

@ -386,7 +386,7 @@ inline static void fort_pstree_check_proc_conf(
const PFORT_CONF conf = &conf_ref->conf;
const FORT_APP_FLAGS app_flags = conf->flags.group_apply_child
const FORT_APP_FLAGS app_flags = conf->flags.group_wildcard
? fort_conf_app_find(conf, path_buf, path_len, fort_conf_exe_find, conf_ref)
: fort_conf_exe_find(conf, conf_ref, path_buf, path_len);

View File

@ -173,10 +173,13 @@ void FirewallConf::setAppGroupBits(quint32 groupBits)
m_appGroupBits = groupBits;
}
bool FirewallConf::appGroupApplyChild() const
bool FirewallConf::appGroupWildcard() const
{
for (const AppGroup *appGroup : appGroups()) {
if (appGroup->enabled() && appGroup->applyChild())
if (!appGroup->enabled())
continue;
if (appGroup->applyChild() || !appGroup->killText().isEmpty())
return true;
}
return false;

View File

@ -106,7 +106,7 @@ public:
quint32 appGroupBits() const { return m_appGroupBits; }
void setAppGroupBits(quint32 groupBits);
bool appGroupApplyChild() const;
bool appGroupWildcard() const;
bool appGroupEnabled(int groupIndex) const;

View File

@ -73,7 +73,7 @@ void writeConfFlags(const FirewallConf &conf, PFORT_CONF_FLAGS confFlags)
confFlags->log_blocked_ip = conf.logBlockedIp();
confFlags->log_alerted_blocked_ip = conf.logAlertedBlockedIp();
confFlags->group_apply_child = conf.appGroupApplyChild();
confFlags->group_wildcard = conf.appGroupWildcard();
confFlags->group_bits = conf.appGroupBits();
}