From b38421bcf7197493991d173e6502ae6c81beec79 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sun, 31 Aug 2014 12:26:51 +0300 Subject: [PATCH] Add pkexec policy (Bug #11122) This adds a pkexec policy file to Thunar. This way if the user of a desktop system wants to use thunar to modify files as root and has the proper credentials they can. pkexec comes from polkit which does about the same thing as sudo/gksu except also supports authentication methods like fingerprint or smart card readers. --- Makefile.am | 16 ++++++++++++++-- org.xfce.thunar.policy.in.in | 37 +++++++++++++++++++++++++++++++++++++ po/POTFILES.in | 2 ++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 org.xfce.thunar.policy.in.in diff --git a/Makefile.am b/Makefile.am index ece3b41..52a430e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -74,6 +74,15 @@ service_DATA = $(service_in_files:.service.in=.service) $(AM_V_GEN) $(SED) -e "s,\@bindir\@,$(bindir),g" < $< > $@ endif +polkit_policydir = $(datadir)/polkit-1/actions +polkit_in_in_files = \ + org.xfce.thunar.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@ + EXTRA_DIST = \ FAQ \ HACKING \ @@ -82,7 +91,8 @@ EXTRA_DIST = \ intltool-merge.in \ intltool-update.in \ $(desktop_in_in_files) \ - $(service_in_files) + $(service_in_files) \ + $(polkit_in_in_files) DISTCLEANFILES = \ ThunarBulkRename \ @@ -91,7 +101,9 @@ DISTCLEANFILES = \ intltool-update \ $(desktop_in_files) \ $(desktop_DATA) \ - $(service_DATA) + $(service_DATA) \ + $(polkit_in_files) \ + $(polkit_policy_DATA) DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ diff --git a/org.xfce.thunar.policy.in.in b/org.xfce.thunar.policy.in.in new file mode 100644 index 0000000..d64113e --- /dev/null +++ b/org.xfce.thunar.policy.in.in @@ -0,0 +1,37 @@ + + + + + + + Thunar + http://xfce.org/ + system-file-manager + + + + + <_description>Run Thunar as root + <_message>Authentication is required to run Thunar as root. + + no + auth_admin + auth_admin + + @bindir@/thunar + true + + + diff --git a/po/POTFILES.in b/po/POTFILES.in index 87561fd..fb581bb 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -129,3 +129,5 @@ Thunar.desktop.in.in Thunar-bulk-rename.desktop.in.in Thunar-folder-handler.desktop.in.in thunar/thunar-settings.desktop.in + +org.xfce.thunar.policy.in.in -- 2.1.0