using correct dbus socket address and limited testbus server for session bus.
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Wed, 29 May 2013 09:06:37 +0000 (12:06 +0300)
committerImran Zaman <imran.zaman@intel.com>
Fri, 31 May 2013 12:22:52 +0000 (15:22 +0300)
configure.ac
libgsignon-glib/sso-auth-service.c

index 43fe45c..f90946b 100644 (file)
@@ -49,21 +49,22 @@ 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])
+    AC_DEFINE(SIGNOND_BUS_ADDRESS, ["unix:path=%s/gsignond/bus-sock"], [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])
+
+    # Build tests.
+    PKG_CHECK_MODULES(GTestDBus, glib-2.0 >= 2.34, [gtestdbus=yes], [gtestdbus=no])
+    if test "x$gtestdbus" = xyes; then
+        AC_DEFINE(HAVE_GTESTDBUS, [1], [Define if GTestDBus exists.])
+    else
+        AC_DEFINE(HAVE_GTESTDBUS, [0], [GTestDBus does not exist.])
+    fi
 elif test "x$enable_dbus_type" = "xsystem" ; then
     AC_DEFINE(SIGNOND_BUS_TYPE, [G_BUS_TYPE_SYSTEM], [Use system bus])
 fi
 
-# Build tests.
-PKG_CHECK_MODULES(GTestDBus, glib-2.0 >= 2.34, [gtestdbus=yes], [gtestdbus=no])
 AM_CONDITIONAL(HAVE_GTESTDBUS, [test x$gtestdbus = xyes])
-if test "x$gtestdbus" = xyes; then
-    AC_DEFINE(HAVE_GTESTDBUS, [1], [Define if GTestDBus exists.])
-else
-    AC_DEFINE(HAVE_GTESTDBUS, [0], [GTestDBus does not exist.])
-fi
 
 CHECK_REQUIRED="check >= 0.9.4"
 
index eccdf56..f8a3cf0 100644 (file)
@@ -106,11 +106,13 @@ sso_auth_service_get_instance ()
     if (sso_auth_service != NULL) return sso_auth_service;
 
 #ifdef USE_P2P
-    connection = g_dbus_connection_new_for_address_sync (SIGNOND_BUS_ADDRESS,
+    gchar *bus_address = g_strdup_printf (SIGNOND_BUS_ADDRESS, g_get_user_runtime_dir());
+    connection = g_dbus_connection_new_for_address_sync (bus_address,
                                                          G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
                                                          NULL,
                                                          NULL,
                                                          &error);
+    g_free (bus_address);
 #else
     connection = g_bus_get_sync (SIGNOND_BUS_TYPE, NULL, &error);
 #endif