1. 16 May, 2019 9 commits
    • Thomas Haller's avatar
      ac14ebb3
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      c307f072
    • Thomas Haller's avatar
      libnm: mark static "eap_methods_table" array as const · bb38bfe7
      Thomas Haller authored
      This allows the linker to put the variable into read-only memory,
      which is desirable here.
      bb38bfe7
    • Thomas Haller's avatar
      shared: fix type shenanigans for data pointer of nm_memdup_maybe_a() · fbddd27e
      Thomas Haller authored
      The type of the "data" pointer may not be compatible with the type of
      the "to_free" / output pointer. This is due to constness, and that we
      are unable in C to remove constness from a type.
      
      For example,
      
          {
              const char *const *data = ...;
              gs_free const char **cpy_to_free = NULL;
              const char **cpy;
      
              cpy = nm_memdup_maybe_a (300, data, NM_PTRARRAY_LEN (data) + 1, &cpy_to_free);
          }
      
      is prefectly valid , but would not have compiled.
      
      It shows that "data" is not of type "*(&cpy_to_free)", but rather
      it might be a non-const pointer of the same type.
      
      Fixes: d0e1d0e6 ('shared: propagate types in nm_malloc_maybe_a(), nm_malloc0_maybe_a(), nm_memdup_maybe_a()')
      fbddd27e
    • Thomas Haller's avatar
      core: ensure NUL padding interface name in nm_utils_ifname_cpy() · 98f41226
      Thomas Haller authored
      Always ensure that the entire buffer is initialized with padding NULs.
      
      For example, valgrind checks whether we access uninitalized memory,
      so leaving this uninitalized can be unexpected and cause valgrind
      failures. In general, one might be tempted to copy the ifname buffer (of
      well known size IFNAMSIZ) with memcpy(). In that case, we should not
      have trailing garbage there.
      
      We could use strncpy() for that (which guarantees NUL padding), but
      then we still would have to ensure NUL termination. But strncpy() is
      frowned upon, so let's not use it here.
      
      Note that g_strlcpy() does not guarantee NUL padding, so it's
      unsuitable.
      
      We could also implement this with a combination of memcpy() and
      memset(). But in this case, it just seems simpler to iterate over the
      16 bytes and do it manually.
      98f41226
    • Thomas Haller's avatar
      platform: avoid valgrind warning about uninitialised memory in _ioctl_call() · e9c76f37
      Thomas Haller authored
      ==6207== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
      ==6207==    at 0x514603B: ioctl (syscall-template.S:78)
      ==6207==    by 0x19FC2F: _ioctl_call (nm-platform-utils.c:183)
      ==6207==    by 0x1A026B: _ethtool_call_handle (nm-platform-utils.c:319)
      ==6207==    by 0x1A031F: ethtool_get_stringset (nm-platform-utils.c:378)
      ==6207==    by 0x1A03BC: ethtool_get_stringset_index (nm-platform-utils.c:414)
      ==6207==    by 0x1A181E: nmp_utils_ethtool_supports_vlans (nm-platform-utils.c:912)
      ==6207==    by 0x1756D7: link_supports_vlans (nm-linux-platform.c:6508)
      ==6207==    by 0x1A81D8: nm_platform_link_supports_vlans (nm-platform.c:1536)
      ==6207==    by 0x14B96B: test_internal (test-link.c:602)
      ==6207==    by 0x4F5C18D: test_case_run (gtestutils.c:2597)
      ==6207==    by 0x4F5C18D: g_test_run_suite_internal (gtestutils.c:2685)
      ==6207==    by 0x4F5BF33: g_test_run_suite_internal (gtestutils.c:2697)
      ==6207==    by 0x4F5C679: g_test_run_suite (gtestutils.c:2772)
      ==6207==    by 0x4F5C694: g_test_run (gtestutils.c:2007)
      ==6207==    by 0x166B4D: main (test-common.c:2092)
      ==6207==  Address 0x1ffeffeecf is on thread 1's stack
      ==6207==  in frame #1, created by _ioctl_call (nm-platform-utils.c:110)
      ==6207==
      
      "ifname" is the stack-allocated array "known_ifnames" of suitable
      IFNAMSIZ bytes. But it may not be fully initialized, so using memcpy()
      to copy the string leads to unintialized warning.
      
      We really should only copy the valid bytes, either with strcpy() or our
      nm_utils_ifname_cpy() wrapper.
      
      Fixes: 85632256 ('platform/ethtool,mii: retry ioctl when interface name was renamed for ehttool/mii')
      e9c76f37
    • Thomas Haller's avatar
      platform: use memset() to initialize ifr struct in _ioctl_call() · 065d8914
      Thomas Haller authored
      "struct ifreq" contains a union field, and initalizing the struct is not
      guaranteed to fill all bytes with zero (it only sets the first union
      member to zero).
      
      Since we later return the entire struct, ensure that it's initialized to
      all zero by using memset().
      065d8914
    • Thomas Haller's avatar
      shared: propagate types in nm_malloc_maybe_a(), nm_malloc0_maybe_a(), nm_memdup_maybe_a() · d0e1d0e6
      Thomas Haller authored
      The "to_free" pointer should have the suitable type that we are
      requesting. Use "typeof()" to preserve and propagate the pointer
      type in the macro.
      d0e1d0e6
  2. 15 May, 2019 7 commits
  3. 14 May, 2019 3 commits
    • Thomas Haller's avatar
      systemd: merge branch systemd into master · 37faab73
      Thomas Haller authored
      37faab73
    • Thomas Haller's avatar
      systemd: update code from upstream (2019-05-14) · f61a12ee
      Thomas Haller authored
      This is a direct dump from systemd git.
      
      ======
      
      SYSTEMD_DIR=../systemd
      COMMIT=b6ec9afd44934a599a761e8c741077a7512e0c82
      
      (
        cd "$SYSTEMD_DIR"
        git checkout "$COMMIT"
        git reset --hard
        git clean -fdx
      )
      
      git ls-files -z :/src/systemd/src/ \
                      :/shared/systemd/src/ \
                      :/shared/nm-utils/unaligned.h | \
        xargs -0 rm -f
      
      nm_copy_sd_shared() {
          mkdir -p "./shared/systemd/$(dirname "$1")"
          cp "$SYSTEMD_DIR/$1" "./shared/systemd/$1"
      }
      
      nm_copy_sd_core() {
          mkdir -p "./src/systemd/$(dirname "$1")"
          cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
      }
      
      nm_copy_sd_nmutils() {
          mkdir -p "./shared/nm-utils/"
          cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${1##*/}"
      }
      
      nm_copy_sd_core "src/libsystemd-network/arp-util.c"
      nm_copy_sd_core "src/libsystemd-network/arp-util.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp-network.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp-option.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h"
      nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c"
      nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h"
      nm_copy_sd_core "src/libsystemd-network/lldp-internal.h"
      nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c"
      nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h"
      nm_copy_sd_core "src/libsystemd-network/lldp-network.c"
      nm_copy_sd_core "src/libsystemd-network/lldp-network.h"
      nm_copy_sd_core "src/libsystemd-network/network-internal.c"
      nm_copy_sd_core "src/libsystemd-network/network-internal.h"
      nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c"
      nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c"
      nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c"
      nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
      nm_copy_sd_core "src/libsystemd-network/sd-ipv4acd.c"
      nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c"
      nm_copy_sd_core "src/libsystemd-network/sd-lldp.c"
      nm_copy_sd_core "src/libsystemd/sd-event/event-source.h"
      nm_copy_sd_core "src/libsystemd/sd-event/event-util.c"
      nm_copy_sd_core "src/libsystemd/sd-event/event-util.h"
      nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c"
      nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c"
      nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h"
      nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c"
      nm_copy_sd_core "src/shared/dns-domain.c"
      nm_copy_sd_core "src/shared/dns-domain.h"
      nm_copy_sd_core "src/systemd/_sd-common.h"
      nm_copy_sd_core "src/systemd/sd-dhcp-client.h"
      nm_copy_sd_core "src/systemd/sd-dhcp-lease.h"
      nm_copy_sd_core "src/systemd/sd-dhcp6-client.h"
      nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
      nm_copy_sd_core "src/systemd/sd-event.h"
      nm_copy_sd_core "src/systemd/sd-id128.h"
      nm_copy_sd_core "src/systemd/sd-ipv4acd.h"
      nm_copy_sd_core "src/systemd/sd-ipv4ll.h"
      nm_copy_sd_core "src/systemd/sd-lldp.h"
      nm_copy_sd_core "src/systemd/sd-ndisc.h"
      nm_copy_sd_nmutils "src/basic/unaligned.h"
      nm_copy_sd_shared "src/basic/alloc-util.c"
      nm_copy_sd_shared "src/basic/alloc-util.h"
      nm_copy_sd_shared "src/basic/async.h"
      nm_copy_sd_shared "src/basic/env-file.c"
      nm_copy_sd_shared "src/basic/env-file.h"
      nm_copy_sd_shared "src/basic/env-util.c"
      nm_copy_sd_shared "src/basic/env-util.h"
      nm_copy_sd_shared "src/basic/errno-util.h"
      nm_copy_sd_shared "src/basic/escape.c"
      nm_copy_sd_shared "src/basic/escape.h"
      nm_copy_sd_shared "src/basic/ether-addr-util.c"
      nm_copy_sd_shared "src/basic/ether-addr-util.h"
      nm_copy_sd_shared "src/basic/extract-word.c"
      nm_copy_sd_shared "src/basic/extract-word.h"
      nm_copy_sd_shared "src/basic/fd-util.c"
      nm_copy_sd_shared "src/basic/fd-util.h"
      nm_copy_sd_shared "src/basic/fileio.c"
      nm_copy_sd_shared "src/basic/fileio.h"
      nm_copy_sd_shared "src/basic/fs-util.c"
      nm_copy_sd_shared "src/basic/fs-util.h"
      nm_copy_sd_shared "src/basic/hash-funcs.c"
      nm_copy_sd_shared "src/basic/hash-funcs.h"
      nm_copy_sd_shared "src/basic/hashmap.c"
      nm_copy_sd_shared "src/basic/hashmap.h"
      nm_copy_sd_shared "src/basic/hexdecoct.c"
      nm_copy_sd_shared "src/basic/hexdecoct.h"
      nm_copy_sd_shared "src/basic/hostname-util.c"
      nm_copy_sd_shared "src/basic/hostname-util.h"
      nm_copy_sd_shared "src/basic/in-addr-util.c"
      nm_copy_sd_shared "src/basic/in-addr-util.h"
      nm_copy_sd_shared "src/basic/io-util.c"
      nm_copy_sd_shared "src/basic/io-util.h"
      nm_copy_sd_shared "src/basic/list.h"
      nm_copy_sd_shared "src/basic/log.h"
      nm_copy_sd_shared "src/basic/macro.h"
      nm_copy_sd_shared "src/basic/memory-util.c"
      nm_copy_sd_shared "src/basic/memory-util.h"
      nm_copy_sd_shared "src/basic/mempool.c"
      nm_copy_sd_shared "src/basic/mempool.h"
      nm_copy_sd_shared "src/basic/missing_fcntl.h"
      nm_copy_sd_shared "src/basic/missing_socket.h"
      nm_copy_sd_shared "src/basic/missing_stat.h"
      nm_copy_sd_shared "src/basic/missing_type.h"
      nm_copy_sd_shared "src/basic/parse-util.c"
      nm_copy_sd_shared "src/basic/parse-util.h"
      nm_copy_sd_shared "src/basic/path-util.c"
      nm_copy_sd_shared "src/basic/path-util.h"
      nm_copy_sd_shared "src/basic/prioq.c"
      nm_copy_sd_shared "src/basic/prioq.h"
      nm_copy_sd_shared "src/basic/process-util.c"
      nm_copy_sd_shared "src/basic/process-util.h"
      nm_copy_sd_shared "src/basic/random-util.c"
      nm_copy_sd_shared "src/basic/random-util.h"
      nm_copy_sd_shared "src/basic/set.h"
      nm_copy_sd_shared "src/basic/signal-util.h"
      nm_copy_sd_shared "src/basic/siphash24.h"
      nm_copy_sd_shared "src/basic/socket-util.c"
      nm_copy_sd_shared "src/basic/socket-util.h"
      nm_copy_sd_shared "src/basic/sort-util.h"
      nm_copy_sd_shared "src/basic/sparse-endian.h"
      nm_copy_sd_shared "src/basic/stat-util.c"
      nm_copy_sd_shared "src/basic/stat-util.h"
      nm_copy_sd_shared "src/basic/stdio-util.h"
      nm_copy_sd_shared "src/basic/string-table.c"
      nm_copy_sd_shared "src/basic/string-table.h"
      nm_copy_sd_shared "src/basic/string-util.c"
      nm_copy_sd_shared "src/basic/string-util.h"
      nm_copy_sd_shared "src/basic/strv.c"
      nm_copy_sd_shared "src/basic/strv.h"
      nm_copy_sd_shared "src/basic/time-util.c"
      nm_copy_sd_shared "src/basic/time-util.h"
      nm_copy_sd_shared "src/basic/tmpfile-util.c"
      nm_copy_sd_shared "src/basic/tmpfile-util.h"
      nm_copy_sd_shared "src/basic/umask-util.h"
      nm_copy_sd_shared "src/basic/utf8.c"
      nm_copy_sd_shared "src/basic/utf8.h"
      nm_copy_sd_shared "src/basic/util.c"
      nm_copy_sd_shared "src/basic/util.h"
      f61a12ee
    • Thomas Haller's avatar
      core: fix file permissions for "/var/lib/NetworkManager/secret_key" · dc3a2f9b
      Thomas Haller authored
      Ooherwise, the file has wrong permissions:
      
        # ls -la /var/lib/NetworkManager/secret_key
        ----r-xr-x. 1 root root 50 May 14 13:52 /var/lib/NetworkManager/secret_key
      
      Luckily, /var/lib/NetworkManager should be already
      
        # ls -lad /var/lib/NetworkManager
        drwx------. 2 root root 8192 May 14 13:57 /var/lib/NetworkManager
      
      which mitigates this a bit.
      
      Fixes: dbcb1d6d ('core: let nm_utils_secret_key_read() handle failures internally')
      
      #175
      dc3a2f9b
  4. 13 May, 2019 6 commits
    • Thomas Haller's avatar
      a7bda401
    • Thomas Haller's avatar
      shared: use union instead of _nm_alignas() for static hash-seed · 3712e7a8
      Thomas Haller authored
      We want the the hash-seed array is alined so it can be used both as
      guint, guint32, and guint64 directly. Don't use _nm_alignas() but
      instead just add the fields to the union so we get proper alignment.
      
      While at at, also let the seed argument to c_siphash_init() be aligned
      to 64 integers. c_siphash_init() does not require that, but it tries to
      read the seed as (unaligned) LE 64 bit integers. So, it doesn't hurt.
      3712e7a8
    • Thomas Haller's avatar
      core: don't log plain pointer values for singletons · 58df3f37
      Thomas Haller authored
      Logging pointer values allows to defeat ASLR. Don't do that.
      58df3f37
    • Thomas Haller's avatar
      shared: add NM_HASH_OBFUSCATE_PTR() macro · 78999f9b
      Thomas Haller authored
      We want to log pointer values to indicate the related parties of a
      log message. But we should not, because plain pointer values can be
      used to defeat ASLR.
      
      Instead, we have nm_hash_obfuscate_ptr() to managle a pointer and give
      a distinct (albeit not 100% unique) 64 bit integer for logging.
      
      But for the logging messages to be meaning-full, all related parties
      must use the same static-seed.
      
      Add a macro NM_HASH_OBFUSCATE_PTR() that uses a particular seed.
      78999f9b
    • Thomas Haller's avatar
      core/pppd-plugin: use GDBusConnection in "nm-pppd-plugin.c" · 156f4ee5
      Thomas Haller authored
      - use GDBusConnection instead of GDBusProxy.
      
      - namespace global variables with a "gl" struct.
      
      - don't log __func__. If a log line should have a certain
        topic/tag, the tag should be set manually, not based on the
        function name. It just looks odd. Also, it's unnecessary.
      156f4ee5
    • Thomas Haller's avatar
      pacrunner: refactor pacrunner to use GDBusConnection · 83476a3f
      Thomas Haller authored
      - use GDBusConnection instead of GDBusProxy.
      
      - rename "call-id" to "conf-id". It's really not a "call" but
        configuration that gets added and NMPacrunnerManager ensures that
        the configuration is send to pacrunner.
      
      - let "conf-id" keep a reference to NMPacrunnerManager. For one,
        when we remove configurations we need to call DestroyProxyConfiguration
        to remove it again. We cannot just abort the requests but must linger
        around until our configuration is properly cleaned up. Hence, we
        anyway cannot destroy the NMPacrunnerManager earlier.
        With respect to fixing shutdown not to leak anything, this merely
        means that we must wait (and iterate the main loop) as long as
        NMPacrunnerManager singleton still exits (that is anyway the plan
        how to fix shutdown).
        With these considerations it's also clear that our D-Bus calls must
        have a stricter timeout: NM_SHUTDOWN_TIMEOUT_MS.
        This is also nice because nm_pacrunner_manager_remove() no longer
        needs a manager parameter, it can just rely on having a reference
        to the manager.
      
      - for logging the configuration IDs, don't log pointer values.
        Logging pointer values should be avoided as it defeats ASLR.
        Instead, give them a "log_id" number.
      
      - pacrunner is a D-Bus activatable service. D-Bus activatable services
        needs special care. We don't want to start it over and over again.
        Instead, we only try to "StartServiceByName" if
      
          - we have any configuration to add
      
          - if pacrunner is currently confirmed not to be running (by watching
            name owner changes)
      
          - we didn't try to start it already. That means, only start it
            at the beginning and afterwards set a flag to block it. When
            we see pacrunner appear on D-Bus we always clear that flag,
            that means if pacrunner drops of, we will try to restart it
            (once).
      83476a3f
  5. 12 May, 2019 15 commits
    • Thomas Haller's avatar
      auth-manager: don't watch polkit's D-Bus name and don't emit change signal... · cbdb4981
      Thomas Haller authored
      auth-manager: don't watch polkit's D-Bus name and don't emit change signal when NameOwner disconnects
      
      PolicyKit is a D-Bus activatable service. I don't think it exits on idle (but maybe
      it does, it certainly should).
      
      Anyway, NetworkManager was watching the NameOwner of polkit and if the name was lost(!)
      it would emit a NM_AUTH_MANAGER_SIGNAL_CHANGED, which causes the internal code to re-authenticate
      right away. That means, if you stop policy kit, NetworkManager will ask it right away and
      D-Bus activate it. This is not right.
      
      In fact, we don't have to care about the name owner at all. Whenever we make a request,
      we just make it and D-Bus activate the service as needed. If polkit starts, it emits a
      Changed signal that we watch on D-Bus. That is the only moment when we should actually
      emit NM_AUTH_MANAGER_SIGNAL_CHANGED, not when polkit disconnects.
      cbdb4981
    • Thomas Haller's avatar
      auth-manager: drop GDBusProxy and use GDBusConnection directly · 6153cb00
      Thomas Haller authored
      Aside avoiding the unnecessary overhead of GDBusProxy, this simplifies
      NMAuthManager because the instance is ready from the start to use D-Bus.
      
      Previously, in the early phase requests needed to be queued until
      GDBusProxy could be created asynchronously. Now, there is nothing
      asynchronous involved during construction of the NMAuthManager (and
      of course there are no blocking calls).
      6153cb00
    • Thomas Haller's avatar
      458a5e65
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      all: use nm_clear_g_dbus_connection_signal() helper · 309271ac
      Thomas Haller authored
      I also like this because it's non-obvious that subscription IDs from
      GDBusConnection are "guint" (contrary to signal handler IDs which are
      "gulong"). So, by using this API you get a compiler error when using the
      wrong type.
      In the past, when switching to nm_clear_g_signal_handler() this uncovered
      multiple bugs where the wrong type was used to hold the ID.
      309271ac
    • Thomas Haller's avatar
      f7fff620
    • Thomas Haller's avatar
      all: use nm_dbus_connection_signal_subscribe_name_owner_changed() · b9e2fccc
      Thomas Haller authored
      ... and nm_dbus_connection_call_get_name_owner().
      b9e2fccc
    • Thomas Haller's avatar
      shared: add nm_dbus_connection_signal_subscribe_name_owner_changed() helper · 8ffa7568
      Thomas Haller authored
      ... and nm_dbus_connection_call_get_name_owner().
      
      We are going to use GDBusConnection more instead of GDBusProxy. Hence,
      these two functions are the standard repertoire and used over and over.
      
      Their arguments are complicated enough to warrant a small helper.
      8ffa7568
    • Thomas Haller's avatar
      655e6bb1
    • Thomas Haller's avatar
      core/dbus: aquire D-Bus name earlier before initializing NMPlatform/NMNetns singletons · a381b399
      Thomas Haller authored
      Aquiring the bus early tells systemd that NetworkManager is started.
      Do that even before setting up/creating the singletons for NMPlatform
      and NMNetns.
      
      This is a trick so that NetworkManager is considered earlier to be started.
      But it's right, because we can and should create the D-Bus socket as early as
      possible to let other services (that order After=network.target) can already
      start too.
      
      Of course, NetworkManager is not yet fully running and it will take a
      while longer until it actually replies on D-Bus. But the requests are
      not lost and services that talk to NetworkManager that early can in the
      meantime to other startup actions.
      a381b399
    • Thomas Haller's avatar
      auth-manager: re-use D-Bus connection from NMDBusManager · 40fb6652
      Thomas Haller authored
      First of all, NMDBusManager takes the system D-Bus connection synchronously, so we
      should avoid API that is asynchronous and first needs to get glib's G_BUS_TYPE_SYSTEM
      instance.
      
      Also, the only reason why NMDBusManager might not have a D-Bus connection is in "initrd"
      configure-and-quit mode. In that mode we also don't need polkit.
      40fb6652
    • Thomas Haller's avatar
      core: use NM_MAIN_DBUS_CONNECTION_GET macro · 1e01c5fe
      Thomas Haller authored
      We will use the D-Bus connection of our NMDBusManager singleton more.
      Use a macro.
      
      - it's shorter to type and it's one distinct word.
      
      - the name indicates what this is: the main D-Bus connection singleton.
        By searching for this name we can find all users that care about using
        this singleton.
      1e01c5fe
    • Thomas Haller's avatar
      143b6e41
    • Thomas Haller's avatar
      core/dbus: let NMDBusManager create a D-Bus connection in "configure-and-quit=true" mode · 49ed2079
      Thomas Haller authored
      Note that various components (NMFirewallManager, NMAuthManager,
      NMConnectivity, etc.pp) all request their own GDBusConnection from
      glib's G_BUS_TYPE_SYSTEM singleton.
      
      In the future, let them instead use the D-Bus connection that
      NMDBusManager already has.
      
      - NMDBusManager also uses g_bus_get(G_BUS_TYPE_SYSTEM), so in practice this
        is just the same GDBusConnection instance.
      
      - if it would not be the same GDBusConnection instance, it would
        be more correct/logical to use the one that NMDBusManager uses.
      
      - NMDBusManager already aquired the GDBusConnection synchronously
        and it's ready for use. On the other hand, g_bus_get()/g_bus_get_sync()
        has the notion that getting the singleton cannot be done without
        waiting/blocking. So at least it involves locking or even dispatching
        the async reply on D-Bus.
      
      - in "configure-and-quit=initrd" we really don't have D-Bus available.
        NMDBusManager should control whether the other components use D-Bus
        or not. For example, NMFirewallManager should not ask glib for a
        G_BUS_TYPE_SYSTEM singleton only to later find out that it doesn't work.
      
      So if these components would reuse NMDBusManager's GDBusConnection,
      then it must have the connection also in regular "configure-and-quit=true"
      mode. In this case, we are in late boot and want do connectivity
      checking and talk to firewalld.
      49ed2079
    • Thomas Haller's avatar
      core: minor cleanup · 4e24ebcc
      Thomas Haller authored
      4e24ebcc