summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-12-09 09:02:24 +0100
committerThomas Haller <thaller@redhat.com>2019-12-09 09:02:24 +0100
commit1e742e0fb48db1756f9887fdb145f2da85c60066 (patch)
treed36ca4f64e7eea44612089579c967fb90b44841f
parent9d602529cc5e7442d545979ea6ea79af5046e6fc (diff)
downloadNetworkManager-1e742e0fb48db1756f9887fdb145f2da85c60066.tar.gz
ifcfg: don't use D-Bus connection if NMDBusManager is without main connection
In configure-and-quit mode, NMDBusManager does not have a D-Bus connection. Likewise, ifcfg-rh plugin should not use one either.
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c
index 19c4f51eb4..c1396f7381 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c
@@ -20,6 +20,7 @@
#include "nm-utils.h"
#include "nm-core-internal.h"
#include "nm-config.h"
+#include "nm-dbus-manager.h"
#include "settings/nm-settings-plugin.h"
#include "settings/nm-settings-utils.h"
#include "NetworkManagerUtils.h"
@@ -1132,6 +1133,11 @@ _dbus_setup (NMSIfcfgRHPlugin *self)
_dbus_clear (self);
+ if (!NM_MAIN_DBUS_CONNECTION_GET) {
+ _LOGW ("dbus: don't use D-Bus for %s service", IFCFGRH1_BUS_NAME);
+ return;
+ }
+
/* We use a separate D-Bus connection so that org.freedesktop.NetworkManager and com.redhat.ifcfgrh1
* are exported by different connections. */
address = g_dbus_address_get_for_bus_sync (G_BUS_TYPE_SYSTEM, NULL, &error);