Merge WITH_POLKIT1 and WITH_POLKIT

There is just one polkit now.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Ján Tomko 2018-03-07 10:14:23 +01:00
parent ab20f5059c
commit 0d4b988b3e
5 changed files with 10 additions and 16 deletions

View File

@ -27,8 +27,6 @@ AC_DEFUN([LIBVIRT_CHECK_POLKIT], [
PKCHECK_PATH= PKCHECK_PATH=
with_polkit1=no
if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
dnl Check for new polkit first. We directly talk over DBus dnl Check for new polkit first. We directly talk over DBus
dnl but we use existence of pkcheck binary as a sign that dnl but we use existence of pkcheck binary as a sign that
@ -40,10 +38,7 @@ AC_DEFUN([LIBVIRT_CHECK_POLKIT], [
if test "x$with_dbus" = "xyes" ; then if test "x$with_dbus" = "xyes" ; then
AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
[use PolicyKit for UNIX socket access checks]) [use PolicyKit for UNIX socket access checks])
AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
[use PolicyKit for UNIX socket access checks])
with_polkit="yes" with_polkit="yes"
with_polkit1="yes"
else else
if test "x$with_polkit" = "xcheck" ; then if test "x$with_polkit" = "xcheck" ; then
with_polkit=no with_polkit=no
@ -56,7 +51,6 @@ AC_DEFUN([LIBVIRT_CHECK_POLKIT], [
fi fi
AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"]) AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"])
AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"])
]) ])
AC_DEFUN([LIBVIRT_RESULT_POLKIT], [ AC_DEFUN([LIBVIRT_RESULT_POLKIT], [

View File

@ -64,7 +64,7 @@ $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
$(srcdir)/access/genpolkit.pl Makefile.am $(srcdir)/access/genpolkit.pl Makefile.am
$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@ $(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@
if WITH_POLKIT1 if WITH_POLKIT
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES) libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)
polkitactiondir = $(datadir)/polkit-1/actions polkitactiondir = $(datadir)/polkit-1/actions
@ -74,9 +74,9 @@ endif WITH_LIBVIRTD
CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY) CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY) BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
else ! WITH_POLKIT1 else ! WITH_POLKIT
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES) EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
endif ! WITH_POLKIT1 endif ! WITH_POLKIT
BUILT_SOURCES += \ BUILT_SOURCES += \

View File

@ -23,7 +23,7 @@
#include "viraccessmanager.h" #include "viraccessmanager.h"
#include "viraccessdrivernop.h" #include "viraccessdrivernop.h"
#include "viraccessdriverstack.h" #include "viraccessdriverstack.h"
#if WITH_POLKIT1 #if WITH_POLKIT
# include "viraccessdriverpolkit.h" # include "viraccessdriverpolkit.h"
#endif #endif
#include "viralloc.h" #include "viralloc.h"
@ -112,7 +112,7 @@ static virAccessManagerPtr virAccessManagerNewDriver(virAccessDriverPtr drv)
static virAccessDriverPtr accessDrivers[] = { static virAccessDriverPtr accessDrivers[] = {
&accessDriverNop, &accessDriverNop,
#if WITH_POLKIT1 #if WITH_POLKIT
&accessDriverPolkit, &accessDriverPolkit,
#endif #endif
}; };

View File

@ -35,7 +35,7 @@
VIR_LOG_INIT("util.polkit"); VIR_LOG_INIT("util.polkit");
#if WITH_POLKIT1 #if WITH_POLKIT
struct _virPolkitAgent { struct _virPolkitAgent {
virCommandPtr cmd; virCommandPtr cmd;
@ -206,7 +206,7 @@ virPolkitAgentCreate(void)
} }
#else /* ! WITH_POLKIT1 */ #else /* ! WITH_POLKIT */
int virPolkitCheckAuth(const char *actionid ATTRIBUTE_UNUSED, int virPolkitCheckAuth(const char *actionid ATTRIBUTE_UNUSED,
pid_t pid ATTRIBUTE_UNUSED, pid_t pid ATTRIBUTE_UNUSED,
@ -236,4 +236,4 @@ virPolkitAgentCreate(void)
_("polkit text authentication agent unavailable")); _("polkit text authentication agent unavailable"));
return NULL; return NULL;
} }
#endif /* WITH_POLKIT1 */ #endif /* WITH_POLKIT */

View File

@ -251,9 +251,9 @@ test_programs += virdbustest \
virsystemdtest \ virsystemdtest \
$(NULL) $(NULL)
test_libraries += virdbusmock.la test_libraries += virdbusmock.la
if WITH_POLKIT1 if WITH_POLKIT
test_programs += virpolkittest test_programs += virpolkittest
endif WITH_POLKIT1 endif WITH_POLKIT
endif WITH_DBUS endif WITH_DBUS
if WITH_SECDRIVER_SELINUX if WITH_SECDRIVER_SELINUX