1. 16 4月, 2019 1 次提交
    • L
      util: eliminate duplicate function virDBusMessageRead · 687f5567
      Laine Stump 提交于
      When virDBusMessageRead() and virDBusMessageDecode were first added in
      commit 834c9c94, they were identical except that virDBusMessageRead()
      would unref the message after decoding it.
      
      This difference was eliminated later in commit dc7f3ffc after it
      became apparent that unref-ing the message so soon was never the right
      thing to do. The two identical functions remained though, with the
      tests and virDBus library itself calling the Decode variant, and all
      other users calling the Read variant.
      
      This patch eliminates the duplication, switching all users to
      virDBusMessageDecode (and moving the nice API documentation comment
      from the Read function up to the Decode function).
      Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      687f5567
  2. 10 4月, 2019 2 次提交
  3. 14 3月, 2018 2 次提交
  4. 04 10月, 2017 1 次提交
  5. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  6. 09 5月, 2016 1 次提交
  7. 03 3月, 2016 1 次提交
  8. 02 3月, 2016 1 次提交
    • J
      util: Fix missing initializer for agent · 95aa1017
      John Ferlan 提交于
      In virPolkitAgentCreate neglected to initialize agent to NULL. If
      there was an error in the pipe, then we jump to error and would have
      an issue. Found by coverity.
      95aa1017
  9. 01 3月, 2016 3 次提交
    • J
      util: Fix build without polkit · 254b0289
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      254b0289
    • J
      util: Introduce API's for Polkit text authentication · 6fb96a7f
      John Ferlan 提交于
      Introduce virPolkitAgentCreate and virPolkitAgentDestroy
      
      virPolkitAgentCreate will run the polkit pkttyagent image as an asynchronous
      command in order to handle the local agent authentication via stdin/stdout.
      The code makes use of the pkttyagent --notify-fd mechanism to let it know
      when the agent is successfully registered.
      
      virPolkitAgentDestroy will close the command effectively reaping our
      child process
      6fb96a7f
    • J
      polkit: Adjust message when authentication agent isn't found · 1d35f6ff
      John Ferlan 提交于
      When there isn't a ssh -X type session running and a user has not
      been added to the libvirt group, attempts to run 'virsh -c qemu:///system'
      commands from an otherwise unprivileged user will fail with rather
      generic or opaque error message:
      
          "error: authentication failed: no agent is available to authenticate"
      
      This patch will adjust the error code and message to help reflect the
      situation that the problem is the requested mechanism is UNAVAILABLE and
      a slightly more descriptive error. The result on a failure then becomes:
      
          "error: authentication unavailable: no polkit agent available to
                  authenticate action 'org.libvirt.unix.manage'"
      
      A bit more history on this - at one time a failure generated the
      following type message when running the 'pkcheck' as a subprocess:
      
      "error: authentication failed: polkit\56retains_authorization_after_challenge=1
      Authorization requires authentication but no agent is available."
      
      but, a patch was generated to adjust the error message to help provide
      more details about what failed. This was pushed as commit id '96a108c9'.
      That patch prepended a "polkit: " to the output. It really didn't solve
      the problem, but gave a hint.
      
      After some time it was deemed using DBus API calls directly was a
      better way to go (since pkcheck calls them anyway). So, commit id
      '1b854c76' (more or less) copied the code from remoteDispatchAuthPolkit
      and adjusted it. Then commit id 'c7542573' adjusted the remote.c
      code to call the new API (virPolkitCheckAuth). Finally, commit id
      '308c0c5a' altered the code to call DBus APIs directly. In doing
      so, it reverted the failing error message to the generic message
      that would have been received from DBus anyway.
      1d35f6ff
  10. 09 2月, 2016 1 次提交
  11. 19 11月, 2014 1 次提交
    • E
      virdbus: don't force users to pass int for bool values · 2aa167ca
      Eric Blake 提交于
      Use of an 'int' to represent a 'bool' value is confusing.  Just
      because dbus made the mistake of cementing their 4-byte wire
      format of dbus_bool_t into their API doesn't mean we have to
      repeat the mistake.  With a little bit of finesse, we can
      guarantee that we provide a large-enough value to the DBus
      code, while still copying only the relevant one-byte bool
      to the client code, and isolate the rest of our code base from
      the DBus stupidity.
      
      * src/util/virdbus.c (GET_NEXT_VAL): Add parameter.
      (virDBusMessageIterDecode): Adjust all clients.
      * src/util/virpolkit.c (virPolkitCheckAuth): Use nicer type.
      * tests/virdbustest.c (testMessageSimple, testMessageStruct):
      Test new behavior.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2aa167ca
  12. 25 9月, 2014 1 次提交
  13. 24 9月, 2014 2 次提交