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

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