summaryrefslogtreecommitdiffstats
path: root/polkit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-12 15:20:51 +0100
committerColin Guthrie <colin@mageia.org>2013-10-12 15:26:23 +0100
commitcae1f59f7459a136cf52ae3a868b8733ef8c0e80 (patch)
treebc16410a5ae43825ccd734d2baef8d9732a52e41 /polkit
parentc61197a3984f8975fa9fd9a3f0cabe05206c1cb9 (diff)
downloadmgaonline-cae1f59f7459a136cf52ae3a868b8733ef8c0e80.tar
mgaonline-cae1f59f7459a136cf52ae3a868b8733ef8c0e80.tar.gz
mgaonline-cae1f59f7459a136cf52ae3a868b8733ef8c0e80.tar.bz2
mgaonline-cae1f59f7459a136cf52ae3a868b8733ef8c0e80.tar.xz
mgaonline-cae1f59f7459a136cf52ae3a868b8733ef8c0e80.zip
Use polkit for authorisation (mga#11125)
Diffstat (limited to 'polkit')
-rw-r--r--polkit/Makefile24
-rw-r--r--polkit/org.mageia.mgaapplet-config.policy.in22
-rw-r--r--polkit/org.mageia.mgaapplet-upgrade-helper.policy.in22
-rw-r--r--polkit/org.mageia.mgaupdate.policy.in22
4 files changed, 90 insertions, 0 deletions
diff --git a/polkit/Makefile b/polkit/Makefile
new file mode 100644
index 00000000..a8b5a51d
--- /dev/null
+++ b/polkit/Makefile
@@ -0,0 +1,24 @@
+BINDIR = /usr/bin
+LIBEXECDIR = /usr/libexec
+BINDEST = $(PREFIX)$(BINDIR)
+POLKITPOLICYDEST = $(PREFIX)/usr/share/polkit-1/actions
+
+POLICY_IN := $(wildcard *.policy.in)
+POLICY = $(POLICY_IN:.policy.in=.policy)
+WRAPPERS = $(patsubst org.mageia.%.policy,%,$(POLICY))
+
+all: $(WRAPPERS) $(POLICY)
+
+clean:
+ rm -f $(WRAPPERS) $(POLICY)
+
+%: org.mageia.%.policy.in
+ @echo -e "#!/bin/sh\nexec $(BINDIR)/pkexec $(LIBEXECDIR)/$@ $$""*" > $@
+
+%.policy: %.policy.in
+ intltool-merge --utf8 ../po $< $@ -x -u -c ../po/.intltool-merge-cache
+
+install: all
+ install -d $(BINDEST) $(POLKITPOLICYDEST)
+ install -m755 $(WRAPPERS) $(BINDEST)
+ install -m644 $(POLICY) $(POLKITPOLICYDEST)
diff --git a/polkit/org.mageia.mgaapplet-config.policy.in b/polkit/org.mageia.mgaapplet-config.policy.in
new file mode 100644
index 00000000..750d00c3
--- /dev/null
+++ b/polkit/org.mageia.mgaapplet-config.policy.in
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.mgaapplet-config.pkexec.run">
+ <_description>Run Mageia Update Applet Configuration</_description>
+ <_message>Authentication is required to run Mageia Update Applet Configuration</_message>
+ <icon_name>drakconf</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/mgaapplet-config</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/polkit/org.mageia.mgaapplet-upgrade-helper.policy.in b/polkit/org.mageia.mgaapplet-upgrade-helper.policy.in
new file mode 100644
index 00000000..2729e154
--- /dev/null
+++ b/polkit/org.mageia.mgaapplet-upgrade-helper.policy.in
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.mgaapplet-upgrade-helper.pkexec.run">
+ <_description>Run Mageia Upgrade Helper</_description>
+ <_message>Authentication is required to run Mageia Upgrade Helper</_message>
+ <icon_name>drakconf</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/mgaapplet-upgrade-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/polkit/org.mageia.mgaupdate.policy.in b/polkit/org.mageia.mgaupdate.policy.in
new file mode 100644
index 00000000..1994a378
--- /dev/null
+++ b/polkit/org.mageia.mgaupdate.policy.in
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.mgaupdate.pkexec.run">
+ <_description>Run Mageia Updater</_description>
+ <_message>Authentication is required to run Mageia Updater</_message>
+ <icon_name>drakconf</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/mgaupdate</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>