Blame SOURCES/0013-libvirt-read-password-file-outside-libvirt-auth-call.patch

7ed5e3
From 207552533f0b4ed2e2d570a827a85a44d4248b78 Mon Sep 17 00:00:00 2001
7ed5e3
From: Pino Toscano <ptoscano@redhat.com>
7ed5e3
Date: Mon, 17 Aug 2020 09:17:51 +0200
7ed5e3
Subject: [PATCH] libvirt: read password file outside libvirt auth callback
7ed5e3
7ed5e3
This way errors that occur while reading the password file are properly
7ed5e3
propagated, instead of being reported as errors of the libvirt
7ed5e3
authentication callback.
7ed5e3
7ed5e3
Reported by: Ming Xie.
7ed5e3
7ed5e3
(cherry picked from commit 76f9f3a0603f33c85d681fe13e24516331c6aea7)
7ed5e3
---
7ed5e3
 v2v/libvirt_utils.ml | 2 +-
7ed5e3
 1 file changed, 1 insertion(+), 1 deletion(-)
7ed5e3
7ed5e3
diff --git a/v2v/libvirt_utils.ml b/v2v/libvirt_utils.ml
7ed5e3
index 4d0b8639..1a24b049 100644
7ed5e3
--- a/v2v/libvirt_utils.ml
7ed5e3
+++ b/v2v/libvirt_utils.ml
7ed5e3
@@ -24,8 +24,8 @@ open Common_gettext.Gettext
7ed5e3
     module. *)
7ed5e3
 
7ed5e3
 let auth_for_password_file ?password_file () =
7ed5e3
+  let password = Option.map read_first_line_from_file password_file in
7ed5e3
   let auth_fn creds =
7ed5e3
-    let password = Option.map read_first_line_from_file password_file in
7ed5e3
     List.map (
7ed5e3
       function
7ed5e3
       | { Libvirt.Connect.typ = Libvirt.Connect.CredentialPassphrase } -> password
7ed5e3
-- 
7ed5e3
2.18.4
7ed5e3