[PATCH v3 2/2] test: Add a test case to handle actions without explicit rules

Jeremy Linton jeremy.linton at arm.com
Thu Apr 13 03:26:30 UTC 2017


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 <jeremy.linton at arm.com>
---
 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
-- 
2.11.0



More information about the polkit-devel mailing list