From 5895396bc583ae08c5041f5b81f5f9d0a2888e22 Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Mon, 28 Jan 2008 17:43:05 -0500 Subject: make polkit optional and use RBAC on Solaris This patch makes polkit an optional dependency. If present it builds with it. If not, polkit support is disabled. This patch also adds a --enable-rbac-shutdown= option. If set, then ConsoleKit will allow shutdown/reboot if the user has the RBAC key authorization defined. For example, since the GDM GUI program runs as the "gdm" user, setting the key for the "gdm" user allows the login program to shutdown and reboot via ConsoleKit. Also this patch modifies the tools/solaris/ck-system-restart and tools/solaris/ck-system-stop scripts to call "/sbin/init 6" and "/sbin/init 5", which are the right commands for Solaris. --- configure.ac | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5bc018d..b814569 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,18 @@ PKG_CHECK_MODULES(CONSOLE_KIT, dbus-glib-1 >= $DBUS_REQUIRED_VERSION gobject-2.0 >= $GLIB_REQUIRED_VERSION gthread-2.0 >= $GLIB_REQUIRED_VERSION - polkit >= $POLKIT_REQUIRED_VERSION ) + +PKG_CHECK_MODULES(POLKIT, + polkit >= $POLKIT_REQUIRED_VERSION, + have_polkit=yes, + have_polkit=no) +if test "x$have_polkit" = "xyes" ; then + AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit]) +fi +AM_CONDITIONAL(HAVE_POLKIT, test x$have_polkit = xyes) +AC_SUBST(HAVE_POLKIT) + PKG_CHECK_MODULES(LIBDBUS, dbus-1 >= $DBUS_REQUIRED_VERSION ) @@ -281,6 +291,23 @@ if test "x$enable_inotify" = "xyes" ; then AC_DEFINE(ENABLE_INOTIFY, [], [Define if we have inotify]) fi +dnl --------------------------------------------------------------------------- +dnl check for RBAC +dnl --------------------------------------------------------------------------- + +msg_rbac_shutdown=no +AC_ARG_ENABLE(rbac-shutdown, + [AC_HELP_STRING([--enable-rbac-shutdown=], + [Build with RBAC support specifying shutdown/reboot RBAC authentication key])], + enable_rbac_shutdown=$enableval,enable_rbac_shutdown=no) +if test "x$enable_rbac_shutdown" != "xno"; then + RBAC_LIBS="-lsecdb -lsocket -lnsl" + AC_DEFINE(ENABLE_RBAC_SHUTDOWN, [], [Set if we build with RBAC support]) + AC_DEFINE_UNQUOTED(RBAC_SHUTDOWN_KEY, "$enable_rbac_shutdown", [Set if we build with RBAC support]) + msg_rbac_shutdown="yes, using key $enable_rbac_shutdown" +fi +AC_SUBST(RBAC_LIBS) + dnl --------------------------------------------------------------------------- dnl Finish dnl --------------------------------------------------------------------------- @@ -398,4 +425,5 @@ echo " PAM module dir: ${PAM_MODULE_DIR} Build PAM module: ${msg_pam_module} Build docs: ${enable_docbook_docs} + Build with RBAC: ${msg_rbac_shutdown} " -- cgit