From af7e90599e921a523c8eb4520013eae22b52e9c1 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sat, 30 Aug 2014 21:11:04 +0300 Subject: [PATCH] Add pkexec policy (Bug 11088) This adds a pkexec policy file to mousepad. This way if the user of a desktop system wants to use mousepad to edit a file as root and has the proper credentials they can. pkexec comes from polkit which does about the same thing as sudo/gtksu except also supports authentication methods like fingerprint or smart card readers. --- Makefile.am | 18 ++++++++++++++++-- org.xfce.mousepad.policy.in.in | 34 ++++++++++++++++++++++++++++++++++ po/POTFILES.in | 5 +++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 org.xfce.mousepad.policy.in.in diff --git a/Makefile.am b/Makefile.am index 964dd9a..db9d51b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,6 +16,17 @@ desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ + +polkit_policydir = $(datadir)/polkit-1/actions +polkit_in_in_files = \ + org.xfce.mousepad.policy.in.in +polkit_in_files = $(polkit_in_in_files:.policy.in.in=.policy.in) +%.policy.in: %.policy.in.in + sed -e "s,\@bindir\@,$(bindir),g" < $< > $@ +polkit_policy_DATA = $(polkit_in_files:.policy.in=.policy) +@INTLTOOL_POLICY_RULE@ + + .PHONY: ChangeLog ChangeLog: Makefile @@ -29,13 +40,16 @@ EXTRA_DIST = \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ - $(desktop_in_in_files) + $(desktop_in_in_files) \ + $(polkit_in_in_files) DISTCLEANFILES = \ intltool-extract \ intltool-merge \ intltool-update \ $(desktop_in_files) \ - $(desktop_DATA) + $(desktop_DATA) \ + $(polkit_in_files) \ + $(polkit_policy_DATA) # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: diff --git a/org.xfce.mousepad.policy.in.in b/org.xfce.mousepad.policy.in.in new file mode 100644 index 0000000..0968d8c --- /dev/null +++ b/org.xfce.mousepad.policy.in.in @@ -0,0 +1,34 @@ + + + + + + + Mousepad + http://xfce.org/ + Text Editor + + + + + <_description>Run Mousepad as root + <_message>Authentication is required to run Mousepad as root. + + no + auth_admin + auth_admin + + @bindir@/mousepad + true + + + diff --git a/po/POTFILES.in b/po/POTFILES.in index e175eb3..d587cca 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -30,3 +30,8 @@ mousepad/mousepad-window.c # Desktop Files # mousepad.desktop.in.in + +# +# Polkit File +# +org.xfce.mousepad.policy.in.in -- 2.1.0