Re: [apparmor] [patch 7/8] parser - add build option for coverage

2013-12-03 Thread Steve Beattie
On Wed, Nov 27, 2013 at 06:10:43PM -0800, Seth Arnold wrote: On Wed, Oct 23, 2013 at 06:41:51PM -0700, Steve Beattie wrote: This patch adds a parser make variable and a make target for building the compiler with coverage compilation flags. With this, coverage information can be generated by

[apparmor] [patch 05/12] parser: fix alternation expansions that occur inside character classes

2013-12-03 Thread Steve Beattie
The parser was converting alternation characters ('{', '}', and ',') to their pcre versions ('(', ')', and '|', respectively) that occurred inside of character class patterns (i.e. inside '[ ]'). This patch fixes the issue and adds a few unit tests around character classes. Signed-off-by: Steve

[apparmor] [patch 03/12] parser: give warning for unnecessary quote characters

2013-12-03 Thread Steve Beattie
This patch adds a warning when quote characters '\' are added unnecessarily, generates an error when a single quote is the last character in a pattern, and uncomments and corrects the relevant unit test cases. Signed-off-by: Steve Beattie st...@nxnw.org --- parser/parser_regex.c | 18

[apparmor] [patch 00/12] miscellaneous parser fixes, tests, and documentation

2013-12-03 Thread Steve Beattie
This patch series adds a variety of things to (mostly) the parser tree: - adds a coverage build option (patch v2) - marks the valgrind test target as phony in make - addresses unnecessary single quotes when in regexes - fixes issues with alternation characters in character classes -

[apparmor] [patch 06/12] parser: fix /proc version file read

2013-12-03 Thread Steve Beattie
The parser was not checking for an error when reading from /proc/sys/kernel/osrelease. Additionally, valgrind was complaining because of the uninitialized space in the buffer in between where the read(2) had deposited its data and where the parser was writing a trailing NUL to close the string.

[apparmor] [patch 08/12] parser: add test case for empty character class regex

2013-12-03 Thread Steve Beattie
This patch adds a test that verifies the parser considers an emty character class regex as a parse arror. Signed-off-by: Steve Beattie st...@nxnw.org --- parser/tst/simple_tests/file/bad_re_brace_1.sd |8 1 file changed, 8 insertions(+) Index:

[apparmor] [patch 11/12] parser: add some developer documentation

2013-12-03 Thread Steve Beattie
Signed-off-by: Steve Beattie st...@nxnw.org --- parser/README.devel | 94 1 file changed, 94 insertions(+) Index: b/parser/README.devel === --- /dev/null +++

[apparmor] [patch 09/12] parser: more dbus variable testcases (v2)

2013-12-03 Thread Steve Beattie
This patch adds more testcases around variables used in dbus rules. In particular, it - attempts to verify that variable expansion and alternation expansion results in identical DFA blobs, - tests that variables can be expanded within alternations, - tests that alternations can occur in

[apparmor] [patch 02/12] parser: mark valgrind test target as phony

2013-12-03 Thread Steve Beattie
Signed-off-by: Steve Beattie st...@nxnw.org --- parser/tst/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: b/parser/tst/Makefile === --- a/parser/tst/Makefile +++ b/parser/tst/Makefile @@ -13,7 +13,7 @@

[apparmor] [patch 07/12] parser: fix rlimit missing initializer warning

2013-12-03 Thread Steve Beattie
When compiling the parser, g++ currently emits warnings like so: profile.h: In constructor ‘Profile::Profile()’: profile.h:177:11: warning: missing initializer for member ‘aa_rlimits::limits’ [-Wmissing-field-initializers] rlimits = { 0 }; ^ This patch fixes the

[apparmor] [patch 01/12] parser: add build option for coverage (v3)

2013-12-03 Thread Steve Beattie
This patch adds a parser make variable and a make target for building the compiler with coverage compilation flags. With this, coverage information can be generated by running tests/test suites against the built parser and run through tools like gcovr. Patch History: v1: initial version v2:

[apparmor] [patch 04/12] parser: add more convert_aaregex_to_pcre() unit tests

2013-12-03 Thread Steve Beattie
Signed-off-by: Steve Beattie st...@nxnw.org --- parser/parser_regex.c | 31 +++ 1 file changed, 31 insertions(+) Index: b/parser/parser_regex.c === --- a/parser/parser_regex.c +++

[apparmor] [patch 10/12] parser: add basic alternation tests, along with their file and owner equivalents. (v2)

2013-12-03 Thread Steve Beattie
This patch verifies basic alternation usage. Patch history: v1: initial revision v2: mark nested alternation tests as passing, as it was deemed a bug that the parser didn't support them. Signed-off-by: Steve Beattie st...@nxnw.org ---

[apparmor] [patch 12/12] regression tests: fix introspect.c compiler warnings

2013-12-03 Thread Steve Beattie
This patch annotates that a couple of values emitted on failure are of type size_t, eliminating a couple of compiler warnings. Signed-off-by: Steve Beattie st...@nxnw.org --- tests/regression/apparmor/introspect.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index:

Re: [apparmor] [patch 12/12] regression tests: fix introspect.c compiler warnings

2013-12-03 Thread Tyler Hicks
On 2013-12-03 12:12:28, Steve Beattie wrote: This patch annotates that a couple of values emitted on failure are of type size_t, eliminating a couple of compiler warnings. Signed-off-by: Steve Beattie st...@nxnw.org Acked-by: Tyler Hicks tyhi...@canonical.com ---

Re: [apparmor] [patch 02/12] parser: mark valgrind test target as phony

2013-12-03 Thread Christian Boltz
Hello, Am Dienstag, 3. Dezember 2013 schrieb Steve Beattie: Signed-off-by: Steve Beattie st...@nxnw.org --- parser/tst/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: b/parser/tst/Makefile === ---

Re: [apparmor] [patch 08/12] parser: add test case for empty character class regex

2013-12-03 Thread Christian Boltz
Hello, Am Dienstag, 3. Dezember 2013 schrieb Steve Beattie: This patch adds a test that verifies the parser considers an emty character class regex as a parse arror. Signed-off-by: Steve Beattie st...@nxnw.org --- parser/tst/simple_tests/file/bad_re_brace_1.sd |8 1 file

Re: [apparmor] [patch 10/12] parser: add basic alternation tests, along with their file and owner equivalents. (v2)

2013-12-03 Thread Christian Boltz
Hello, Am Dienstag, 3. Dezember 2013 schrieb Steve Beattie: This patch verifies basic alternation usage. Patch history: v1: initial revision v2: mark nested alternation tests as passing, as it was deemed a bug that the parser didn't support them. Signed-off-by: Steve Beattie