Rename HAVE_POLKIT to WITH_POLKIT
This commit is contained in:
parent
14e3d7d2a4
commit
cf7ac00ebd
14
configure.ac
14
configure.ac
@ -1113,9 +1113,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
|
|||||||
AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
|
AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
|
||||||
if test "x$PKCHECK_PATH" != "x" ; then
|
if test "x$PKCHECK_PATH" != "x" ; then
|
||||||
AC_DEFINE_UNQUOTED([PKCHECK_PATH],["$PKCHECK_PATH"],[Location of pkcheck program])
|
AC_DEFINE_UNQUOTED([PKCHECK_PATH],["$PKCHECK_PATH"],[Location of pkcheck program])
|
||||||
AC_DEFINE_UNQUOTED([HAVE_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([HAVE_POLKIT1], 1,
|
AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
|
||||||
[use PolicyKit for UNIX socket access checks])
|
[use PolicyKit for UNIX socket access checks])
|
||||||
with_polkit="yes"
|
with_polkit="yes"
|
||||||
with_polkit1="yes"
|
with_polkit1="yes"
|
||||||
@ -1131,9 +1131,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
if test "x$with_polkit" = "xyes" ; then
|
if test "x$with_polkit" = "xyes" ; then
|
||||||
AC_DEFINE_UNQUOTED([HAVE_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([HAVE_POLKIT0], 1,
|
AC_DEFINE_UNQUOTED([WITH_POLKIT0], 1,
|
||||||
[use PolicyKit for UNIX socket access checks])
|
[use PolicyKit for UNIX socket access checks])
|
||||||
|
|
||||||
old_CFLAGS=$CFLAGS
|
old_CFLAGS=$CFLAGS
|
||||||
@ -1152,9 +1152,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL([HAVE_POLKIT], [test "x$with_polkit" = "xyes"])
|
AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"])
|
||||||
AM_CONDITIONAL([HAVE_POLKIT0], [test "x$with_polkit0" = "xyes"])
|
AM_CONDITIONAL([WITH_POLKIT0], [test "x$with_polkit0" = "xyes"])
|
||||||
AM_CONDITIONAL([HAVE_POLKIT1], [test "x$with_polkit1" = "xyes"])
|
AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"])
|
||||||
AC_SUBST([POLKIT_CFLAGS])
|
AC_SUBST([POLKIT_CFLAGS])
|
||||||
AC_SUBST([POLKIT_LIBS])
|
AC_SUBST([POLKIT_LIBS])
|
||||||
|
|
||||||
|
@ -170,8 +170,8 @@ endif
|
|||||||
|
|
||||||
libvirtd_LDADD += ../src/libvirt.la
|
libvirtd_LDADD += ../src/libvirt.la
|
||||||
|
|
||||||
if HAVE_POLKIT
|
if WITH_POLKIT
|
||||||
if HAVE_POLKIT0
|
if WITH_POLKIT0
|
||||||
policydir = $(datadir)/PolicyKit/policy
|
policydir = $(datadir)/PolicyKit/policy
|
||||||
policyauth = auth_admin_keep_session
|
policyauth = auth_admin_keep_session
|
||||||
else
|
else
|
||||||
@ -201,7 +201,7 @@ uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-up
|
|||||||
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
||||||
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
||||||
|
|
||||||
if HAVE_POLKIT
|
if WITH_POLKIT
|
||||||
install-data-polkit::
|
install-data-polkit::
|
||||||
$(MKDIR_P) $(DESTDIR)$(policydir)
|
$(MKDIR_P) $(DESTDIR)$(policydir)
|
||||||
$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||||
|
@ -242,7 +242,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
/* Only default to PolicyKit if running as root */
|
/* Only default to PolicyKit if running as root */
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
if (privileged) {
|
if (privileged) {
|
||||||
data->auth_unix_rw = REMOTE_AUTH_POLKIT;
|
data->auth_unix_rw = REMOTE_AUTH_POLKIT;
|
||||||
data->auth_unix_ro = REMOTE_AUTH_POLKIT;
|
data->auth_unix_ro = REMOTE_AUTH_POLKIT;
|
||||||
@ -250,7 +250,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
|
|||||||
#endif
|
#endif
|
||||||
data->auth_unix_rw = REMOTE_AUTH_NONE;
|
data->auth_unix_rw = REMOTE_AUTH_NONE;
|
||||||
data->auth_unix_ro = REMOTE_AUTH_NONE;
|
data->auth_unix_ro = REMOTE_AUTH_NONE;
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ daemonConfigLoadOptions(struct daemonConfig *data,
|
|||||||
|
|
||||||
if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0)
|
if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
/* Change default perms to be wide-open if PolicyKit is enabled.
|
/* Change default perms to be wide-open if PolicyKit is enabled.
|
||||||
* Admin can always override in config file
|
* Admin can always override in config file
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
|
|
||||||
#if HAVE_POLKIT0
|
#if WITH_POLKIT0
|
||||||
# include <polkit/polkit.h>
|
# include <polkit/polkit.h>
|
||||||
# include <polkit-dbus/polkit-dbus.h>
|
# include <polkit-dbus/polkit-dbus.h>
|
||||||
#endif
|
#endif
|
||||||
@ -2802,7 +2802,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_POLKIT1
|
#if WITH_POLKIT1
|
||||||
static int
|
static int
|
||||||
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
virNetServerClientPtr client,
|
virNetServerClientPtr client,
|
||||||
@ -2912,7 +2912,7 @@ authdeny:
|
|||||||
client, REMOTE_AUTH_POLKIT, ident);
|
client, REMOTE_AUTH_POLKIT, ident);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#elif HAVE_POLKIT0
|
#elif WITH_POLKIT0
|
||||||
static int
|
static int
|
||||||
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
virNetServerClientPtr client,
|
virNetServerClientPtr client,
|
||||||
@ -3056,7 +3056,7 @@ authdeny:
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !HAVE_POLKIT0 & !HAVE_POLKIT1*/
|
#else /* !WITH_POLKIT0 & !HAVE_POLKIT1*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
@ -3071,7 +3071,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_POLKIT1 */
|
#endif /* WITH_POLKIT1 */
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
|
@ -122,10 +122,10 @@ static int remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
|
|||||||
static int remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
|
static int remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
|
||||||
virConnectAuthPtr auth, const char *mech);
|
virConnectAuthPtr auth, const char *mech);
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
static int remoteAuthPolkit(virConnectPtr conn, struct private_data *priv,
|
static int remoteAuthPolkit(virConnectPtr conn, struct private_data *priv,
|
||||||
virConnectAuthPtr auth);
|
virConnectAuthPtr auth);
|
||||||
#endif /* HAVE_POLKIT */
|
#endif /* WITH_POLKIT */
|
||||||
|
|
||||||
static virDomainPtr get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain);
|
static virDomainPtr get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain);
|
||||||
static virNetworkPtr get_nonnull_network(virConnectPtr conn, remote_nonnull_network network);
|
static virNetworkPtr get_nonnull_network(virConnectPtr conn, remote_nonnull_network network);
|
||||||
@ -3504,7 +3504,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
case REMOTE_AUTH_POLKIT:
|
case REMOTE_AUTH_POLKIT:
|
||||||
if (remoteAuthPolkit(conn, priv, auth) < 0) {
|
if (remoteAuthPolkit(conn, priv, auth) < 0) {
|
||||||
VIR_FREE(ret.types.types_val);
|
VIR_FREE(ret.types.types_val);
|
||||||
@ -4075,8 +4075,8 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
|
|||||||
#endif /* WITH_SASL */
|
#endif /* WITH_SASL */
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_POLKIT
|
#if WITH_POLKIT
|
||||||
# if HAVE_POLKIT1
|
# if WITH_POLKIT1
|
||||||
static int
|
static int
|
||||||
remoteAuthPolkit(virConnectPtr conn, struct private_data *priv,
|
remoteAuthPolkit(virConnectPtr conn, struct private_data *priv,
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
|
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
|
||||||
@ -4094,7 +4094,7 @@ remoteAuthPolkit(virConnectPtr conn, struct private_data *priv,
|
|||||||
VIR_DEBUG("PolicyKit-1 authentication complete");
|
VIR_DEBUG("PolicyKit-1 authentication complete");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# elif HAVE_POLKIT0
|
# elif WITH_POLKIT0
|
||||||
/* Perform the PolicyKit authentication process
|
/* Perform the PolicyKit authentication process
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@ -4156,8 +4156,8 @@ out:
|
|||||||
VIR_DEBUG("PolicyKit-0 authentication complete");
|
VIR_DEBUG("PolicyKit-0 authentication complete");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# endif /* HAVE_POLKIT0 */
|
# endif /* WITH_POLKIT0 */
|
||||||
#endif /* HAVE_POLKIT */
|
#endif /* WITH_POLKIT */
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static int remoteDomainEventRegister(virConnectPtr conn,
|
static int remoteDomainEventRegister(virConnectPtr conn,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user