summaryrefslogtreecommitdiff
path: root/policy
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2013-05-28 14:34:59 +0100
committerRichard Hughes <richard@hughsie.com>2013-05-28 14:34:59 +0100
commitb78af414daf2176aac74540039b341a3e4e49412 (patch)
tree3e56db321608370b6675bfa26899ccf32369fb04 /policy
parent3eb921f2ddbe94dc5b180522b8aa5a057dd6eac2 (diff)
Allow local active users in the wheel group to install signed packages without a password
Diffstat (limited to 'policy')
-rw-r--r--policy/Makefile.am5
-rw-r--r--policy/org.freedesktop.packagekit.policy.in2
-rw-r--r--policy/org.freedesktop.packagekit.rules7
3 files changed, 13 insertions, 1 deletions
diff --git a/policy/Makefile.am b/policy/Makefile.am
index ebb7808d1..6babe3377 100644
--- a/policy/Makefile.am
+++ b/policy/Makefile.am
@@ -2,6 +2,11 @@
NULL =
if SECURITY_TYPE_POLKIT
+polkit_rulesdir = $(datadir)/polkit-1/rules.d
+dist_polkit_rules_DATA = \
+ org.freedesktop.packagekit.rules \
+ $(NULL)
+
polkit_policydir = $(datadir)/polkit-1/actions
dist_polkit_policy_DATA = \
org.freedesktop.packagekit.policy \
diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in
index 28ab3b141..19cdd2065 100644
--- a/policy/org.freedesktop.packagekit.policy.in
+++ b/policy/org.freedesktop.packagekit.policy.in
@@ -42,7 +42,7 @@
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
- <allow_active>yes</allow_active>
+ <allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
diff --git a/policy/org.freedesktop.packagekit.rules b/policy/org.freedesktop.packagekit.rules
new file mode 100644
index 000000000..6a1c8a701
--- /dev/null
+++ b/policy/org.freedesktop.packagekit.rules
@@ -0,0 +1,7 @@
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.packagekit.package-install" &&
+ subject.active == true && subject.local == true &&
+ subject.isInGroup("wheel")) {
+ return polkit.Result.YES;
+ }
+});