about summary refs log tree commit diff
path: root/libnm/nm-dbus-helpers.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2015-07-14 19:39:12 +0200
committerMichael Biebl <biebl@debian.org>2015-07-14 19:39:12 +0200
commit34b1c46437df982495d08a8bbb8bd0b262d8af48 (patch)
tree1db29ec39d9f733922b3a33cabcc8e6486fa06aa /libnm/nm-dbus-helpers.c
parent50fc50153b0036516b853aa576dc435bd53ce736 (diff)
parent50a58f0fabd8a34c1b6108a107e08abe3c1ccd24 (diff)
Merge tag 'upstream/1.0.4'
Upstream version 1.0.4
Diffstat (limited to 'libnm/nm-dbus-helpers.c')
-rw-r--r--libnm/nm-dbus-helpers.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c
index 6bfd4bbd..45e09442 100644
--- a/libnm/nm-dbus-helpers.c
+++ b/libnm/nm-dbus-helpers.c
@@ -22,6 +22,8 @@
 
 #include <string.h>
 #include <gio/gio.h>
+
+#include "nm-glib-compat.h"
 #include "nm-dbus-helpers.h"
 #include "nm-dbus-interface.h"
 
@@ -93,7 +95,8 @@ _nm_dbus_new_connection (GCancellable *cancellable, GError **error)
 	GDBusConnection *connection = NULL;
 
 	/* If running as root try the private bus first */
-	if (0 == geteuid ()) {
+	if (0 == geteuid () && !g_test_initialized ()) {
+
 		GError *local = NULL;
 		GDBusConnection *p;
 
@@ -203,7 +206,7 @@ _nm_dbus_new_connection_async (GCancellable *cancellable,
 	simple = g_simple_async_result_new (NULL, callback, user_data, _nm_dbus_new_connection_async);
 
 	/* If running as root try the private bus first */
-	if (0 == geteuid ()) {
+	if (0 == geteuid () && !g_test_initialized ()) {
 		GDBusConnection *p;
 
 		if (cancellable) {