1. 01 Aug, 2014 4 commits
    • Dan Winship's avatar
      libnm: add NetworkManager.h, disallow including individual headers · d0b05b34
      Dan Winship authored
      Add NetworkManager.h, which includes all of the other NM header, and
      require all external users of libnm to use that rather than the
      individual headers.
      
      (An exception is made for nm-dbus-interface.h,
      nm-vpn-dbus-interface.h, and nm-version.h, which can be included
      separately.)
      d0b05b34
    • Dan Winship's avatar
      libnm: remove Since tags and NM_AVAILABLE_IN_* attributes · b4ae6eae
      Dan Winship authored
      Everything currently in libnm has always been there.
      b4ae6eae
    • Dan Winship's avatar
      libnm: add libnm/libnm-core (part 1) · d595f784
      Dan Winship authored
      This commit begins creating the new "libnm", which will replace
      libnm-util and libnm-glib.
      
      The main reason for the libnm-util/libnm-glib split is that the daemon
      needs to link to libnm-util (to get NMSettings, NMConnection, etc),
      but can't link to libnm-glib (because it uses many of the same type
      names as the NetworkManager daemon. eg, NMDevice). So the daemon links
      to only libnm-util, but basically all clients link to both.
      
      With libnm, there will be only a single client-visible library, and
      NetworkManager will internally link against a private "libnm-core"
      containing the parts that used to be in libnm-util.
      
      (The "libnm-core" parts still need to be in their own directory so
      that the daemon can see those header files without also seeing the
      ones in libnm/ that conflict with its own headers.)
      
      [This commit just copies the source code from libnm-util/ to
      libnm-core/, and libnm-glib/ to libnm/:
      
        mkdir -p libnm-core/tests/
        mkdir -p libnm/tests/
        cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/
        rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch]
        cp libnm-util/tests/*.[ch] libnm-core/tests/
        cp libnm-glib/*.[ch] libnm/
        rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch]
        cp libnm-glib/tests/*.[ch] libnm/tests/
      
      ]
      d595f784
    • Thomas Haller's avatar
      libnm-util: fix warning converting between enum types in nm-setting-8021x.c · 22ca4690
      Thomas Haller authored
      clang warns:
      
          make[4]: Entering directory `./NetworkManager/libnm-util'
            CC       nm-setting-8021x.lo
          nm-setting-8021x.c:1824:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                          *out_format = format;
                                      ~ ^~~~~~
          nm-setting-8021x.c:2135:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                          *out_format = format;
                                      ~ ^~~~~~
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      22ca4690
  2. 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
  3. 19 Jun, 2014 4 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
    • Dan Winship's avatar
      libnm-util: fix gtk-doc bugs in NMSetting* properties · 9de24b16
      Dan Winship authored
      Fix misused gtk-doc annotations and incorrectly-identified properties.
      
      In particular, the upcoming introspection-based generate-settings-spec
      expands macro and enum values, so if you use '%' where you should have
      used '#', it will fail to find an expansion, and error out.
      9de24b16
    • Dan Winship's avatar
      libnm-util, libnm-glib: be consistent about "Wi-Fi", "Ethernet", "InfiniBand" in docs · 8487a449
      Dan Winship authored
      We made the UIs consistent last year, but missed the documentation.
      Fix the docs to also consistently use "Wi-Fi" rather than "WiFi",
      "Wifi", "wifi", or "WiFI"; "Ethernet" rather than "ethernet"; and
      "InfiniBand" rather than "Infiniband".
      8487a449
  4. 12 May, 2014 1 commit
  5. 28 Feb, 2014 1 commit
  6. 25 Feb, 2014 2 commits
  7. 24 Feb, 2014 1 commit
  8. 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
  9. 02 Dec, 2013 1 commit
  10. 24 Oct, 2013 1 commit
  11. 13 Jun, 2013 1 commit
  12. 29 May, 2013 1 commit
  13. 28 May, 2013 2 commits
  14. 03 May, 2013 1 commit
  15. 19 Apr, 2013 1 commit
    • Martin Pitt's avatar
      Use %NULL macro in doc strings · 57a9fb3c
      Martin Pitt authored
      Mass-converted "NULL" to "%NULL" in docstrings with
      
        find -name '*.c'| xargs sed -i '/^ \*.*[^%]NULL/ s/NULL\b/%NULL/g'
      57a9fb3c
  16. 26 Mar, 2013 1 commit
  17. 13 Mar, 2013 1 commit
  18. 08 Mar, 2013 1 commit
    • Dan Williams's avatar
      libnm-util: free temporary GByteArray when using NM_SETTING_802_1X_CK_SCHEME_PATH · 2878481c
      Dan Williams authored
      If the certificate's format was valid, but we're asked to refer to it by
      paths instead of using the raw data, 'data' would be leaked.
      
      ==23089== 8,232 (40 direct, 8,192 indirect) bytes in 1 blocks are definitely lost in loss record 5,109 of 5,123
      ==23089==    at 0x4A0881C: malloc (vg_replace_malloc.c:270)
      ==23089==    by 0x39B905488E: g_malloc (gmem.c:159)
      ==23089==    by 0x39B9068CA1: g_slice_alloc (gslice.c:1003)
      ==23089==    by 0x39B9024539: g_array_sized_new (garray.c:195)
      ==23089==    by 0x31FC0146EA: file_to_g_byte_array (crypto.c:319)
      ==23089==    by 0x31FC01543B: crypto_load_and_verify_certificate (crypto.c:606)
      ==23089==    by 0x31FC01ED26: nm_setting_802_1x_set_client_cert (nm-setting-8021x.c:819)
      ==23089==    by 0xC6944A4: eap_tls_reader (reader.c:2316)
      ==23089==    by 0xC692756: fill_8021x (reader.c:2714)
      ==23089==    by 0xC696151: wireless_connection_from_ifcfg (reader.c:2832)
      ==23089==    by 0xC698E3A: connection_from_file (reader.c:4316)
      ==23089==    by 0xC69135C: nm_ifcfg_connection_new (nm-ifcfg-connection.c:119)
      ==23089==
      ==23089== 8,352 (160 direct, 8,192 indirect) bytes in 4 blocks are definitely lost in loss record 5,110 of 5,123
      ==23089==    at 0x4A0881C: malloc (vg_replace_malloc.c:270)
      ==23089==    by 0x39B905488E: g_malloc (gmem.c:159)
      ==23089==    by 0x39B9068CA1: g_slice_alloc (gslice.c:1003)
      ==23089==    by 0x39B9024539: g_array_sized_new (garray.c:195)
      ==23089==    by 0x31FC0146EA: file_to_g_byte_array (crypto.c:319)
      ==23089==    by 0x31FC01543B: crypto_load_and_verify_certificate (crypto.c:606)
      ==23089==    by 0x31FC01E5E6: nm_setting_802_1x_set_ca_cert (nm-setting-8021x.c:538)
      ==23089==    by 0xC694DD8: eap_peap_reader (reader.c:2358)
      ==23089==    by 0xC692756: fill_8021x (reader.c:2714)
      ==23089==    by 0xC696151: wireless_connection_from_ifcfg (reader.c:2832)
      ==23089==    by 0xC698E3A: connection_from_file (reader.c:4316)
      ==23089==    by 0xC69135C: nm_ifcfg_connection_new (nm-ifcfg-connection.c:119)
      2878481c
  19. 13 Feb, 2013 1 commit
    • Dan Winship's avatar
      all: remove pointless NULL checks · d04f2863
      Dan Winship authored
      g_malloc(), etc, never return NULL, by API contract. Likewise, by
      extension, no other glib function ever returns NULL due to lack of
      memory. So remove lots of unnecessary checks (the vast majority of
      which would have immediately crashed had they ever run anyway, since
      g_set_error(), g_warning(), and nm_log_*() all need to allocate
      memory).
      
      https://bugzilla.gnome.org/show_bug.cgi?id=693678
      d04f2863
  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. 26 Sep, 2012 1 commit
    • Dan Winship's avatar
      all: Don't use ctype.h macros · 6878d20a
      Dan Winship authored
      The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use
      glib's ASCII-only versions instead.
      
      Also, replace isascii() with g_ascii_isprint(), since isascii()
      accepts control characters, which isn't what the code wanted in any of
      the places where it was using it.
      6878d20a
  22. 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
  23. 27 Jan, 2012 1 commit
  24. 22 Nov, 2011 1 commit
  25. 23 Aug, 2011 1 commit
  26. 19 Aug, 2011 1 commit
    • Evan Broder's avatar
      settings: add 802.1X setting properties for subject and altsubject matches · 4f38f02a
      Evan Broder authored
      Includes subject_match and phase2_subject_match (string) parameters,
      and altsubject_matches and phase2_altsubject_matches (list of string)
      parameters.
      
      subject_match is matched against a substring of the subject from the
      certificate presented by the remote authentication server. If this
      option is unset, no subject verification is performed.
      
      altsubject_matches are each tested against the alternate subject name
      (altSubjectName) of the certificate presented by the remote
      authentication server. If this option is unset, no verification of the
      altSubjectName is performed.
      4f38f02a
  27. 02 Jul, 2011 2 commits
  28. 10 May, 2011 1 commit
    • Dan Williams's avatar
      libnm-util: clarify certificate and key argument names · ab56b8e9
      Dan Williams authored
      Clarify that these are supposed to be paths in the argument name;
      this shouldn't break API as it's just an argument rename.  Helps
      users figure out what the argument should be without as much trouble
      as 'value', which is what it was before.
      ab56b8e9
  29. 04 Mar, 2011 1 commit
  30. 02 Mar, 2011 1 commit
    • Dan Williams's avatar
      libnm-util: rework certificate and private key handling · 28e6523b
      Dan Williams authored
      First, it was not easily possible to set a private key without
      also providing a password.  This used to be OK, but now with
      secret flags it may be the case that when the connection is read,
      there's no private key password.  So functions that set the
      private key must account for NULL passwords.
      
      Unfortunately, the crytpo code did not handle this case well.
      We need to be able to independently (a) verify that a file looks
      like a certificate or private key and (b) that a given password
      decrypts a private key.  Previously the crypto code would fail
      to verify the file when the password was NULL.
      
      So this change fixes up the crytpo code for a more distinct
      split between these two operations, such that if no password is
      given, the file is still checked to ensure that it's a private
      key or a certificate.  If a password is given, the password is
      checked against the private key file.
      
      This commit also changes how private keys and certificates were
      handled with the BLOB scheme.  Previously only the first certificate
      or first private key was included in the property data, while now
      the entire file is encoded in the data.  This is intended to fix
      cases where multiple private keys or certificates are present in
      a PEM file.  It also allows clients to push certificate data to
      NetworkManager for storage in system settings locations, which was
      not as flexible before when only part of the certificate or key
      was sent as the data.
      28e6523b