AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
+AC_ARG_ENABLE(dbus-type,
+ [--enable-dbus-type=dbus-type specify daemon dbus type:
+ p2p(default): uses peer to peer dbus
+ session: uses session message bus
+ system: uses system message bus],
+ [enable_dbus_type=$enableval], [enable_dbus_type=p2p])
+
+echo "----------------------"
+echo " DBUS TYPE : '$enable_dbus_type'"
+echo "-----------------------"
+if test "x$enable_dbus_type" = "xp2p" ; then
+ AC_DEFINE(USE_P2P, [1], [Use peer to peer dbus])
+ AC_DEFINE(SIGNOND_BUS_ADDRESS, ["unix:abstract=gsignond"], [signond daemon server socket address])
+elif test "x$enable_dbus_type" = "xsession" ; then
+ AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SESSION], [Use session bus])
+elif test "x$enable_dbus_type" = "xsystem" ; then
+ AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
+fi
+
# Build tests.
CHECK_REQUIRED="check >= 0.9.4"
* 02110-1301 USA
*/
+#include <config.h>
#include "signon-errors.h"
#include "signon-internals.h"
#include "sso-auth-service.h"
SsoAuthService *
sso_auth_service_get_instance ()
{
- SsoAuthService *sso_auth_service;
+ SsoAuthService *sso_auth_service = NULL;
+ GDBusConnection *connection = NULL;
GError *error = NULL;
sso_auth_service = get_singleton ();
if (sso_auth_service != NULL) return sso_auth_service;
+#ifdef USE_P2P
+ connection = g_dbus_connection_new_for_address_sync (SIGNOND_BUS_ADDRESS,
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
+ NULL,
+ NULL,
+ &error);
+#else
+ connection = g_bus_get_sync (SIGNOND_BUS_TYPE, NULL, &error);
+#endif
/* Create the object */
sso_auth_service =
- sso_auth_service_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
- SIGNOND_SERVICE,
- SIGNOND_DAEMON_OBJECTPATH,
- NULL,
- &error);
+ sso_auth_service_proxy_new_sync (connection,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+#ifdef USE_P2P
+ NULL,
+#else
+ SIGNOND_SERVICE,
+#endif
+ SIGNOND_DAEMON_OBJECTPATH,
+ NULL,
+ &error);
if (G_LIKELY (error == NULL)) {
set_singleton (sso_auth_service);
}