summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Linton <jeremy.linton@arm.com>2017-04-12 22:26:30 -0500
committerRay Strode <rstrode@redhat.com>2018-03-29 09:34:11 -0400
commit467dbe6d0a55325f28d7aea45615f07a5096a396 (patch)
treea5049a307b1484ad1c609daa7d7ea1cc098e6158
parent85c38f3630687e3957e626f762861fb30897c6ec (diff)
downloadpolkit-mozjs52.tar.gz
test: Add a test case to handle actions without explicit rulesmozjs52
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@arm.com>
-rw-r--r--test/polkitbackend/test-polkitbackendjsauthority.c8
1 files changed, 8 insertions, 0 deletions
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