From 467dbe6d0a55325f28d7aea45615f07a5096a396 Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Wed, 12 Apr 2017 22:26:30 -0500 Subject: test: Add a test case to handle actions without explicit rules An implicit authorization parameter is provided to polkit_backend_js_authority_check_authorization_sync() for actions without corresponding explicit rules. Assure that is honored rather than simply being denied. Signed-off-by: Jeremy Linton --- test/polkitbackend/test-polkitbackendjsauthority.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c index dfb894f..84279b4 100644 --- a/test/polkitbackend/test-polkitbackendjsauthority.c +++ b/test/polkitbackend/test-polkitbackendjsauthority.c @@ -182,6 +182,14 @@ static const RulesTestCase rules_test_cases[] = { NULL, POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED, }, + /* actions without explict rules aren't automatically NOT_AUTHORIZED */ + { + "basic2", + "net.company.productA.action2", + "unix-user:john", + NULL, + POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN, + }, /* Ordering tests ... we have four rules files, check they are * evaluated in order by checking the detail set by each rules -- cgit v1.2.1