Blame SOURCES/0001-libvirt-make-use-of-libvirt-s-default-auth-handler-R.patch

62f9b7
From 2ab37349cf37d0ffdb9929ca24c2a024600a4848 Mon Sep 17 00:00:00 2001
62f9b7
From: Pino Toscano <ptoscano@redhat.com>
62f9b7
Date: Thu, 21 May 2020 13:32:21 +0200
62f9b7
Subject: [PATCH] libvirt: make use of libvirt's default auth handler
62f9b7
 (RHBZ#1838425)
62f9b7
62f9b7
Use the default libvirt authentication handler as base for ours,
62f9b7
overriding it with our callback only in case we have a password to
62f9b7
supply.
62f9b7
62f9b7
(cherry picked from commit ce66cac50179baf2fb8b404f7eba49048c7819b0)
62f9b7
---
62f9b7
 v2v/libvirt_utils.ml | 12 ++++++++----
62f9b7
 1 file changed, 8 insertions(+), 4 deletions(-)
62f9b7
62f9b7
diff --git a/v2v/libvirt_utils.ml b/v2v/libvirt_utils.ml
62f9b7
index 7df17b29..4d0b8639 100644
62f9b7
--- a/v2v/libvirt_utils.ml
62f9b7
+++ b/v2v/libvirt_utils.ml
62f9b7
@@ -33,10 +33,14 @@ let auth_for_password_file ?password_file () =
62f9b7
     ) creds
62f9b7
   in
62f9b7
 
62f9b7
-  {
62f9b7
-    Libvirt.Connect.credtype = [ Libvirt.Connect.CredentialPassphrase ];
62f9b7
-    cb = auth_fn;
62f9b7
-  }
62f9b7
+  let base_auth = Libvirt.Connect.get_auth_default () in
62f9b7
+
62f9b7
+  if password_file = None then
62f9b7
+    base_auth
62f9b7
+  else
62f9b7
+    { base_auth with
62f9b7
+      cb = auth_fn;
62f9b7
+    }
62f9b7
 
62f9b7
 let get_domain conn name =
62f9b7
   let dom =