[apparmor] Whitespace problems with the newly added simple_tests

Christian Boltz apparmor at cboltz.de
Sat Jul 11 21:11:03 UTC 2015


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?

> > 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).



[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
-- 
Ich habe das Gefühl, dass dem DiskDruid der Zaubertrank gestohlen
wurde und der so verrückt partitoniert bzw. Mountpoints zuordnet,
dass man den bis auf weiteres besser in eine Ausnüchterungszelle
steckt. Für professionelle / komplexe Partionierung ist das Ding
nicht zu gebrauchen. [Al Bogner in suse-linux]




More information about the AppArmor mailing list