[apparmor] [PATCH 3/5] parser: Test dbus eavesdrop rule parsing

Tyler Hicks tyhicks at canonical.com
Wed Nov 20 02:16:23 UTC 2013


Make the dbus rule generator knowledgeable of the eavesdrop permission.

Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
---
 parser/tst/gen-dbus.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/parser/tst/gen-dbus.pl b/parser/tst/gen-dbus.pl
index a5fc2b4..1fe5810 100755
--- a/parser/tst/gen-dbus.pl
+++ b/parser/tst/gen-dbus.pl
@@ -49,11 +49,15 @@ gen_files("message-rules", "PASS", \@quantifier, \@msg_perms, \@session,
 	  [""], \@path, \@interface, \@member, \@peer);
 gen_files("service-rules", "PASS", \@quantifier, ["bind"], \@session,
 	  \@name, [""], [""], [""], [""]);
+gen_files("eavesdrop-rules", "PASS", \@quantifier, ["eavesdrop"], \@session,
+	  [""], [""], [""], [""], [""]);
 gen_file("sloppy-formatting", "PASS", "", "(send , receive )", "bus=session",
 	 "", "path =\"/foo/bar\"", "interface = com.foo", "  member=bar",
 	 "peer =(   label= /usr/bin/app name  =\"com.foo\")");
 gen_file("sloppy-formatting", "PASS", "", "bind", "bus =session",
 	 "name= com.foo", "", "", "", "");
+gen_file("sloppy-formatting", "PASS", "", "eavesdrop", "bus = system",
+	 "", "", "", "", "");
 
 # Don't use the first element, which is empty, from each array since all empty
 # conditionals would PASS but we want all FAILs
@@ -73,6 +77,8 @@ gen_files("service-incompat", "FAIL", \@quantifier, ["bind"], \@session,
 	  \@name, [""], [""], \@member, [""]);
 gen_files("service-incompat", "FAIL", \@quantifier, ["bind"], \@session,
 	  \@name, [""], [""], [""], \@peer);
+gen_files("eavesdrop-incompat", "FAIL", \@quantifier, ["eavesdrop"], \@session,
+	  \@name, \@path, \@interface, \@member, \@peer);
 
 gen_files("pairing-unsupported", "FAIL", \@quantifier, ["send", "bind"],
 	  \@session, ["name=sn", "label=sl"], [""], [""], [""],
-- 
1.8.3.2




More information about the AppArmor mailing list