Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
libsepol/cil: Check for duplicate blocks, optionals, and macros
In CIL, blocks, optionals, and macros share the same symbol table so that the targets of "in" statements can be located. Because of this, they cannot have the same name in the same namespace, but, because they do not show up in the final policy, they can have the same name as long as they are in different namespaces. Unfortunately, when copying from one namespace to another, no check was being done to see if there was a conflict. When copying blocks, optionals, and macros, if a datum is found in the destination namespace, then there is a conflict with a previously declared block, optional, or macro, so exit with an error. Reported-by: Nicolas Iooss <nicolas.iooss@m4x.org> Reported-by: Evgeny Vereshchagin <evvers@ya.ru> Signed-off-by: James Carter <jwcart2@gmail.com>
- Loading branch information
Showing
1 changed file
with
25 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters