From bef6641eded53de9bf766f6e400e17ff17c3d52d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 20:25:51 +0100 Subject: [PATCH 31/33] fixup! containers test: Add a test for sending and receiving method calls Expand coverage for activation --- test/containers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/containers.c b/test/containers.c index 8075d38f..03d0161d 100644 --- a/test/containers.c +++ b/test/containers.c @@ -1191,6 +1191,19 @@ static const AllowRulesTest allow_rules_tests[] = "com.example.Unconfined", "/", DBUS_INTERFACE_PEER, "Ping", NULL, ALLOW_MESSAGE_FLAGS_NONE }, + /* That includes situations where we'd be auto-activating */ + { METHOD_RAISES_ACCESS_DENIED, + "com.example.SystemdActivatable1", "/", + DBUS_INTERFACE_PEER, "Ping", NULL, + ALLOW_MESSAGE_FLAGS_NONE }, + + /* Must not activate outside either */ + { METHOD_RAISES_ACCESS_DENIED, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, "StartServiceByName", + "com.example.Unconfined", ALLOW_MESSAGE_FLAGS_NONE }, + { METHOD_RAISES_ACCESS_DENIED, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, "StartServiceByName", + "com.example.SystemdActivatable1", ALLOW_MESSAGE_FLAGS_NONE }, /* Must not be able to request a well-known name */ { METHOD_RAISES_ACCESS_DENIED, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, -- 2.19.0.rc1