rule_ents from conditional block are dropped

In the following policy, "ptrace" would be dropped during merging:

$FOO=true
/bin/true {
  if $FOO {
      ptrace,
  }
}

Current behavior:
----- Debugging built structures -----
Name:		/bin/true
Local To:	<NULL>
Mode: 

With patch:
----- Debugging built structures -----
Name:		/bin/true
Local To:	<NULL>
Mode: 
ptrace,
This commit is contained in:
doublez13 2025-02-18 16:47:36 +00:00
parent 8711c7754b
commit dad66f663b

View file

@ -178,6 +178,8 @@ Profile *merge_policy(Profile *a, Profile *b)
}
}
a->rule_ents.splice(a->rule_ents.end(), b->rule_ents);
merge_hats(a, b->hat_table);
delete b;
out: