summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/polkit/org.mageia.draksec.rules
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-11-21 21:12:37 +0000
committerColin Guthrie <colin@mageia.org>2013-11-21 21:24:53 +0000
commit3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1 (patch)
treeefa80eca1b88a28fdb4e52deee5717e934a6f983 /perl-install/standalone/polkit/org.mageia.draksec.rules
parent7828203e308e62a47eac337a193d0fa1680b97d9 (diff)
downloaddrakx-3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1.tar
drakx-3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1.tar.gz
drakx-3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1.tar.bz2
drakx-3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1.tar.xz
drakx-3b641cb27c28bdf42865ee15f7ccd2b6c9e9d3d1.zip
polkit: Add support to draksec for writing polkit policy override rules.
This allows draksec to override things properly under polkit.
Diffstat (limited to 'perl-install/standalone/polkit/org.mageia.draksec.rules')
-rw-r--r--perl-install/standalone/polkit/org.mageia.draksec.rules11
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/standalone/polkit/org.mageia.draksec.rules b/perl-install/standalone/polkit/org.mageia.draksec.rules
new file mode 100644
index 000000000..45a7f0efe
--- /dev/null
+++ b/perl-install/standalone/polkit/org.mageia.draksec.rules
@@ -0,0 +1,11 @@
+polkit.addRule(function(action, subject) {
+ if (typeof drakToolAuth != "function" || action.id.indexOf("org.mageia.") != 0)
+ return polkit.Result.NOT_HANDLED;
+
+ var tool = action.id.split(".")[2];
+ var rv = drakToolAuth(tool);
+ if (rv != polkit.Result.NOT_HANDLED)
+ polkit.log("draksec security policy for '" + tool + "' is overriden to '" + rv + "'");
+ return rv;
+});
+