[apparmor] [patch 4/5] parser - add basic alternation tests, along with their file and owner equivalents.

John Johansen john.johansen at canonical.com
Thu Sep 5 09:42:30 UTC 2013


On 09/05/2013 01:18 AM, Steve Beattie wrote:
> This patch verifies basic alternation usage as well as verifying that
> nested alternations aren't allowed by the parser.
> 
why? should we fix this bug?

> Signed-off-by: Steve Beattie <steve at nxnw.org>
> ---
>  parser/tst/simple_tests/file/bad_alternations_1.sd       |    7 +++++++
>  parser/tst/simple_tests/file/file/bad_alternations_1.sd  |    7 +++++++
>  parser/tst/simple_tests/file/file/ok_alternations_1.sd   |    7 +++++++
>  parser/tst/simple_tests/file/ok_alternations_1.sd        |    7 +++++++
>  parser/tst/simple_tests/file/owner/bad_alternations_1.sd |    7 +++++++
>  parser/tst/simple_tests/file/owner/ok_alternations_1.sd  |    7 +++++++
>  6 files changed, 42 insertions(+)
> 
> Index: b/parser/tst/simple_tests/file/bad_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/bad_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/nested alternations
> +#=EXRESULT FAIL
> +#
> +/usr/bin/foo {
> +  /a/b/c/**{cache,data,download,/ext,file{admin,s},images,joomla,moodledata/sessions}/** rw,
> +}
> Index: b/parser/tst/simple_tests/file/file/ok_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/file/ok_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/alternations
> +#=EXRESULT PASS
> +#
> +/usr/bin/foo {
> +  file /a/b/c/**{cache,data,download,/ext,fileadmin,files,images,joomla,moodledata/sessions}/** rw,
> +}
> Index: b/parser/tst/simple_tests/file/ok_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/ok_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/alternations
> +#=EXRESULT PASS
> +#
> +/usr/bin/foo {
> +  /a/b/c/**{cache,data,download,/ext,fileadmin,files,images,joomla,moodledata/sessions}/** rw,
> +}
> Index: b/parser/tst/simple_tests/file/file/bad_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/file/bad_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/nested alternations
> +#=EXRESULT FAIL
> +#
> +/usr/bin/foo {
> +  file /a/b/c/**{cache,data,download,/ext,file{admin,s},images,joomla,moodledata/sessions}/** rw,
> +}
> Index: b/parser/tst/simple_tests/file/owner/bad_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/owner/bad_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/nested alternations
> +#=EXRESULT FAIL
> +#
> +/usr/bin/foo {
> +  owner /a/b/c/**{cache,data,download,/ext,file{admin,s},images,joomla,moodledata/sessions}/** rw,
> +}
> Index: b/parser/tst/simple_tests/file/owner/ok_alternations_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/file/owner/ok_alternations_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=Description basic file rule w/alternations
> +#=EXRESULT PASS
> +#
> +/usr/bin/foo {
> +  owner /a/b/c/**{cache,data,download,/ext,fileadmin,files,images,joomla,moodledata/sessions}/** rw,
> +}
> 
> 
> -- AppArmor mailing list AppArmor at lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 




More information about the AppArmor mailing list