virt-v2v/0003-vCenter-fix-parsing-of-HTTP-status-string-RHBZ-18373.patch
Richard W.M. Jones 2f9214744a Reapply patches since we are using git format-patch --submodule=diff
- Don't comment out patch 0029 (the common submodule update).

- Use a common/.gitattributes trick to exclude files from the common
  patch that are not included in virt-v2v tarball.  This also requires
  some sed hacking.

NB: I tried using ':(exclude)...' stuff and it does not work for
submodules, at least not with the git version in RHEL 8.

For more info see private email thread "Customer case requiring our
assistance" in 2023.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
resolves: rhbz#2184183
2023-04-04 08:45:24 +01:00

32 lines
1.1 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From bb94c68c521aa546d3f2e59aa25e388bfd9c5fc5 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 19 May 2020 12:14:18 +0200
Subject: [PATCH] vCenter: fix parsing of HTTP status string (RHBZ#1837328)
vCenter 7 answers with an HTTP/2 status string, so we cannot extract
the status code from it by using fixed positions in that string.
Hence, pick the status code by reading what's after the whitespace.
Tested with vCenter 6.5 and 7.
(cherry picked from commit d2aa82317964d62fcc8dc7b6737773003d04b998)
---
v2v/vCenter.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/v2v/vCenter.ml b/v2v/vCenter.ml
index c28a4ced..4c128b0c 100644
--- a/v2v/vCenter.ml
+++ b/v2v/vCenter.ml
@@ -190,7 +190,9 @@ and fetch_headers_from_url password_file uri sslverify https_url =
| [] ->
dump_response stderr;
error (f_"vcenter: no status code in output of curl command. Is curl installed?")
- | ss -> String.sub (List.hd (List.rev ss)) 9 3 in
+ | ss ->
+ let s = List.hd (List.rev ss) in
+ String.sub s (String.index s ' ' + 1) 3 in
let headers =
List.map (