diff options
author | David Zeuthen <davidz@redhat.com> | 2012-05-21 12:15:10 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2012-05-21 12:15:10 -0400 |
commit | bbf0ea5fff7e397e6170f280ca7e8f4d3d596934 (patch) | |
tree | 8556f257bda653e1f99ba51d32c433deab04c242 /src | |
parent | cc039fe06d0905732bfa12cb5dd245c5535185ad (diff) | |
download | polkit-bbf0ea5fff7e397e6170f280ca7e8f4d3d596934.tar.gz |
Add test cases for evaluation order
In fact, this test uncovered that we were evaluating the rules in the
wrong order. Fix this.
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/polkitbackend/init.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/polkitbackend/init.js b/src/polkitbackend/init.js index cf6a65d..0e8bcfb 100644 --- a/src/polkitbackend/init.js +++ b/src/polkitbackend/init.js @@ -45,7 +45,7 @@ polkit._adminRuleFuncs = []; polkit.addAdminRule = function(callback) {this._adminRuleFuncs.push(callback);}; polkit._runAdminRules = function(action, subject, details) { var ret = null; - for (var n = this._adminRuleFuncs.length - 1; n >= 0; n--) { + for (var n = 0; n < this._adminRuleFuncs.length; n++) { var func = this._adminRuleFuncs[n]; var func_ret = func(action, subject, details); if (func_ret) { @@ -60,7 +60,7 @@ polkit._ruleFuncs = []; polkit.addRule = function(callback) {this._ruleFuncs.push(callback);}; polkit._runRules = function(action, subject, details) { var ret = null; - for (var n = this._ruleFuncs.length - 1; n >= 0; n--) { + for (var n = 0; n < this._ruleFuncs.length; n++) { var func = this._ruleFuncs[n]; var func_ret = func(action, subject, details); if (func_ret) { |