1. 19 May, 2019 1 commit
  2. 14 May, 2019 1 commit
    • Thomas Haller's avatar
      core: fix file permissions for "/var/lib/NetworkManager/secret_key" · 2146307e
      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
      (cherry picked from commit dc3a2f9b)
      (cherry picked from commit 2d46247c)
      (cherry picked from commit 7a0f8520)
      (cherry picked from commit 869ac551)
      2146307e
  3. 10 May, 2019 2 commits
    • Thomas Haller's avatar
      settings/d-bus: fix boolean return value of "LoadConnections" · add6f1c2
      Thomas Haller authored
      The boolean value is intended to indicate success. It would indicated
      failure due to a bug.
      
      Fixes: 297d4985 ('core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API'):
      (cherry picked from commit 22e830f0)
      (cherry picked from commit e73a5058)
      (cherry picked from commit 1337ebd9)
      (cherry picked from commit 703864e2)
      add6f1c2
    • Thomas Haller's avatar
      settings: avoid assertion for LoadConnections D-Bus method with relative paths · 7a019089
      Thomas Haller authored
        $ busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager/Settings org.freedesktop.NetworkManager.Settings LoadConnections as 1 relative/filename
      
      triggers a g_critical() assertion in nm_utils_file_is_in_path():
      
        ...
        #3  0x00007ffff7a19e7d in g_return_if_fail_warning
            (log_domain=log_domain@entry=0x55555586c333 "NetworkManager", pretty_function=pretty_function@entry=0x55555586c0a0 <__FUNCTION__.38585> "nm_utils_file_is_in_path", expression=expression@entry=0x55555586c010 "abs_filename && abs_filename[0] == '/'") at ../glib/gmessages.c:2767
        #4  0x00005555555f1128 in nm_utils_file_is_in_path (abs_filename=abs_filename@entry=0x555555b56670 "dfd", abs_path=<optimized out>) at src/NetworkManagerUtils.c:1077
        #5  0x00005555555a4779 in load_connection (config=<optimized out>, filename=0x555555b56670 "dfd") at src/settings/plugins/keyfile/nms-keyfile-plugin.c:522
        #6  0x00005555557ce291 in nm_settings_plugin_load_connection (self=0x5555559fd400 [NMSKeyfilePlugin], filename=0x555555b56670 "dfd") at src/settings/nm-settings-plugin.c:70
        #7  0x000055555559ccdf in impl_settings_load_connections
            (obj=<optimized out>, interface_info=<optimized out>, method_info=<optimized out>, connection=<optimized out>, sender=<optimized out>, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], parameters=<optimized out>) at src/settings/nm-settings.c:1439
        #8  0x00005555555a9bf9 in dbus_vtable_method_call
            (connection=0x5555559b91b0 [GDBusConnection], sender=sender@entry=0x555555b5c360 ":1.32283", object_path=object_path@entry=0x7fffe0019070 "/org/freedesktop/NetworkManager/Settings", interface_name=<optimized out>, interface_name@entry=0x7fffe002aa70 "org.freedesktop.NetworkManager.Settings", method_name=<optimized out>,
            method_name@entry=0x7fffe00276b0 "LoadConnections", parameters=parameters@entry=0x555555c4a690, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], user_data=0x5555559a1a00)
            at src/nm-dbus-manager.c:947
        #9  0x00007ffff7c506c4 in call_in_idle_cb (user_data=user_data@entry=0x7fffe0015ed0) at ../gio/gdbusconnection.c:4874
        #10 0x00007ffff7a0e8eb in g_idle_dispatch (source=source@entry=0x7fffe00208a0, callback=0x7ffff7c50590 <call_in_idle_cb>, user_data=0x7fffe0015ed0) at ../glib/gmain.c:5627
        #11 0x00007ffff7a11fd0 in g_main_dispatch (context=0x555555994d00) at ../glib/gmain.c:3189
        #12 0x00007ffff7a11fd0 in g_main_context_dispatch (context=context@entry=0x555555994d00) at ../glib/gmain.c:3854
        #13 0x00007ffff7a12368 in g_main_context_iterate (context=0x555555994d00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3927
        #14 0x00007ffff7a126b3 in g_main_loop_run (loop=0x555555995e60) at ../glib/gmain.c:4123
        #15 0x000055555558a741 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:444
      
      Filter out relative filenames early.
      
      (cherry picked from commit a1b102ea)
      (cherry picked from commit c21171e0)
      (cherry picked from commit 8fe900d3)
      (cherry picked from commit 6052b863)
      7a019089
  4. 18 Apr, 2019 1 commit
  5. 15 Mar, 2019 1 commit
  6. 11 Mar, 2019 1 commit
    • Thomas Haller's avatar
      shared/systemd: fix gettid() compat implementation shadowing function from glibc · b10a7e57
      Thomas Haller authored
      On Fedora rawhide we get the following build failure:
      
          In file included from shared/systemd/src/basic/alloc-util.c:3:
          ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:114:21: error: static declaration of 'gettid' follows non-static declaration
            114 | static inline pid_t gettid(void) {
                |                     ^~~~~~
          In file included from /usr/include/unistd.h:1170,
                           from /usr/include/glib-2.0/gio/gcredentials.h:32,
                           from /usr/include/glib-2.0/gio/gio.h:46,
                           from ./shared/nm-utils/nm-macros-internal.h:31,
                           from ./shared/nm-default.h:293,
                           from ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:22,
                           from shared/systemd/src/basic/alloc-util.c:3:
          /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
             34 | extern __pid_t gettid (void) __THROW;
                |                ^~~~~~
      
      glibc supports now gettid() call ([1]) which conflicts with our compat
      implementation. Rename it.
      
      [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92
      
      (cherry picked from commit 10276322)
      (cherry picked from commit cfb970b2)
      (cherry picked from commit d160b7b9)
      b10a7e57
  7. 07 Mar, 2019 1 commit
  8. 05 Mar, 2019 1 commit
  9. 04 Mar, 2019 1 commit
  10. 19 Feb, 2019 9 commits
    • Beniamino Galvani's avatar
    • Beniamino Galvani's avatar
      device: don't remove routes when the interface is down · 4fc6f5f3
      Beniamino Galvani authored
      In update update_ext_ip_config() we remove from various internal
      configurations those addresses and routes that were removed externally
      by users.
      
      When the interface is brought down, the kernel automatically removes
      routes associated with it and so we should not consider them as
      "removed by users".
      
      Instead, keep them so that they can be restored when the interface
      comes up again.
      
      (cherry picked from commit f069c98c)
      (cherry picked from commit ce2d4035)
      4fc6f5f3
    • Beniamino Galvani's avatar
      ip-config: add @intersect_routes argument to intersect functions · da46fcaf
      Beniamino Galvani authored
      In some cases we want to intersect two IP configurations without
      considering routes.
      
      (cherry picked from commit 8f07b3ac)
      (cherry picked from commit bd79e67c)
      da46fcaf
    • Beniamino Galvani's avatar
      device: fix updating device information after link change · 4775b1df
      Beniamino Galvani authored
      device_link_changed() can't use nm_device_update_from_platform_link()
      to update the device private fields because the latter overwrites
      priv->iface and priv->up, and so the checks below as:
      
        if (info.name[0] && strcmp (priv->iface, info.name) != 0) {
      
      and:
      
        was_up = priv->up;
        priv->up = NM_FLAGS_HAS (info.n_ifi_flags, IFF_UP);
        ...
        if (priv->up && !was_up) {
      
      never succeed.
      
      Fixes: d7f7725a
      (cherry picked from commit 46ed7561)
      (cherry picked from commit 81aaf0ff)
      4775b1df
    • Beniamino Galvani's avatar
      core: improve nm_ip_config_dump() · 33aae9b8
      Beniamino Galvani authored
      Previously we had nm_ip{4,6}_config_dump() for debugging purposes, but
      they were inconveniently printing to stdout and so the output was not
      ordered in the journal.
      
      Implement a unified nm_ip_config_dump() that logs through the usual
      logging mechanism.
      
      (cherry picked from commit 3b49d107)
      (cherry picked from commit 0b1ffdbd)
      33aae9b8
    • Beniamino Galvani's avatar
      device: ensure IP configuration is restored when link goes up · c941b6fa
      Beniamino Galvani authored
      When the link is up and goes down link_changed_cb() schedules
      device_link_changed() to be run later. If the function is dispatched
      when the link is already up again, it does not detect that the link
      was down.
      
      Fix this by storing in the device state that we saw the link down so
      that device_link_changed() can properly restore the IP configuration.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1636715
      https://github.com/NetworkManager/NetworkManager/pull/264
      (cherry picked from commit 7bd193ef)
      (cherry picked from commit 710406e7)
      c941b6fa
    • Thomas Haller's avatar
      libnm: fix leaking checkpoints from NMManager · 4a49df33
      Thomas Haller authored
      Fixes: c3efedf5
      (cherry picked from commit 10600bdb)
      (cherry picked from commit 4c694e46)
      4a49df33
    • Thomas Haller's avatar
      libnm: fix memleak for NMDeviceTun:hw-address · be2da47a
      Thomas Haller authored
      Fixes: 337304f1
      (cherry picked from commit 41ea9fff)
      (cherry picked from commit 38890376)
      be2da47a
    • Thomas Haller's avatar
      libnm: fix duplicate free in nm_client_checkpoint_rollback() · 3fb254fc
      Thomas Haller authored
          #0  0x00007fffea7481e5 in _g_log_abort (breakpoint=1) at gmessages.c:554
          #1  0x00007fffea74951d in g_logv (log_domain=0x7fffea78e00e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcbb0)
              at gmessages.c:1371
          #2  0x00007fffea7496f3 in g_log
              (log_domain=log_domain@entry=0x7fffea78e00e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fffea798320 "%s: assertion '%s' failed")
              at gmessages.c:1413
          #3  0x00007fffea749f2d in g_return_if_fail_warning
              (log_domain=log_domain@entry=0x7fffea78e00e "GLib", pretty_function=pretty_function@entry=0x7fffea799d40 <__func__.4759> "g_atomic_ref_count_dec", expression=expression@entry=0x7fffea799ca1 "g_atomic_int_get (arc) > 0") at gmessages.c:2762
          #4  0x00007fffea754c12 in g_atomic_ref_count_dec (arc=arc@entry=0x5555558c5280) at grefcount.c:260
          #5  0x00007fffea7302c6 in g_hash_table_unref (hash_table=0x5555558c5240) at ghash.c:1101
          #6  0x00007fffea4b6dbc in clear_op_res (simple=0x55555587ed90 [GSimpleAsyncResult]) at gsimpleasyncresult.c:248
          #7  0x00007fffea4b6dbc in g_simple_async_result_finalize (object=0x55555587ed90 [GSimpleAsyncResult]) at gsimpleasyncresult.c:268
          #8  0x00007fffea67b949 in g_object_unref (_object=<optimized out>) at gobject.c:3346
          #9  0x00007fffea67b949 in g_object_unref (_object=0x55555587ed90) at gobject.c:3238
          #10 0x00007fffe95dea2d in checkpoint_rollback_cb (object=<optimized out>, result=<optimized out>, user_data=0x55555587ed90) at libnm/nm-manager.c:1584
          #11 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5c80 [GTask]) at gtask.c:1148
          #12 0x00007fffea4cb196 in g_task_return (task=0x5555558b5c80 [GTask], type=<optimized out>) at gtask.c:1206
          #13 0x00007fffea5096bb in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x5555558b5c80) at gdbusproxy.c:2596
          #14 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5d50 [GTask]) at gtask.c:1148
          #15 0x00007fffea4cb196 in g_task_return (task=0x5555558b5d50 [GTask], type=<optimized out>) at gtask.c:1206
          #16 0x00007fffea4fdd4a in g_dbus_connection_call_done (source=<optimized out>, result=0x5555558b5e20, user_data=0x5555558b5d50) at gdbusconnection.c:5715
          #17 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5e20 [GTask]) at gtask.c:1148
          #18 0x00007fffea4ca86d in complete_in_idle_cb (task=task@entry=0x5555558b5e20) at gtask.c:1162
          #19 0x00007fffea73e97b in g_idle_dispatch (source=0x7fffdc04eb90, callback=0x7fffea4ca860 <complete_in_idle_cb>, user_data=0x5555558b5e20) at gmain.c:5620
          #20 0x00007fffea74206d in g_main_dispatch (context=0x5555557c8410) at gmain.c:3182
          #21 0x00007fffea74206d in g_main_context_dispatch (context=context@entry=0x5555557c8410) at gmain.c:3847
          #22 0x00007fffea742438 in g_main_context_iterate (context=0x5555557c8410, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3920
          #23 0x00007fffea742762 in g_main_loop_run (loop=0x55555584ed00) at gmain.c:4116
      
      Fixes: c3efedf5
      (cherry picked from commit 25a3825b)
      (cherry picked from commit a505ab42)
      3fb254fc
  11. 05 Feb, 2019 1 commit
    • Lubomir Rintel's avatar
      platform/linux: fix setting of IFA_ADDRESS without a peer · 58f7b55b
      Lubomir Rintel authored
      Since commit 9ecdba31 ('platform: create netlink messages directly
      without libnl-route-3') we're unconditionally setting IFA_ADDRESS to
      the peer address, even if there's no peer and it's all zeroes.
      
      The kernel actually stopped caring somewhere around commit caeaba790
      ('ipv6: add support of peer address') in v3.10, but Ubuntu Touch likes
      to run Android's v3.4 on some poorly supported hardware.
      
      Fixes: 9ecdba31
      
      !77
      (cherry picked from commit ef6d461b)
      (cherry picked from commit e2409b18)
      58f7b55b
  12. 04 Feb, 2019 1 commit
    • Beniamino Galvani's avatar
      vpn: add route to vpn gw when parent has a default device route · ef6ad048
      Beniamino Galvani authored
      When the parent device has a device default route (i.e. without
      gateway) and we establish a VPN on top of it, 'ip route get' for the
      VPN gateway returns a device route, which is the same result we get
      for an unreachable VPN gateway. However it is necessary to add the
      route to the gateway or otherwise it will possibly become unreachable
      once the VPN gets activated.
      
      #93
      (cherry picked from commit 797eab2f)
      (cherry picked from commit 6808cd48)
      ef6ad048
  13. 31 Jan, 2019 1 commit
  14. 17 Jan, 2019 1 commit
  15. 16 Jan, 2019 1 commit
  16. 14 Jan, 2019 2 commits
  17. 02 Jan, 2019 1 commit
  18. 13 Dec, 2018 1 commit
  19. 11 Dec, 2018 2 commits
  20. 10 Dec, 2018 1 commit
  21. 01 Dec, 2018 4 commits
  22. 30 Nov, 2018 5 commits
    • Thomas Haller's avatar
      release: update NEWS · 8640180a
      Thomas Haller authored
      8640180a
    • Thomas Haller's avatar
      gitignore: ignore directories added in newer versions · cb46754f
      Thomas Haller authored
      These directories don't exist yet, however are added by newer versions.
      When switching branches, the artifacts from these directories wrongly
      show up in `git status`. Ignore them.
      cb46754f
    • Thomas Haller's avatar
      cli: minor cleanup of _set_fcn_gobject_enum() · f009f168
      Thomas Haller authored
      No need to check again the gtype_class. We did it above already.
      
      (cherry picked from commit 085105fc)
      (cherry picked from commit 3b782ece)
      f009f168
    • Thomas Haller's avatar
      cli: fix setting "serial.parity" enum · 828a3135
      Thomas Haller authored
      The meta data type descriptor must set .get_gtype only for
      GObject properties which are of type int or uint. That is, when
      the enum type cannot be automatically detected.
      
      However, NM_SETTING_SERIAL_PARITY is a g_param_spec_enum()
      of type NM_TYPE_SETTING_SERIAL_PARITY, so setting the get_gtype()
      hook is wrong and leads to a crash
      
         $ /bin/nmcli connection add type gsm autoconnect no con-name t ifname '*' apn xyz serial.parity 5
      
         (process:11086): libnmc-CRITICAL **: 15:04:35.180: file clients/common/nm-meta-setting-desc.c: line 1283 (_set_fcn_gobject_enum): should not be reached
         Segmentation fault (core dumped)
      
      That is because the enum property setter does:
      
          »···if (   has_gtype
          »···    && NM_IN_SET (gtype_prop,
          »···                  G_TYPE_INT,
          »···                  G_TYPE_UINT)
          »···    && G_TYPE_IS_CLASSED (gtype)
          »···    && (gtype_class = g_type_class_ref (gtype))
          »···    && (   (is_flags = G_IS_FLAGS_CLASS (gtype_class))
          »···        || G_IS_ENUM_CLASS (gtype_class))) {
          »···»···/* valid */
      
      meaning, it only allows "has_gtype" if the native "gtype_prop" is
      G_TYPE_INT or G_TYPE_UINT.
      
      Fixes: 9a681238
      (cherry picked from commit 127ac25e)
      (cherry picked from commit 7c78398d)
      828a3135
    • Thomas Haller's avatar
      cli: fix handling uint64 connection property "serial.send-delay" · cf482ae8
      Thomas Haller authored
      libnm currently has only one GObject property of type uint64:
      "serial.send-delay". However, it's broken because uint64 handling
      is not implemented.
      
          $ nmcli connection add type gsm autoconnect no con-name t ifname '*' apn 'xyz' serial.baud 5
          Connection 't' (4c929f17-9fda-41d6-8f90-897f6d46b078) successfully added.
      
          $ nmcli connection show t
          ...
          ipv6.dhcp-duid:                         --
          ipv6.dhcp-send-hostname:                yes
          ipv6.dhcp-hostname:                     --
          ipv6.token:                             --
      
          (process:14016): libnmc-CRITICAL **: 14:08:32.591: file clients/common/nm-meta-setting-desc.c: line 811 (_get_fcn_gobject_int): should not be reached
          serial.baud:                            5
          serial.bits:                            8
          serial.parity:                          none
          serial.stopbits:                        1
          serial.send-delay:                      --
          gsm.number:                             *99#
          ...
      
          $ nmcli connection add type gsm autoconnect no con-name t ifname '*' apn 'xyz' serial.baud 5 serial.send-delay 100
      
          (process:14852): libnmc-CRITICAL **: 14:12:24.259: file clients/common/nm-meta-setting-desc.c: line 1131 (_set_fcn_gobject_int): should not be reached
          Segmentation fault (core dumped)
      
      Fixes: b6d9bdce
      (cherry picked from commit a600b3a3)
      (cherry picked from commit 1b987a53)
      cf482ae8