From 7dd61b9ccf44a4811ae1257d9ff4fecfd40894bd Mon Sep 17 00:00:00 2001 From: Jan Rybar Date: Tue, 13 Apr 2021 16:56:11 +0000 Subject: Revert "Merge branch 'pwithnall/polkit-51-usr-local-share-is-my-homeboy' into 'master'" This reverts merge request !75 --- test/data/etc/polkit-1/rules.d/15-testing.rules | 6 --- .../local/share/polkit-1/rules.d/10-testing.rules | 24 ------------ .../local/share/polkit-1/rules.d/25-testing.rules | 39 -------------------- .../usr/share/polkit-1/rules.d/10-testing.rules | 6 --- .../usr/share/polkit-1/rules.d/20-testing.rules | 12 ------ test/polkitbackend/test-polkitbackendjsauthority.c | 43 ++++++---------------- 6 files changed, 12 insertions(+), 118 deletions(-) delete mode 100644 test/data/usr/local/share/polkit-1/rules.d/10-testing.rules delete mode 100644 test/data/usr/local/share/polkit-1/rules.d/25-testing.rules (limited to 'test') diff --git a/test/data/etc/polkit-1/rules.d/15-testing.rules b/test/data/etc/polkit-1/rules.d/15-testing.rules index b1ae6dd..00e214b 100644 --- a/test/data/etc/polkit-1/rules.d/15-testing.rules +++ b/test/data/etc/polkit-1/rules.d/15-testing.rules @@ -16,12 +16,6 @@ polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) { if (action.id == "net.company.order2") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order3") { return polkit.Result.YES; } }); diff --git a/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules b/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules deleted file mode 100644 index cf3cf26..0000000 --- a/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ - -/* see test/polkitbackend/test-polkitbackendjsauthority.c */ - -/* NOTE: this is the /usr/local/share/polkit-1/rules.d version of 10-testing.rules */ - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order0") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order1") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order2") { - return polkit.Result.YES; - } -}); - diff --git a/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules b/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules deleted file mode 100644 index df373b6..0000000 --- a/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ - -/* see test/polkitbackend/test-polkitbackendjsauthority.c */ - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order0") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order1") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order2") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order3") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order4") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order5") { - return polkit.Result.NO; // earlier rule should win - } -}); diff --git a/test/data/usr/share/polkit-1/rules.d/10-testing.rules b/test/data/usr/share/polkit-1/rules.d/10-testing.rules index 5650945..1d553f6 100644 --- a/test/data/usr/share/polkit-1/rules.d/10-testing.rules +++ b/test/data/usr/share/polkit-1/rules.d/10-testing.rules @@ -12,12 +12,6 @@ polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) { if (action.id == "net.company.order1") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order2") { return polkit.Result.YES; } }); diff --git a/test/data/usr/share/polkit-1/rules.d/20-testing.rules b/test/data/usr/share/polkit-1/rules.d/20-testing.rules index 802577f..071f135 100644 --- a/test/data/usr/share/polkit-1/rules.d/20-testing.rules +++ b/test/data/usr/share/polkit-1/rules.d/20-testing.rules @@ -19,15 +19,3 @@ polkit.addRule(function(action, subject) { return polkit.Result.NO; // earlier rule should win } }); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order3") { - return polkit.Result.NO; // earlier rule should win - } -}); - -polkit.addRule(function(action, subject) { - if (action.id == "net.company.order4") { - return polkit.Result.YES; - } -}); diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c index 240c69c..f97e0e0 100644 --- a/test/polkitbackend/test-polkitbackendjsauthority.c +++ b/test/polkitbackend/test-polkitbackendjsauthority.c @@ -40,13 +40,12 @@ static PolkitBackendJsAuthority *get_authority (void); static PolkitBackendJsAuthority * get_authority (void) { - gchar *rules_dirs[4] = {0}; + gchar *rules_dirs[3] = {0}; PolkitBackendJsAuthority *authority; rules_dirs[0] = polkit_test_get_data_path ("etc/polkit-1/rules.d"); - rules_dirs[1] = polkit_test_get_data_path ("usr/local/share/polkit-1/rules.d"); - rules_dirs[2] = polkit_test_get_data_path ("usr/share/polkit-1/rules.d"); - rules_dirs[3] = NULL; + rules_dirs[1] = polkit_test_get_data_path ("usr/share/polkit-1/rules.d"); + rules_dirs[2] = NULL; g_assert (rules_dirs[0] != NULL); g_assert (rules_dirs[1] != NULL); @@ -183,7 +182,7 @@ static const RulesTestCase rules_test_cases[] = { NULL, POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED, }, - /* actions without explicit rules aren't automatically NOT_AUTHORIZED */ + /* actions without explict rules aren't automatically NOT_AUTHORIZED */ { "basic2", "net.company.productA.action2", @@ -192,20 +191,18 @@ static const RulesTestCase rules_test_cases[] = { POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN, }, - /* Ordering tests ... we have six rules files, check they are + /* Ordering tests ... we have four rules files, check they are * evaluated in order by checking the detail set by each rules * - * - etc/polkit-1/rules.d/10-testing.rules (file a) - * - usr/local/share/polkit-1/rules.d/10-testing.rules (file b) - * - usr/share/polkit-1/rules.d/10-testing.rules (file c) - * - etc/polkit-1/rules.d/15-testing.rules (file d) - * - usr/share/polkit-1/rules.d/20-testing.rules (file e) - * - usr/local/share/polkit-1/rules.d/25-testing.rules (file f) + * - etc/polkit-1/rules.d/10-testing.rules (file a) + * - usr/share/polkit-1/rules.d/10-testing.rules (file b) + * - etc/polkit-1/rules.d/15-testing.rules (file c) + * - usr/share/polkit-1/rules.d/20-testing.rules (file d) * * file. */ { - /* defined in file a, b, c, d, e, f - should pick file a */ + /* defined in file a, b, c, d - should pick file a */ "order0", "net.company.order0", "unix-user:root", @@ -213,7 +210,7 @@ static const RulesTestCase rules_test_cases[] = { POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED, }, { - /* defined in file b, c, d, e, f - should pick file b */ + /* defined in file b, c, d - should pick file b */ "order1", "net.company.order1", "unix-user:root", @@ -221,29 +218,13 @@ static const RulesTestCase rules_test_cases[] = { POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED, }, { - /* defined in file c, d, e, f - should pick file c */ + /* defined in file c, d - should pick file c */ "order2", "net.company.order2", "unix-user:root", NULL, POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED, }, - { - /* defined in file d, e, f - should pick file d */ - "order3", - "net.company.order3", - "unix-user:root", - NULL, - POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED, - }, - { - /* defined in file e, f - should pick file e */ - "order4", - "net.company.order4", - "unix-user:root", - NULL, - POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED, - }, /* variables */ { -- cgit v1.2.1