1. 08 Aug, 2019 11 commits
    • Beniamino Galvani's avatar
      device: update exported IP configuration before Reapply() terminates · cd664f52
      Beniamino Galvani authored
      Ensure the exported IP configuration is up to date when the Reapply()
      D-Bus method call terminates.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1731142
      cd664f52
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      secret-agent: rework secret-agent to better handle service shutdown · f6624659
      Thomas Haller authored
      The secret-agent D-Bus API knows 4 methods: GetSecrets, SaveSecrets,
      DeleteSecrets and CancelGetSecrets. When we cancel a GetSecrets
      request, we must issue another CancelGetSecrets to tell the agent
      that the request was aborted. This is also true during shutdown.
      Well, technically, during shutdown we anyway drop off the bus and
      it woudn't matter. In practice, I think we should get this right and
      always cancel properly.
      
      To better handle shutdown change the following:
      
      - each request now takes a reference on NMSecretAgent. That means,
        as long as there are pending requests, the instance stays alive.
        The way to get this right during shutdown, is that NMSecretAgent
        registers itself via nm_shutdown_wait_obj_register() and
        NetworkManager is supposed to keep running as long as requests
        are keeping the instance alive.
      
      - now, the 3 regular methods are cancellable (which means: we are
        no longer interested in the result). CancelGetSecrets is not
        cancellable, but it has a short timeout NM_SHUTDOWN_TIMEOUT_MS
        to handle this. We anyway don't really care about the result,
        aside logging and to be sure that the request fully completed.
      
      - this means, a request (NMSecretAgentCallId) can now immediately
        be cancelled and destroyed, both when the request returns and
        when the caller cancels it. The exception is GetSecrets which
        keeps the request alive while waiting for CancelGetSecrets. But
        this is easily handled by unlinking the call-id and pass it on
        to the CancelGetSecrets callback.
        Previously, the NMSecretAgentCallId was only destroyed when
        the D-Bus call returns, even if it was cancelled earlier. That's
        unnecessary complicated.
      
      - previously, D-Bus requests SaveSecrets and DeleteSecrets were not cancellable.
        That is a problem. We need to be able to cancel them in order to shutdown in
        time.
      
      - use GDBusConnection instead of GDBusProxy. As most of the time, GDBusProxy
        provides features we don't use.
      
      - again, don't log direct pointer values, but obfuscate the indentifiers.
      f6624659
    • Thomas Haller's avatar
      secret-agent: use NMCListElem to track permissions in NMSecretAgent · 52f9c8ec
      Thomas Haller authored
      I don't like GSList.
      52f9c8ec
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      secret-agent: avoid log plain pointer values · a010484c
      Thomas Haller authored
      This defeats ASLR. Obfuscate the pointers.
      a010484c
    • Thomas Haller's avatar
      dbus-manager: drop unused private-socket functions from "nm-dbus-manager.c" · 0dbb870f
      Thomas Haller authored
      These functions are now unused. Drop them.
      
      Also, if we ever reintroduce private unix socket, we sure won't use
      GDBusProxy. Good riddance.
      0dbb870f
    • Thomas Haller's avatar
      secret-agent: drop unused private-socket code from secret-agent · 8a347dbd
      Thomas Haller authored
      In the past, we had a private unix socket. That is long gone.
      Drop the remains in "nm-secret-agent.c". The request here really
      always comes from the main D-Bus connection.
      
      Maybe the private unix socket makes sense and we might resurrect it one
      day. But at that point it would be an entire rewrite and the existing
      code is probably not useful either way. Drop it.
      8a347dbd
    • Thomas Haller's avatar
      secret-agent: enable trace log messages · 58e5e55f
      Thomas Haller authored
      They seem useful for debugging. Don't only enable them --with-more-logging.
      58e5e55f
    • Thomas Haller's avatar
      shared: add nm_c_list_elem_find_first() helper macro · dda32892
      Thomas Haller authored
      - add nm_c_list_elem_find_first() macro that takes a predicate
        and returns the first match.
      
        This macro has a non-function-like behavior, which we often try to
        avoid because macros should behave like functions. In this case it's
        however convenient, so let's do it.
        Also, despite being non-function-like, it should be pretty hard to
        use wrongly.
      
      - rename nm_c_list_elem_find_first() to nm_c_list_elem_find_first_ptr().
      dda32892
    • Thomas Haller's avatar
      n-dhcp4: allocate memory of right size in n_dhcp4_client_probe_option_new() · b80b2505
      Thomas Haller authored
      Non-critical, as the allocated memory was larger than needed.
      
      #224
      b80b2505
  2. 07 Aug, 2019 1 commit
    • Thomas Haller's avatar
      firewall: refactor "nm-firewall-manager.c" to not use GDBusProxy · 1b59d752
      Thomas Haller authored
      - Don't use GDBusProxy but plain GDBusConnection. NMFirewallManager
        is very simple, it doesn't use any of the features that GDBusProxy
        provides.
      
      - make NMFirewallManagerCallId typedef a pointer to the opaque call-id
        struct, instead of the struct itself. It's confusing to have a
        variable that does not look like a pointer and assigning %NULL to
        it.
      
      - internally drop the CBInfo typename and name the call-id variable
        constsistantly as "call_id".
      
      - no need to keep the call-id struct alive after cancelling it. That
        simplifies the lifetime managment of the pending call because the
        completion callback is always invoked shortly before destroying
        the call-id.
      
      - note that the caller is no longer allowed to cancel a call-id from
        inside the completion callback. That just complicates the
        implementation and is not necessary. Assert against that.
      
      !230
      1b59d752
  3. 06 Aug, 2019 12 commits
  4. 05 Aug, 2019 13 commits
  5. 03 Aug, 2019 3 commits