2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 13:58:22 +00:00

parser: Test dbus eavesdrop rule parsing

Make the dbus rule generator knowledgeable of the eavesdrop permission.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
Tyler Hicks 2013-12-06 11:18:48 -08:00
parent 99e509065f
commit d5ee5d0c65

View File

@ -49,11 +49,15 @@ gen_files("message-rules", "PASS", \@quantifier, \@msg_perms, \@session,
[""], \@path, \@interface, \@member, \@peer); [""], \@path, \@interface, \@member, \@peer);
gen_files("service-rules", "PASS", \@quantifier, ["bind"], \@session, gen_files("service-rules", "PASS", \@quantifier, ["bind"], \@session,
\@name, [""], [""], [""], [""]); \@name, [""], [""], [""], [""]);
gen_files("eavesdrop-rules", "PASS", \@quantifier, ["eavesdrop"], \@session,
[""], [""], [""], [""], [""]);
gen_file("sloppy-formatting", "PASS", "", "(send , receive )", "bus=session", gen_file("sloppy-formatting", "PASS", "", "(send , receive )", "bus=session",
"", "path =\"/foo/bar\"", "interface = com.foo", " member=bar", "", "path =\"/foo/bar\"", "interface = com.foo", " member=bar",
"peer =( label= /usr/bin/app name =\"com.foo\")"); "peer =( label= /usr/bin/app name =\"com.foo\")");
gen_file("sloppy-formatting", "PASS", "", "bind", "bus =session", gen_file("sloppy-formatting", "PASS", "", "bind", "bus =session",
"name= com.foo", "", "", "", ""); "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 # Don't use the first element, which is empty, from each array since all empty
# conditionals would PASS but we want all FAILs # conditionals would PASS but we want all FAILs
@ -73,6 +77,8 @@ gen_files("service-incompat", "FAIL", \@quantifier, ["bind"], \@session,
\@name, [""], [""], \@member, [""]); \@name, [""], [""], \@member, [""]);
gen_files("service-incompat", "FAIL", \@quantifier, ["bind"], \@session, gen_files("service-incompat", "FAIL", \@quantifier, ["bind"], \@session,
\@name, [""], [""], [""], \@peer); \@name, [""], [""], [""], \@peer);
gen_files("eavesdrop-incompat", "FAIL", \@quantifier, ["eavesdrop"], \@session,
\@name, \@path, \@interface, \@member, \@peer);
gen_files("pairing-unsupported", "FAIL", \@quantifier, ["send", "bind"], gen_files("pairing-unsupported", "FAIL", \@quantifier, ["send", "bind"],
\@session, ["name=sn", "label=sl"], [""], [""], [""], \@session, ["name=sn", "label=sl"], [""], [""], [""],