mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0083-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch

5ce0c7
From 434dd6ac0634211a48dd8d46c6efa68ef1270ae5 Mon Sep 17 00:00:00 2001
46b2f6
From: "Richard W.M. Jones" <rjones@redhat.com>
46b2f6
Date: Tue, 7 Jul 2015 09:28:03 -0400
46b2f6
Subject: [PATCH] RHEL 8: Reject use of libguestfs-winsupport features except
46b2f6
 for virt-* tools (RHBZ#1240276).
46b2f6
46b2f6
---
46b2f6
 generator/c.ml | 16 ++++++++++++++++
46b2f6
 1 file changed, 16 insertions(+)
46b2f6
46b2f6
diff --git a/generator/c.ml b/generator/c.ml
46b2f6
index 86f7d89a3..b5bb99f53 100644
46b2f6
--- a/generator/c.ml
46b2f6
+++ b/generator/c.ml
46b2f6
@@ -1832,6 +1832,22 @@ and generate_client_actions actions () =
46b2f6
     check_args_validity c_name style;
46b2f6
     trace_call name c_name style;
46b2f6
 
46b2f6
+    (* RHEL 8 *)
46b2f6
+    if name = "mount" || name = "mount_ro" || name = "mount_options" ||
46b2f6
+       name = "mount_vfs" then (
46b2f6
+      pr "  if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
46b2f6
+      pr "    CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
46b2f6
+      pr "    if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
46b2f6
+      pr "      error (g, \"mount: unsupported filesystem type\");\n";
46b2f6
+      pr "      if (trace_flag)\n";
46b2f6
+      pr "        guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
46b2f6
+      pr "                              \"%s\", \"-1\");\n" name;
46b2f6
+      pr "      return %s;\n" (string_of_errcode errcode);
46b2f6
+      pr "    }\n";
46b2f6
+      pr "  }\n";
46b2f6
+      pr "\n";
46b2f6
+    );
46b2f6
+
46b2f6
     (* Calculate the total size of all FileIn arguments to pass
46b2f6
      * as a progress bar hint.
46b2f6
      *)
46b2f6
-- 
5ce0c7
2.18.4
46b2f6