From cae1f59f7459a136cf52ae3a868b8733ef8c0e80 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 12 Oct 2013 15:20:51 +0100 Subject: Use polkit for authorisation (mga#11125) --- polkit/Makefile | 24 ++++++++++++++++++++++ polkit/org.mageia.mgaapplet-config.policy.in | 22 ++++++++++++++++++++ .../org.mageia.mgaapplet-upgrade-helper.policy.in | 22 ++++++++++++++++++++ polkit/org.mageia.mgaupdate.policy.in | 22 ++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 polkit/Makefile create mode 100644 polkit/org.mageia.mgaapplet-config.policy.in create mode 100644 polkit/org.mageia.mgaapplet-upgrade-helper.policy.in create mode 100644 polkit/org.mageia.mgaupdate.policy.in (limited to 'polkit') 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 @@ + + + + + Mageia + http://www.mageia.org/ + + + <_description>Run Mageia Update Applet Configuration + <_message>Authentication is required to run Mageia Update Applet Configuration + drakconf + + no + no + auth_admin_keep + + /usr/libexec/mgaapplet-config + true + + 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 @@ + + + + + Mageia + http://www.mageia.org/ + + + <_description>Run Mageia Upgrade Helper + <_message>Authentication is required to run Mageia Upgrade Helper + drakconf + + no + no + auth_admin_keep + + /usr/libexec/mgaapplet-upgrade-helper + true + + 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 @@ + + + + + Mageia + http://www.mageia.org/ + + + <_description>Run Mageia Updater + <_message>Authentication is required to run Mageia Updater + drakconf + + no + no + auth_admin_keep + + /usr/libexec/mgaupdate + true + + -- cgit v1.2.1