diff --git a/policycoreutils/mcstrans/src/mcstrans.c b/policycoreutils/mcstrans/src/mcstrans.c index 4d31857..00747a6 100644 --- a/policycoreutils/mcstrans/src/mcstrans.c +++ b/policycoreutils/mcstrans/src/mcstrans.c @@ -719,9 +719,9 @@ static int read_translations(const char *filename); Remove white space and set raw do data before the "=" and tok to data after it Modifies the data pointed to by the buffer parameter */ +static domain_t *localdomain; static int process_trans(char *buffer) { - static domain_t *domain; static word_group_t *group; static int base_classification; static int lineno = 0; @@ -776,14 +776,14 @@ process_trans(char *buffer) { } if (!strcmp(raw, "Domain")) { - domain = create_domain(tok); + localdomain = create_domain(tok); group = NULL; return 0; } - if (!domain) { - domain = create_domain("Default"); - if (!domain) + if (!localdomain) { + localdomain = create_domain("Default"); + if (!localdomain) return -1; group = NULL; } @@ -814,7 +814,7 @@ process_trans(char *buffer) { } else if (!strcmp(raw, "Base")) { base_classification = 1; } else if (!strcmp(raw, "ModifierGroup")) { - group = create_group(&domain->groups, tok); + group = create_group(&localdomain->groups, tok); if (!group) return -1; base_classification = 0; @@ -844,12 +844,12 @@ process_trans(char *buffer) { } } else { if (base_classification) { - if (add_base_classification(domain, raw, tok) < 0) { + if (add_base_classification(localdomain, raw, tok) < 0) { syslog(LOG_ERR, "unable to add base_classification on line %d", lineno); return -1; } } - if (add_cache(domain, raw, tok) < 0) + if (add_cache(localdomain, raw, tok) < 0) return -1; } return 0; @@ -1758,5 +1758,6 @@ finish_context_translations(void) { destroy_cat_constraint(&cat_constraints, cat_constraints); cat_constraints = next; } + localdomain = NULL; }