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

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