summaryrefslogtreecommitdiffstats
path: root/polkit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-12 16:47:43 +0100
committerColin Guthrie <colin@mageia.org>2013-10-12 17:44:09 +0100
commiteb8f6e900feccc2b7667289135f821438717ec8c (patch)
tree8f55d31bb65192ca7d56190aaf61f29eec6bed4f /polkit
parent6c4ae17acfb5159eeac92b92fdca112ca2ede4ec (diff)
downloadurpmi-eb8f6e900feccc2b7667289135f821438717ec8c.tar
urpmi-eb8f6e900feccc2b7667289135f821438717ec8c.tar.gz
urpmi-eb8f6e900feccc2b7667289135f821438717ec8c.tar.bz2
urpmi-eb8f6e900feccc2b7667289135f821438717ec8c.tar.xz
urpmi-eb8f6e900feccc2b7667289135f821438717ec8c.zip
Use polkit for authorisation (mga#11125)
Diffstat (limited to 'polkit')
-rw-r--r--polkit/Makefile24
-rw-r--r--polkit/org.mageia.gurpmi2.policy.in22
-rw-r--r--polkit/org.mageia.urpmi.update.policy.in22
3 files changed, 68 insertions, 0 deletions
diff --git a/polkit/Makefile b/polkit/Makefile
new file mode 100644
index 00000000..34e81069
--- /dev/null
+++ b/polkit/Makefile
@@ -0,0 +1,24 @@
+BINDIR = /usr/bin
+LIBEXECDIR = /usr/libexec
+BINDEST = $(DESTDIR)$(BINDIR)
+POLKITPOLICYDEST = $(DESTDIR)/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.gurpmi2.policy.in b/polkit/org.mageia.gurpmi2.policy.in
new file mode 100644
index 00000000..4768e142
--- /dev/null
+++ b/polkit/org.mageia.gurpmi2.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.gurpmi2.pkexec.run">
+ <_description>Run Mageia Package Installer</_description>
+ <_message>Authentication is required to run Mageia Package Installer</_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/gurpmi2</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/polkit/org.mageia.urpmi.update.policy.in b/polkit/org.mageia.urpmi.update.policy.in
new file mode 100644
index 00000000..dabef903
--- /dev/null
+++ b/polkit/org.mageia.urpmi.update.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.urpmi.update.pkexec.run">
+ <_description>Run Mageia Package Media Updater</_description>
+ <_message>Authentication is required to run Mageia Package Media Updater</_message>
+ <icon_name>drakconf</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/urpmi.update</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>