You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
From 1ac21634942d30288dd11005d1d832b8dda86ceb Mon Sep 17 00:00:00 2001
|
|
Message-ID: <1ac21634942d30288dd11005d1d832b8dda86ceb.1769699749.git.jdenemar@redhat.com>
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Mon, 26 Jan 2026 17:54:57 +0000
|
|
Subject: [PATCH] esx: Switch to creating URLs using virURIFormat
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Since libvirt has existing support for creating URIs, use that rather
|
|
than home-rolling our own code without any escaping.
|
|
|
|
As a side-effect this ensures that URLs containing IPv6 addresses are
|
|
escaped correctly, for example as below (note square brackets):
|
|
|
|
https://[1234:56:0:789a:bcde:72ff:fe0a:7baa]:443/sdk
|
|
|
|
Fixes: https://issues.redhat.com/browse/RHEL-138300
|
|
Updates: commit 845210011a9ffd9d17e30c51cbc81ba67c5d3166
|
|
Reported-by: Ming Xie <mxie@redhat.com>
|
|
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
|
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
(cherry picked from commit 13889feb14a24fdf7717960aa5331a0b63ce97ed)
|
|
Resolves: https://issues.redhat.com/browse/RHEL-138300
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
---
|
|
src/esx/esx_driver.c | 14 +++++++-------
|
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
|
|
index 29735e359f..40b7f793cd 100644
|
|
--- a/src/esx/esx_driver.c
|
|
+++ b/src/esx/esx_driver.c
|
|
@@ -588,14 +588,14 @@ esxCreateURL(const char *transport,
|
|
int port,
|
|
const char *path)
|
|
{
|
|
- char *url;
|
|
+ virURI uri = {
|
|
+ .scheme = (char*)transport,
|
|
+ .server = (char*)server,
|
|
+ .port = port,
|
|
+ .path = (char*)path,
|
|
+ };
|
|
|
|
- url = g_strdup_printf("%s://%s:%d%s",
|
|
- transport,
|
|
- server,
|
|
- port,
|
|
- path);
|
|
- return url;
|
|
+ return virURIFormat(&uri);
|
|
}
|
|
|
|
/*
|
|
--
|
|
2.52.0
|
|
|