From 183d41dc67a14ed4f79fb7b5499eddbab553a6d1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 20:27:31 +0100 Subject: [PATCH 32/33] fixup! containers test: Add a test for sending and receiving method calls Expand test coverage for inspecting other connections These all raise NameHasNoOwner without checking whether we are allowed to inspect the other connection, because we are not even allowed to see the other connection. After implementing fd.o#105658, in an equivalent test where we are allowed to see the unconfined connection but not inspect it, they should raise AccessDenied. --- test/containers.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/containers.c b/test/containers.c index 03d0161d..203c2991 100644 --- a/test/containers.c +++ b/test/containers.c @@ -1088,6 +1088,14 @@ static const AllowRulesTest allow_rules_tests[] = DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetConnectionCredentials", REPLACE_WITH_UNCONFINED_UNIQUE_NAME, ALLOW_MESSAGE_FLAGS_NONE }, + { METHOD_RAISES_NAME_HAS_NO_OWNER, DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetConnectionCredentials", + "com.example.Unconfined", + ALLOW_MESSAGE_FLAGS_NONE }, + { METHOD_RAISES_NAME_HAS_NO_OWNER, DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetConnectionCredentials", + "com.example.SystemdActivatable1", + ALLOW_MESSAGE_FLAGS_NONE }, /* May call Peer methods on the dbus-daemon as our peer */ { METHOD_SUCCEEDS, -- 2.19.0.rc1