From 2f559ec3b5a95f8781979c80bd260ad952645f36 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Fri, 4 Aug 2017 07:38:56 +0100 Subject: [PATCH] Only install polkit action file when pkexec is used (#776437) Only install the GParted polkit action file when pkexec is being used as the root privilege escalation program. Bug 776437 - GParted fails to run as root under Wayland --- Makefile.am | 4 +++- configure.ac | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 03d51635..4edcd82b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,7 +25,9 @@ polkit_action_in_in_FILES = org.gnome.gparted.policy.in.in polkit_action_in_FILES = org.gnome.gparted.policy.in polkit_action_FILES = $(polkit_action_in_FILES:.policy.in=.policy) polkit_actiondir = $(datadir)/polkit-1/actions -polkit_action_DATA = $(polkit_action_FILES) +if INSTALL_POLKIT_ACTIONS + polkit_action_DATA = $(polkit_action_FILES) +endif bin_SCRIPTS = gparted CLEANFILES = $(bin_SCRIPTS) $(DESKTOP_IN_FILES) $(polkit_action_in_FILES) diff --git a/configure.ac b/configure.ac index f2969d8b..9fcd7419 100644 --- a/configure.ac +++ b/configure.ac @@ -25,12 +25,14 @@ dnl Find graphical privilege escalation program dnl====================== AC_CHECK_PROGS([GKSUPROG], [pkexec gksudo gksu kdesudo "xdg-su -c"], []) +AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], false) if test "x$GKSUPROG" = 'xpkexec'; then AC_MSG_CHECKING([how to run pkexec]) if pkexec --help 2>&1 | grep -q -- --disable-internal-agent; then GKSUPROG="$GKSUPROG --disable-internal-agent" fi AC_MSG_RESULT([$GKSUPROG]) + AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], true) fi