1. 11 Jun, 2019 2 commits
  2. 20 May, 2019 1 commit
  3. 19 May, 2019 1 commit
  4. 14 May, 2019 1 commit
    • Thomas Haller's avatar
      core: fix file permissions for "/var/lib/NetworkManager/secret_key" · 869ac551
      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)
      869ac551
  5. 10 May, 2019 2 commits
    • Thomas Haller's avatar
      settings/d-bus: fix boolean return value of "LoadConnections" · 703864e2
      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)
      703864e2
    • Thomas Haller's avatar
      settings: avoid assertion for LoadConnections D-Bus method with relative paths · 6052b863
      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)
      6052b863
  6. 18 Apr, 2019 1 commit
    • Thomas Haller's avatar
      platform: fix nm_platform_lnk_gre_to_string() for tap links · 88c9767d
      Thomas Haller authored
      Why didn't we get a compiler warning about this bug?
      At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:
      
          CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
        ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                            lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                            ^
      
      Fixes: 4c2862b9 ('platform: add gretap tunnels support')
      (cherry picked from commit dfb899f4)
      (cherry picked from commit ed88c71f)
      (cherry picked from commit 400293d3)
      88c9767d
  7. 10 Apr, 2019 1 commit
  8. 09 Apr, 2019 1 commit
    • Beniamino Galvani's avatar
      libnm-core: fix invalid memory access · 76c283ae
      Beniamino Galvani authored
      When we delete the runner.name property, the runner object itself gets
      deleted if that was the only property, and @runner becomes invalid.
      
       ==13818== Invalid read of size 1
       ==13818==    at 0x55EAF4: nm_streq (nm-macros-internal.h:869)
       ==13818==    by 0x55EAF4: _json_team_normalize_defaults (nm-utils.c:5573)
       ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
       ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
       ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
       ==13818==  Address 0x182a9330 is 0 bytes inside a block of size 13 free'd
       ==13818==    at 0x4839A0C: free (vg_replace_malloc.c:530)
       ==13818==    by 0x4857868: json_delete_string (value.c:763)
       ==13818==    by 0x4857868: json_delete (value.c:975)
       ==13818==    by 0x4851FA1: UnknownInlinedFun (jansson.h:129)
       ==13818==    by 0x4851FA1: hashtable_do_del (hashtable.c:131)
       ==13818==    by 0x4851FA1: hashtable_del (hashtable.c:289)
       ==13818==    by 0x55DFDD: _json_del_object (nm-utils.c:5384)
       ==13818==    by 0x55EA70: _json_delete_object_on_string_match (nm-utils.c:5532)
       ==13818==    by 0x55EADB: _json_team_normalize_defaults (nm-utils.c:5549)
       ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
       ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
       ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
       ==13818==  Block was alloc'd at
       ==13818==    at 0x483880B: malloc (vg_replace_malloc.c:299)
       ==13818==    by 0x4852E8C: lex_scan_string (load.c:389)
       ==13818==    by 0x4852E8C: lex_scan (load.c:620)
       ==13818==    by 0x4853458: parse_object (load.c:738)
       ==13818==    by 0x4853458: parse_value (load.c:862)
       ==13818==    by 0x4853466: parse_object (load.c:739)
       ==13818==    by 0x4853466: parse_value (load.c:862)
       ==13818==    by 0x4853655: parse_json.constprop.7 (load.c:899)
       ==13818==    by 0x48537CF: json_loads (load.c:959)
       ==13818==    by 0x566780: _nm_utils_team_config_set (nm-utils.c:5961)
       ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
       ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
      
      Fixes: a5642fd9 ('libnm-core: team: rework defaults management on runner properties')
      (cherry picked from commit 80a3031a)
      (cherry picked from commit 3fa39f61)
      76c283ae
  9. 02 Apr, 2019 1 commit
  10. 31 Mar, 2019 1 commit
    • Beniamino Galvani's avatar
      build: fix searching dlopen in configure · 13ac745b
      Beniamino Galvani authored
      The 4th argument of AC_SEARCH_LIBS is a list of additional libraries,
      not the name of the variable to hold the result which is always
      ac_cv_search_$function. Also, we should ignore the result when it is
      "none required".
      
      Fixes: 1f2eeb85 ('build: rename $(LIBDL) to $(DL_LIBS) and modify detection')
      (cherry picked from commit bd4957fc)
      (cherry picked from commit 1fa0914b)
      13ac745b
  11. 26 Mar, 2019 1 commit
  12. 15 Mar, 2019 1 commit
  13. 11 Mar, 2019 1 commit
    • Thomas Haller's avatar
      shared/systemd: fix gettid() compat implementation shadowing function from glibc · d160b7b9
      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)
      d160b7b9
  14. 08 Mar, 2019 1 commit
  15. 07 Mar, 2019 2 commits
    • Lubomir Rintel's avatar
      platform/linux: fix detection of IFA_FLAGS support · 27b75bea
      Lubomir Rintel authored
      The condition got accidentally reversed, which means we're always
      undecided and thus wrongly assuming support and never being able to set
      any addresses.
      
      This would bother the few that are struck with 3.4 android kernels. Very
      few indeed, given this got unnoticed since 1.10.
      
      Fixes: 8670aacc ('platform: cleanup detecting kernel support for IFA_FLAGS and IPv6LL')
      (cherry picked from commit d551a089)
      (cherry picked from commit c411b890)
      27b75bea
    • Marco Trevisan's avatar
      nm: Fix syntax on introspection annotations · 3e24e328
      Marco Trevisan authored
      Various annotations were added using multiple colons, while only one has
      to be added or g-ir-introspect will consider them part of the description
      
      !94
      (cherry picked from commit 73005fcf)
      (cherry picked from commit b5bbf8ed)
      3e24e328
  16. 05 Mar, 2019 2 commits
  17. 04 Mar, 2019 1 commit
  18. 27 Feb, 2019 1 commit
  19. 26 Feb, 2019 1 commit
  20. 25 Feb, 2019 2 commits
  21. 23 Feb, 2019 3 commits
  22. 19 Feb, 2019 3 commits
    • Thomas Haller's avatar
      libnm: fix leaking checkpoints from NMManager · 4c694e46
      Thomas Haller authored
      Fixes: c3efedf5
      (cherry picked from commit 10600bdb)
      4c694e46
    • Thomas Haller's avatar
      libnm: fix memleak for NMDeviceTun:hw-address · 38890376
      Thomas Haller authored
      Fixes: 337304f1
      (cherry picked from commit 41ea9fff)
      38890376
    • Thomas Haller's avatar
      libnm: fix duplicate free in nm_client_checkpoint_rollback() · a505ab42
      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)
      a505ab42
  23. 18 Feb, 2019 1 commit
  24. 17 Feb, 2019 6 commits
  25. 15 Feb, 2019 1 commit
  26. 05 Feb, 2019 1 commit
    • Lubomir Rintel's avatar
      platform/linux: fix setting of IFA_ADDRESS without a peer · e2409b18
      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)
      e2409b18