mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: introduce network label attribute
We want to be able to determine label in the future and build the policy dfa based on its presence or not. Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
parent
2a885872a3
commit
9ed04cb01e
2 changed files with 4 additions and 3 deletions
|
@ -399,7 +399,7 @@ void network_rule::set_netperm(unsigned int family, unsigned int type, unsigned
|
|||
|
||||
network_rule::network_rule(perms_t perms_p, struct cond_entry *conds,
|
||||
struct cond_entry *peer_conds):
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8)
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8), label(NULL)
|
||||
{
|
||||
size_t family_index;
|
||||
for (family_index = AF_UNSPEC; family_index < get_af_max(); family_index++) {
|
||||
|
@ -426,7 +426,7 @@ network_rule::network_rule(perms_t perms_p, struct cond_entry *conds,
|
|||
network_rule::network_rule(perms_t perms_p, const char *family, const char *type,
|
||||
const char *protocol, struct cond_entry *conds,
|
||||
struct cond_entry *peer_conds):
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8)
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8), label(NULL)
|
||||
{
|
||||
const struct network_tuple *mapping = NULL;
|
||||
while ((mapping = net_find_mapping(mapping, family, type, protocol))) {
|
||||
|
@ -461,7 +461,7 @@ network_rule::network_rule(perms_t perms_p, const char *family, const char *type
|
|||
}
|
||||
|
||||
network_rule::network_rule(perms_t perms_p, unsigned int family, unsigned int type):
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8)
|
||||
dedup_perms_rule_t(AA_CLASS_NETV8), label(NULL)
|
||||
{
|
||||
network_map[family].push_back({ family, type, 0xFFFFFFFF });
|
||||
set_netperm(family, type, 0xFFFFFFFF);
|
||||
|
|
|
@ -147,6 +147,7 @@ public:
|
|||
|
||||
ip_conds peer;
|
||||
ip_conds local;
|
||||
char *label;
|
||||
|
||||
bool has_local_conds(void) { return local.sip || local.sport; }
|
||||
bool has_peer_conds(void) { return peer.sip || peer.sport; }
|
||||
|
|
Loading…
Add table
Reference in a new issue