libguestfs/0040-generator-customize.ml-Split-chown-parameter-on-char.patch
Richard W.M. Jones 1574b7d34d Add support for nbd+unix:// URIs
resolves: RHEL-33851
2024-04-24 16:15:12 +01:00

45 lines
1.8 KiB
Diff

From 62e0172825304e3abe8e917d12bc5e5cb45b76cd Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 19 Jan 2024 13:18:00 +0000
Subject: [PATCH] generator/customize.ml: Split --chown parameter on ':'
character
The previous code split it on ',' which was completely wrong.
(It reveals the lack of testing however).
Fixes: commit c08032ebe2763f5e9ce5b14e003721475219d390
Reported-by: Yongkui Guo
(cherry picked from commit e9a728bb22dfa1de5328fbbe7d6d7acad2dbed64)
---
common | 2 +-
generator/customize.ml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Submodule common 0dba002c..54869c98:
diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
index 245d9960..48ee3344 100644
--- a/common/mlcustomize/customize_cmdline.ml
+++ b/common/mlcustomize/customize_cmdline.ml
@@ -157,7 +157,7 @@ let rec argspec () =
let len = String.length arg in
String.sub arg 0 i, String.sub arg (i+1) (len-(i+1))
and split_string_triplet option_name arg =
- match String.nsplit ~max:3 "," arg with
+ match String.nsplit ~max:3 ":" arg with
| [a; b; c] -> a, b, c
| _ ->
error (f_"invalid format for '--%s' parameter, see the man page")
diff --git a/generator/customize.ml b/generator/customize.ml
index e64b45c0..e2c4b605 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -775,7 +775,7 @@ let rec argspec () =
let len = String.length arg in
String.sub arg 0 i, String.sub arg (i+1) (len-(i+1))
and split_string_triplet option_name arg =
- match String.nsplit ~max:3 \",\" arg with
+ match String.nsplit ~max:3 \":\" arg with
| [a; b; c] -> a, b, c
| _ ->
error (f_\"invalid format for '--%%s' parameter, see the man page\")