1. 18 Dec, 2017 1 commit
  2. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      
      - Except for <config.h> itself. Include it with angle brackets as suggested by
        https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
      8bace23b
  3. 05 Aug, 2015 1 commit
  4. 19 Nov, 2014 1 commit
    • Dan Winship's avatar
      libnm, libnm-util: move settings doc generation to libnm-core · c1448698
      Dan Winship authored
      Move the settings/plugins doc generation from libnm-util to
      libnm-core, since libnm-util isn't being updated for all new
      properties.
      
      With this commit, the keyfile and ifcfg-rh documentation is basically
      unchanged, except that deprecated properties are now gone, and new
      properties have been added, and the sections are in a different order.
      (generate-plugin-docs.pl just outputs the settings in Makefile order,
      and they were unsorted in libnm-util, but are sorted in libnm-core).
      
      The settings documentation used for nm-settings.5, the D-Bus API docs,
      and the nmcli help is changed a bit more at this point, and mostly for
      the worse, since the libnm-core setting properties don't match up with
      the D-Bus API as well as the libnm-util ones do. To be fixed...
      
      (I also removed the "plugins docs" line in each plugin docs comment
      block while moving them, since those blocks will be used for more than
      just plugins soon, and it's sort of obvious anyway.)
      c1448698
  5. 13 Nov, 2014 2 commits
    • Dan Winship's avatar
      libnm*: fix library gettext usage · 53f5e9af
      Dan Winship authored
      Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _()
      will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than
      "gettext (string)" (which will use the program's default domain, which
      works fine for programs in the NetworkManager tree, but not for
      external users). Likewise, we need to call bindtextdomain() so that
      gettext can find the translations if the library is installed in a
      different prefix from the program using it (and
      bind_textdomain_codeset(), so it will know the translations are in
      UTF-8 even if the locale isn't).
      
      (The fact that no one noticed this was broken before is because the
      libraries didn't really start returning useful translated strings much
      until 0.9.10, and none of the out-of-tree clients have been updated to
      actually show those strings to users yet.)
      53f5e9af
    • Dan Winship's avatar
      all: consistently include config.h · 3bfb163a
      Dan Winship authored
      config.h should be included from every .c file, and it should be
      included before any other include. Fix that.
      
      (As a side effect of how I did this, this also changes us to
      consistently use "config.h" rather than <config.h>. To the extent that
      it matters [which is not much], quotes are more correct anyway, since
      we're talking about a file in our own build tree, not a system
      include.)
      3bfb163a
  6. 07 Nov, 2014 1 commit
  7. 12 Oct, 2014 1 commit
    • Thomas Haller's avatar
      libnm-util: don't assert in nm_setting_get_secret_flags() and avoid assertion... · 978724da
      Thomas Haller authored
      libnm-util: don't assert in nm_setting_get_secret_flags() and avoid assertion in agent_secrets_done_cb()
      
      When secret providers return the connection hash in GetSecrets(),
      this hash should only contain secrets. However, some providers also
      return non-secret properties.
      
      for_each_secret() iterated over all entries of the @secrets hash
      and triggered the assertion in nm_setting_get_secret_flags() (see
      below).
      
      NM should not assert against user provided input. Change
      nm_setting_get_secret_flags() to silently return FALSE, if the property
      is not a secret.
      
      Indeed, handling of secrets is very different for NMSettingVpn and
      others. Hence nm_setting_get_secret_flags() has only an inconsistent
      behavior and we have to fix all call sites to do the right thing
      (depending on whether we have a VPN setting or not).
      
      Now for_each_secret() checks whether the property is a secret
      without hitting the assertion. Adjust all other calls of
      nm_setting_get_secret_flags(), to anticipate non-secret flags and
      assert/warn where appropriate.
      
      Also, agent_secrets_done_cb() clears now all non-secrets properties
      from the hash, using the new argument @remove_non_secrets when calling
      for_each_secret().
      
        #0  0x0000003370c504e9 in g_logv () from /lib64/libglib-2.0.so.0
        #1  0x0000003370c5063f in g_log () from /lib64/libglib-2.0.so.0
        #2  0x00007fa4b0c1c156 in get_secret_flags (setting=0x1e3ac60, secret_name=0x1ea9180 "security", verify_secret=1, out_flags=0x7fff7507857c, error=0x0) at nm-setting.c:1091
        #3  0x00007fa4b0c1c2b2 in nm_setting_get_secret_flags (setting=0x1e3ac60, secret_name=0x1ea9180 "security", out_flags=0x7fff7507857c, error=0x0) at nm-setting.c:1124
        #4  0x0000000000463d03 in for_each_secret (connection=0x1deb2f0, secrets=0x1e9f860, callback=0x464f1b <has_system_owned_secrets>, callback_data=0x7fff7507865c) at settings/nm-settings-connection.c:203
        #5  0x000000000046525f in agent_secrets_done_cb (manager=0x1dddf50, call_id=1, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_username=0x1e51710 "thom", agent_has_modify=1, setting_name=0x1e91f90 "802-11-wireless-security",
            flags=NM_SETTINGS_GET_SECRETS_FLAG_ALLOW_INTERACTION, secrets=0x1e9f860, error=0x0, user_data=0x1deb2f0, other_data2=0x477d61 <get_secrets_cb>, other_data3=0x1ea92a0) at settings/nm-settings-connection.c:757
        #6  0x00000000004dc4fd in get_complete_cb (parent=0x1ea6300, secrets=0x1e9f860, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_username=0x1e51710 "thom", error=0x0, user_data=0x1dddf50) at settings/nm-agent-manager.c:1139
        #7  0x00000000004dab54 in req_complete_success (req=0x1ea6300, secrets=0x1e9f860, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_uname=0x1e51710 "thom") at settings/nm-agent-manager.c:502
        #8  0x00000000004db86e in get_done_cb (agent=0x1e89530, call_id=0x1, secrets=0x1e9f860, error=0x0, user_data=0x1ea6300) at settings/nm-agent-manager.c:856
        #9  0x00000000004de9d0 in get_callback (proxy=0x1e47530, call=0x1, user_data=0x1ea10f0) at settings/nm-secret-agent.c:267
        #10 0x000000337380cad2 in complete_pending_call_and_unlock () from /lib64/libdbus-1.so.3
        #11 0x000000337380fdc1 in dbus_connection_dispatch () from /lib64/libdbus-1.so.3
        #12 0x000000342800ad65 in message_queue_dispatch () from /lib64/libdbus-glib-1.so.2
        #13 0x0000003370c492a6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
        #14 0x0000003370c49628 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
        #15 0x0000003370c49a3a in g_main_loop_run () from /lib64/libglib-2.0.so.0
        #16 0x000000000042e5c6 in main (argc=1, argv=0x7fff75078e88) at main.c:644
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      978724da
  8. 29 Aug, 2014 1 commit
  9. 15 Jul, 2014 2 commits
    • Dan Winship's avatar
      libnm-util, libnm-glib: whitespace fixes · 2570c5a1
      Dan Winship authored
      Fix indentation, kill trailing whitespace, split some long lines.
      2570c5a1
    • Dan Winship's avatar
      libnm-util, libnm-glib: standardize copyright/license headers · cb7e1893
      Dan Winship authored
      - Remove list of authors from files that had them; these serve no
        purpose except to quickly get out of date (and were only used in
        libnm-util and not libnm-glib anyway).
      
      - Just say "Copyright", not "(C) Copyright" or "Copyright (C)"
      
      - Put copyright statement after the license, not before
      
      - Remove "NetworkManager - Network link manager" from the few files
        that contained it, and "libnm_glib -- Access network status &
        information from glib applications" from the many files that
        contained it.
      
      - Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
        to files that were missing it.
      cb7e1893
  10. 19 Jun, 2014 2 commits
    • Dan Winship's avatar
      libnm-util: remove NMSetting* GParamSpec docs · cdc15cb2
      Dan Winship authored
      Remove all the GParamSpec docs, since everything now uses the gtk-doc
      docs instead, so there's no point in having two copies of each (which
      are often out of sync anyway).
      
      Since we're touching so many lines anyway, also fix up the indentation
      of the remaining property-installing lines, and add
      G_PARAM_STATIC_STRINGS to each paramspec (so the nick strings don't
      get strduped). Also, be consistent about starting a new line between
      "g_object_class_install_property" and its opening parenthesis.
      cdc15cb2
    • Dan Winship's avatar
      libnm-util: various NMSetting* property doc fixes/improvements · e8577083
      Dan Winship authored
      Fix up various issues with the docs for the NMSetting properties, and
      pull in text from the GParamSpec docs where the GParamSpec docs were
      better (or contained information that is necessary in the context of
      nm-settings.5).
      
      Also, consistently wrap all of the doc comments to the same width (80
      columns).
      e8577083
  11. 15 Jan, 2014 2 commits
  12. 12 Dec, 2013 1 commit
    • Thomas Haller's avatar
      libnm-util: refactor NMSetting name and register_settings · 9d319e6d
      Thomas Haller authored
      - refactor register_settings to allow lookup by GType and
        add the settings name to SettingInfo.
      
      - setting NM_SETTING_NAME is deprecated and should not be set anymore.
        Indeed it has always be a bug, to reset the name to a different value.
        The only valid place to set the name was in the _init() function of
        the derived class itself.
        This is now no longer needed/possible. Instead the name get's
        detected based on the registered setting types. This makes use of
        the registered metadata that is available anyway since every
        usable setting has to register itself.
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      9d319e6d
  13. 02 Dec, 2013 1 commit
  14. 22 Oct, 2013 1 commit
    • Thomas Haller's avatar
      core: cleanup freeing of glib collections of pointers · 3eb1d5e9
      Thomas Haller authored
      When freeing one of the collections such as GArray, GPtrArray, GSList,
      etc. it is common that the items inside the connections must be
      freed/unrefed too.
      
      The previous code often iterated over the collection first with
      e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument.
      For one, this has the problem, that g_free has a different signature
      GDestroyNotify then the expected GFunc. Moreover, this can be
      simplified either by setting a clear function
      (g_ptr_array_set_clear_func) or by passing the destroy function to the
      free function (g_slist_free_full).
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      3eb1d5e9
  15. 13 Jun, 2013 1 commit
  16. 28 May, 2013 1 commit
  17. 03 Apr, 2013 1 commit
  18. 13 Mar, 2013 1 commit
  19. 07 Mar, 2013 1 commit
  20. 29 Oct, 2012 1 commit
    • Dan Williams's avatar
      libnm-util: clean up setting registration · 38e3819b
      Dan Williams authored
      Make setting type registration less icky; instead of having the
      connection register all the settings, have the settings themselves
      register that information at library load time.  Putting this sort
      of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard
      than the home-rolled stuff we had before.  Also document the
      priority stuff so when adding new settings, people know what
      priority to use.
      
      (cleanups by jklimes)
      38e3819b
  21. 15 Feb, 2012 1 commit
    • Dan Winship's avatar
      Use glib-mkenums to generate enum types · 839eab55
      Dan Winship authored
      Rather than generating enum classes by hand (and complaining in each
      file that "this should really be standard"), use glib-mkenums.
      
      Unfortunately, we need a very new version of glib-mkenums in order to
      deal with NM's naming conventions and to fix a few other bugs, so just
      import that into the source tree temporarily.
      
      Also, to simplify the use of glib-mkenums, import Makefile.glib from
      https://bugzilla.gnome.org/654395.
      
      To avoid having to run glib-mkenums for every subdirectory of src/,
      add a new "generated" directory, and put the generated enums files
      there.
      
      Finally, use Makefile.glib for marshallers too, and generate separate
      ones for libnm-glib and NetworkManager.
      839eab55
  22. 01 Feb, 2012 1 commit
  23. 05 Jan, 2012 2 commits
  24. 16 Aug, 2011 1 commit
    • Dan Williams's avatar
      settings: preserve agent secrets the right way · 2b2404bb
      Dan Williams authored
      What we want to do here is keep separate caches of system and
      agent secrets.  For system secrets, we cache them because NM
      periodically clears secrets using nm_connection_clear_secrets() to
      ensure they don't stay around in memory, and that transient secrets
      get requested again when they are needed.  For agent secrets, we
      only want them during activation, but a connection read from disk
      will not include agent secrets becuase by definition they aren't
      stored in system settings along with the connection.  Thus we need
      to keep the agent/transient secrets somewhere for the duration of
      the activation to ensure they don't get deleted.
      
      This removes the copy-back hack in update_auth_cb() which copied
      agent/transient secrets back into the connection over top of the
      transient secrets that had been copied back in
      nm_settings_connection_replace_settings().  No reason to copy
      them twice if we keep an agent/transient secrets hash and do
      the right thing with it.
      2b2404bb
  25. 12 Aug, 2011 1 commit
  26. 19 Jul, 2011 2 commits
  27. 07 Jun, 2011 1 commit
    • Dan Williams's avatar
      libnm-util: add new compare flags for ignoring various types of secrets · 864db9f9
      Dan Williams authored
      It turns out we need a way to ignore transient (agent-owned or unsaved)
      secrets during connection comparison.  For example, if the user is
      connecting to a network where the password is not saved, other
      changes could trigger a writeout of that connection to disk when
      connecting, which would the connection back in due to inotify, and the
      re-read connection would then no longer be recognized as the same as
      the in-memory connection due to the transient secret which obviously
      wasn't read in from disk.
      
      Adding these compare flags allows the code to not bother writing the
      connection out to disk when the only difference between the on-disk
      and in-memory connections are secrets that shouldn't get written to
      disk anyway.
      864db9f9
  28. 27 May, 2011 1 commit
  29. 20 May, 2011 1 commit
  30. 18 May, 2011 1 commit
  31. 10 Mar, 2011 1 commit
  32. 13 Feb, 2011 2 commits
  33. 09 Feb, 2011 1 commit