diff --git a/parser/parser_regex.c b/parser/parser_regex.c index deb704f36..dfab8328a 100644 --- a/parser/parser_regex.c +++ b/parser/parser_regex.c @@ -848,7 +848,7 @@ int clear_and_convert_entry(std::string& buffer, char *entry) int post_process_policydb_ents(Profile *prof) { for (RuleList::iterator i = prof->rule_ents.begin(); i != prof->rule_ents.end(); i++) { - if ((*i)->flags & RULE_FLAG_DELETED) + if ((*i)->skip_processing()) continue; if ((*i)->gen_policy_re(*prof) == RULE_ERROR) return FALSE; diff --git a/parser/parser_variable.c b/parser/parser_variable.c index 15978538b..4f3e8f2f0 100644 --- a/parser/parser_variable.c +++ b/parser/parser_variable.c @@ -267,7 +267,7 @@ static int process_variables_in_entries(struct cod_entry *entry_list) static int process_variables_in_rules(Profile &prof) { for (RuleList::iterator i = prof.rule_ents.begin(); i != prof.rule_ents.end(); i++) { - if ((*i)->flags & RULE_FLAG_DELETED) + if ((*i)->skip_processing()) continue; int error = (*i)->expand_variables(); if (error) diff --git a/parser/profile.cc b/parser/profile.cc index 27fe570ee..e16546450 100644 --- a/parser/profile.cc +++ b/parser/profile.cc @@ -318,7 +318,7 @@ void post_process_file_entries(Profile *prof) void post_process_rule_entries(Profile *prof) { for (RuleList::iterator i = prof->rule_ents.begin(); i != prof->rule_ents.end(); i++) { - if ((*i)->flags & RULE_FLAG_DELETED) + if ((*i)->skip_processing()) continue; (*i)->post_parse_profile(*prof); } diff --git a/parser/rule.h b/parser/rule.h index 469b91580..f4931a890 100644 --- a/parser/rule.h +++ b/parser/rule.h @@ -58,6 +58,12 @@ public: bool is_type(int type) { return rule_type == type; } + // rule has been marked as should be skipped by regular processing + bool skip_processing() + { + return (flags == RULE_FLAG_DELETED || + flags == RULE_FLAG_MERGED); + } //virtual bool operator<(rule_t const &rhs)const = 0; virtual std::ostream &dump(std::ostream &os) = 0;