summaryrefslogtreecommitdiff
path: root/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-06 02:26:06 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-06 02:26:06 +0000
commit5957157a0edfe9f07583bdb7530b172da2d7adfd (patch)
tree3bbe9ee8b02c4b84782d71167ed57549c008ce92 /0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
parent568b42b6ea0df8c498b6d8583c24caf101a47dd8 (diff)
automatic import of libguestfsopeneuler24.03_LTS
Diffstat (limited to '0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch')
-rw-r--r--0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch b/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
new file mode 100644
index 0000000..e251a5a
--- /dev/null
+++ b/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
@@ -0,0 +1,66 @@
+From b74c6c8520773c2ef4a4d69b08b70e5ceeb06964 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones@redhat.com>
+Date: Tue, 7 Jul 2015 09:28:03 -0400
+Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for
+ virt-* tools (RHBZ#1240276).
+
+Fix the tests: it doesn't let us use guestfish for arbitrary Windows
+edits.
+---
+ generator/c.ml | 16 ++++++++++++++++
+ test-data/phony-guests/make-windows-img.sh | 1 +
+ tests/charsets/test-charset-fidelity.c | 2 ++
+ 3 files changed, 19 insertions(+)
+
+diff --git a/generator/c.ml b/generator/c.ml
+index 447059b8..0391dd3d 100644
+--- a/generator/c.ml
++++ b/generator/c.ml
+@@ -1846,6 +1846,22 @@ and generate_client_actions actions () =
+ check_args_validity c_name style;
+ trace_call name c_name style;
+
++ (* RHEL 8 *)
++ if name = "mount" || name = "mount_ro" || name = "mount_options" ||
++ name = "mount_vfs" then (
++ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
++ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
++ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
++ pr " error (g, \"mount: unsupported filesystem type\");\n";
++ pr " if (trace_flag)\n";
++ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
++ pr " \"%s\", \"-1\");\n" name;
++ pr " return %s;\n" (string_of_errcode errcode);
++ pr " }\n";
++ pr " }\n";
++ pr "\n";
++ );
++
+ (* Calculate the total size of all FileIn arguments to pass
+ * as a progress bar hint.
+ *)
+diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
+index 16debd12..1c13ddac 100755
+--- a/test-data/phony-guests/make-windows-img.sh
++++ b/test-data/phony-guests/make-windows-img.sh
+@@ -37,6 +37,7 @@ fi
+
+ # Create a disk image.
+ guestfish <<EOF
++set-program virt-testing
+ sparse windows.img-t 512M
+ run
+
+diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
+index 105291dc..5ca4f3b6 100644
+--- a/tests/charsets/test-charset-fidelity.c
++++ b/tests/charsets/test-charset-fidelity.c
+@@ -96,6 +96,8 @@ main (int argc, char *argv[])
+ if (g == NULL)
+ error (EXIT_FAILURE, 0, "failed to create handle");
+
++ guestfs_set_program (g, "virt-testing");
++
+ if (guestfs_add_drive_scratch (g, 1024*1024*1024, -1) == -1)
+ exit (EXIT_FAILURE);
+