1. 17 Jun, 2014 3 commits
  2. 16 Jun, 2014 13 commits
  3. 13 Jun, 2014 6 commits
    • Dan Williams's avatar
    • Dan Williams's avatar
      ifnet: fix use-after-free and refcounting of invalid changed connections · c44556a1
      Dan Williams authored
      If a valid connection was updated and still valid, and then was
      updated and become invalid, the connection would not be properly
      removed from the ifnet plugin's priv->connections hash, and thus
      would never be disposed.
      
      This was due to using the direct pointer to the connection's UUID
      as the key for the hash table.  When a connection is updated and
      its settings are replaced, the old UUID is freed and replaced with
      a new pointer.  But the ifnet plugin hash table still uses the
      old (now freed) UUID pointer as the key.  Thus when the connection
      is updated and becomes invalid, looking up the UUID in the hash
      table fails to find the connection, and the connection is not
      removed from the hash.
      
      This bug could cause a crash in some cases, if two keys of the
      GHashTable hashed to the same value, in which case GLib would
      call g_str_equal() on the freed pointer.
      
      Since code other than in the ifnet plugin replaces settings,
      we cannot be guaranteed that the pointer won't change.  Avoid all
      that and just strdup() the UUID when using it as a key.
      c44556a1
    • Dan Williams's avatar
      example: fix possible invalid refcounting when changing connections · 72fb1f89
      Dan Williams authored
      Since the pointer to the connection's path could change any time
      commit_changes() is called, it's not safe to use it as the hash
      table key directly.  strdup it instead.
      72fb1f89
    • Dan Williams's avatar
      keyfile: clean up logging connection verify errors · 95e4b6fc
      Dan Williams authored
      Prevents:
      
      Connection failed to verify: (unknown)
         invalid or missing connection property 'blah blah/foo bar'
      
      Simply removing the warning in reader.c is fine, because callers that
      care already log the warning themselves.  Also make the warning in
      update_connection() the same as the warning in new_connection().
      95e4b6fc
    • Dan Williams's avatar
      keyfile: fix use-after-free and refcounting of invalid changed connections · 3aedc94f
      Dan Williams authored
      If a valid connection was updated and still valid, and then was
      updated and become invalid, the connection would not be properly
      removed from the keyfile plugin's priv->connections hash, and thus
      would never be disposed.
      
      This was due to using the direct pointer to the connection's UUID
      as the key for the hash table.  When a connection is updated and
      its settings are replaced, the old UUID is freed and replaced with
      a new pointer.  But the keyfile plugin hash table still uses the
      old (now freed) UUID pointer as the key.  Thus when the connection
      is updated and becomes invalid, looking up the UUID in the hash
      table fails to find the connection, and the connection is not
      removed from the hash.
      
      This bug could cause a crash in some cases, if two keys of the
      GHashTable hashed to the same value, in which case GLib would
      call g_str_equal() on the freed pointer.
      
      Since code other than in the keyfile plugin replaces settings,
      we cannot be guaranteed that the pointer won't change.  Avoid all
      that and just strdup() the UUID when using it as a key.
      
      (also collapses _internal_new_connection() into its only caller)
      3aedc94f
    • Thomas Haller's avatar
  4. 12 Jun, 2014 5 commits
  5. 11 Jun, 2014 5 commits
  6. 10 Jun, 2014 2 commits
  7. 09 Jun, 2014 5 commits
  8. 07 Jun, 2014 1 commit
    • Thomas Haller's avatar
      platform: pass optional padding to _rebase_relative_time_on_now() · 63ef089f
      Thomas Haller authored
      _rebase_relative_time_on_now() is used both by _address_get_lifetime()/nm_platform_ip[46]_address_sync()
      and the to_string() functions.
      
      In the latter case, we want to print the original value, without padding. Otherwise in
      the addresses are printed in the logs with an additional 5 seconds
      padding, which is confusing.
      
      For adding addresses in platform however, we still want to keep the
      padding. So pass it on as additional parameter.
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      63ef089f