[apparmor] Whitespace problems with the newly added simple_tests
John Johansen
john.johansen at canonical.com
Sat Jul 11 21:49:59 UTC 2015
On 07/11/2015 02:11 PM, Christian Boltz wrote:
> Hello,
>
> Am Samstag, 11. Juli 2015 schrieb John Johansen:
>> On 07/11/2015 09:07 AM, Christian Boltz wrote:
>>> some of the newly added simple_tests with variables in the profile
>>> or
>>> child profile name let the tools fail because of missing \n. The
>>>
>>> problematic lines look like this:
>>> profile foo@{FOO} { }
>>>
>>> The problem is that { and } are in the same line, while the tools
>>> expect rules to be \n-separated. [1]
>>
>> that would be a bug in the tools
>
> I know, but I'm not sure
> a) how difficult it would be to fix (all our regexes end with "$")
> b) if we want to fix it at all - an advantage of this bug is that it
> enforces readable profiles ;-)
> c) if this is a real-world problem - are there really people out there
> who want to have multiple rules in one line?
>
I've seen and used it extensively myself during dev and testing but I'm
not sure that use counts as real world.
I think the reverse is far more common where some of the bigger rules
are broken up over multiple lines.
It is certainly not a critical bug or something I would worry about
fixing atm
>>> Would a patch to change those tests to
>>>
>>> profile foo@{FOO} {
>>> }
>>>
>>> be ok?
>>
>> that is fine, it doesn't change what the test is trying to achieve
>
> OK, here's the patch to do that (not needed for 2.10, so feel free to
> do the release before accepting this patch).
>
>
Acked-by: John Johansen <john.johansen at canonical.com>
>
> [patch] replace some spaces with newline in simple_tests
>
> Some of the newly added simple_tests contain lines like
> profile foo@{FOO} { }
> which are not supported by the tools because the '}' is in the same line,
> while the tools expect \n as rule separator.
>
> This patch changes those tests to
> profile foo@{FOO} {
> }
>
>
> [ simple_tests-newline.diff ]
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_16.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_16.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_16.sd 2015-07-11 20:00:37 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - profile foo@{FOO} { }
> + profile foo@{FOO} {
> + }
> }
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_17.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_17.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_17.sd 2015-07-11 20:01:11 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - profile @{FOO} { }
> + profile @{FOO} {
> + }
> }
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_18.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_18.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_18.sd 2015-07-11 20:01:01 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - ^foo@{FOO} { }
> + ^foo@{FOO} {
> + }
> }
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_19.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_19.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_19.sd 2015-07-11 20:01:37 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - profile @{FOO} { }
> + profile @{FOO} {
> + }
> }
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_20.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_20.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_20.sd 2015-07-11 20:00:49 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - profile foo@{FOO} { }
> + profile foo@{FOO} {
> + }
> }
>
> === modified file 'parser/tst/simple_tests/vars/vars_profile_name_21.sd'
> --- parser/tst/simple_tests/vars/vars_profile_name_21.sd 2015-07-11 01:11:17 +0000
> +++ parser/tst/simple_tests/vars/vars_profile_name_21.sd 2015-07-11 20:01:21 +0000
> @@ -4,5 +4,6 @@
> @{FOO}=bar
>
> profile /does/not/exist {
> - ^@{FOO} { }
> + ^@{FOO} {
> + }
> }
>
>
>
> Regards,
>
> Christian Boltz
>
More information about the AppArmor
mailing list