aboutsummaryrefslogtreecommitdiffstats
path: root/polkit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-12 16:05:27 +0100
committerColin Guthrie <colin@mageia.org>2013-10-12 16:11:06 +0100
commit9cbfa48073b47148a42b65c729423e873488c39c (patch)
tree07392e40822f14e523c2e17925aaa721156d7d5b /polkit
parent43a9cc31a1d26614f0d7af0915588fd7c121fcfa (diff)
downloaduserdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.gz
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.bz2
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.xz
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.zip
Use polkit for authorisation (mga#11125)
Diffstat (limited to 'polkit')
-rw-r--r--polkit/Makefile24
-rw-r--r--polkit/org.mageia.drakuser.policy.in22
2 files changed, 46 insertions, 0 deletions
diff --git a/polkit/Makefile b/polkit/Makefile
new file mode 100644
index 0000000..a8b5a51
--- /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.drakuser.policy.in b/polkit/org.mageia.drakuser.policy.in
new file mode 100644
index 0000000..4aee6b8
--- /dev/null
+++ b/polkit/org.mageia.drakuser.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.drakuser.pkexec.run">
+ <_description>Run Mageia User Manager</_description>
+ <_message>Authentication is required to run Mageia User Manager</_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/drakuser</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>