mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
fix race condition between boot.apparmor and boot.cleanup bnc#426149
This commit is contained in:
@@ -278,15 +278,9 @@ static pattern_t convert_aaregex_to_pcre(const char *aare, int anchor,
|
||||
/* { is a PCRE special character */
|
||||
STORE("\\{", dptr, 2);
|
||||
} else {
|
||||
if (ingrouping) {
|
||||
error = e_parse_error;
|
||||
PERROR(_("%s: Illegal open {, nesting groupings not allowed\n"),
|
||||
progname);
|
||||
} else {
|
||||
ingrouping = 1;
|
||||
ingrouping++;
|
||||
ptype = ePatternRegex;
|
||||
STORE("(", dptr, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -295,7 +289,7 @@ static pattern_t convert_aaregex_to_pcre(const char *aare, int anchor,
|
||||
/* { is a PCRE special character */
|
||||
STORE("\\}", dptr, 2);
|
||||
} else {
|
||||
if (ingrouping <= 1) {
|
||||
if (ingrouping < 1) {
|
||||
|
||||
error = e_parse_error;
|
||||
|
||||
@@ -310,7 +304,7 @@ static pattern_t convert_aaregex_to_pcre(const char *aare, int anchor,
|
||||
progname);
|
||||
}
|
||||
} else { /* ingrouping > 1 */
|
||||
ingrouping = 0;
|
||||
ingrouping--;
|
||||
STORE(")", dptr, 1);
|
||||
}
|
||||
} /* bEscape */
|
||||
@@ -326,7 +320,7 @@ static pattern_t convert_aaregex_to_pcre(const char *aare, int anchor,
|
||||
STORE(sptr, dptr, 1);
|
||||
} else {
|
||||
if (ingrouping) {
|
||||
++ingrouping;
|
||||
// ++ingrouping;
|
||||
STORE("|", dptr, 1);
|
||||
} else {
|
||||
STORE(sptr, dptr, 1);
|
||||
@@ -588,10 +582,11 @@ int post_process_entries(struct codomain *cod)
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern void p_node_count(void);
|
||||
|
||||
int process_regex(struct codomain *cod)
|
||||
{
|
||||
int error = -1;
|
||||
|
||||
if (regex_type == AARE_DFA) {
|
||||
cod->dfarules = aare_new_ruleset(0);
|
||||
if (!cod->dfarules)
|
||||
@@ -601,6 +596,7 @@ int process_regex(struct codomain *cod)
|
||||
goto out;
|
||||
|
||||
if (regex_type == AARE_DFA && cod->dfarule_count > 0) {
|
||||
|
||||
cod->dfa = aare_create_dfa(cod->dfarules, 0, &cod->dfa_size);
|
||||
aare_delete_ruleset(cod->dfarules);
|
||||
cod->dfarules = NULL;
|
||||
|
Reference in New Issue
Block a user