mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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