Fix virt-customize --chown invalid format

resolves: RHEL-21899
This commit is contained in:
Richard W.M. Jones 2024-01-19 13:41:19 +00:00
parent 2bd1392fb7
commit 164bfc174f
4 changed files with 72 additions and 6 deletions

View File

@ -0,0 +1,63 @@
From 5f9beb89443f84640efc52ee6cd68f7f880fb66b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 19 Jan 2024 13:22:51 +0000
Subject: [PATCH] builder: Add a test of the --chown parameter
Also update the libguestfs common submodule, pulling in this change
from libguestfs:
generator/customize.ml: Split --chown parameter on ':' character
and this patch to common/mltools:
mltools/libosinfo-c.c: Fix off-by-one error
(cherry picked from commit 299dc5ec2a0bdd9adecef75adc6a5eca0dc685b1)
---
builder/test-virt-builder.sh | 4 ++++
common | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/builder/test-virt-builder.sh b/builder/test-virt-builder.sh
index 705788a3c..f839fd7af 100755
--- a/builder/test-virt-builder.sh
+++ b/builder/test-virt-builder.sh
@@ -69,6 +69,7 @@ virt-builder phony-fedora \
--write '/etc/append6:
' \
--append-line '/etc/append6:line2' \
+ --chown 1:1:/etc/append6 \
--firstboot Makefile --firstboot-command 'echo "hello"' \
--firstboot-install "minicom,inkscape"
@@ -112,6 +113,7 @@ echo append5:
cat /etc/append5
echo append6:
cat /etc/append6
+stat /etc/append6 | grep '^[ug]id:'
echo -----
EOF
@@ -154,6 +156,8 @@ append6:
line2
+uid: 1
+gid: 1
-----" ]; then
echo "$0: unexpected output:"
cat test-virt-builder.out
Submodule common 0dba002c2..54869c987:
diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
index 245d9960a..48ee33445 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")

View File

@ -1,4 +1,4 @@
From 1ea6c78c7fc6a3ebbe818409ba41be6d1f178381 Mon Sep 17 00:00:00 2001 From b5fdf9eac368a1c5df4ddd93ce40884924e6092a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 7 Jul 2015 09:28:03 -0400 Date: Tue, 7 Jul 2015 09:28:03 -0400
Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for

View File

@ -1,4 +1,4 @@
From 3ad2b829e42b535a7a6f01dda06cc9c9d4f09664 Mon Sep 17 00:00:00 2001 From 511de43cdca80381d52360e050bf57f7079f46d6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 21 Nov 2022 13:03:22 +0000 Date: Mon, 21 Nov 2022 13:03:22 +0000
Subject: [PATCH] RHEL: builder: Disable opensuse repository Subject: [PATCH] RHEL: builder: Disable opensuse repository

View File

@ -19,7 +19,7 @@
Summary: Tools to access and modify virtual machine disk images Summary: Tools to access and modify virtual machine disk images
Name: guestfs-tools Name: guestfs-tools
Version: 1.51.6 Version: 1.51.6
Release: 1%{?dist} Release: 2%{?dist}
License: GPL-2.0-or-later AND LGPL-2.0-or-later License: GPL-2.0-or-later AND LGPL-2.0-or-later
# Build only for architectures that have a kernel # Build only for architectures that have a kernel
@ -49,8 +49,9 @@ Source3: copy-patches.sh
# Patches. # Patches.
Patch0001: 0001-Update-common-submodule.patch Patch0001: 0001-Update-common-submodule.patch
Patch0002: 0002-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch Patch0002: 0002-builder-Add-a-test-of-the-chown-parameter.patch
Patch0003: 0003-RHEL-builder-Disable-opensuse-repository.patch Patch0003: 0003-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
Patch0004: 0004-RHEL-builder-Disable-opensuse-repository.patch
%if 0%{patches_touch_autotools} %if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool, gettext-devel BuildRequires: autoconf, automake, libtool, gettext-devel
@ -409,12 +410,14 @@ end
%changelog %changelog
* Mon Dec 11 2023 Richard W.M. Jones <rjones@redhat.com> - 1.51.6-1 * Fri Jan 19 2024 Richard W.M. Jones <rjones@redhat.com> - 1.51.6-2
- Rebase to guestfs-tools 1.51.6 - Rebase to guestfs-tools 1.51.6
- Implement --key all:... - Implement --key all:...
resolves: RHEL-19030 resolves: RHEL-19030
- Fix crash because of off-by-one error - Fix crash because of off-by-one error
resolves: RHEL-19062 resolves: RHEL-19062
- Fix virt-customize --chown invalid format
resolves: RHEL-21899
* Thu Jun 08 2023 Laszlo Ersek <lersek@redhat.com> - 1.50.1-3 * Thu Jun 08 2023 Laszlo Ersek <lersek@redhat.com> - 1.50.1-3
- let virt-inspector recognize "--key /dev/mapper/VG-LV:key:password" - let virt-inspector recognize "--key /dev/mapper/VG-LV:key:password"