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

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