]> xenbits.xensource.com Git - libvirt.git/commitdiff
polkit: reintroduce check for pkcheck
authorJán Tomko <jtomko@redhat.com>
Fri, 23 Mar 2018 18:10:35 +0000 (19:10 +0100)
committerJán Tomko <jtomko@redhat.com>
Sun, 25 Mar 2018 20:27:22 +0000 (22:27 +0200)
Commit 2499d1a0 was too eager and possibly enabled polkit
on all platforms with D-Bus, regardless of whether they use polkit.

Reintroduce the usage of pkcheck as a witness for --with-polkit=check,
but do not require it for --with-polkit=yes.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Jiří Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
m4/virt-polkit.m4

index fd729dc98b4b989b63926ce37056eb894c5eca39..16889e1639e22b5df06c308c9277b27a9901af47 100644 (file)
@@ -25,8 +25,17 @@ AC_DEFUN([LIBVIRT_ARG_POLKIT], [
 AC_DEFUN([LIBVIRT_CHECK_POLKIT], [
   AC_REQUIRE([LIBVIRT_CHECK_DBUS])
 
+  if test "x$with_polkit" = "xcheck"; then
+    dnl For --with-polkit=check, also require the pkcheck binary, even
+    dnl though we talk to polkit directly over D-Bus.
+    AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [$LIBVIRT_SBIN_PATH])
+    if test "x$PKCHECK_PATH" = "x" ; then
+        with_polkit="no"
+    fi
+  fi
+
   if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
-    dnl All we need to talk to polkit is D-Bus.
+    dnl For --with-polkit=yes, all we need is D-Bus.
     if test "x$with_dbus" = "xyes" ; then
       AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
           [use PolicyKit for UNIX socket access checks])