|
|
151578 |
From 7246417f3ba33616846d3c3f3ec097e1b9692de7 Mon Sep 17 00:00:00 2001
|
|
|
151578 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
151578 |
Date: Tue, 7 Jul 2015 09:28:03 -0400
|
|
|
151578 |
Subject: [PATCH] RHEL 7: Reject use of libguestfs-winsupport features except
|
|
|
151578 |
for virt-* tools (RHBZ#1240276).
|
|
|
151578 |
|
|
|
151578 |
---
|
|
|
151578 |
generator/c.ml | 17 +++++++++++++++++
|
|
|
151578 |
1 file changed, 17 insertions(+)
|
|
|
151578 |
|
|
|
151578 |
diff --git a/generator/c.ml b/generator/c.ml
|
|
|
151578 |
index 606c89807..bba57c56f 100644
|
|
|
151578 |
--- a/generator/c.ml
|
|
|
151578 |
+++ b/generator/c.ml
|
|
|
151578 |
@@ -1856,12 +1856,29 @@ and generate_client_actions actions () =
|
|
|
151578 |
pr " const uint64_t progress_hint = 0;\n";
|
|
|
151578 |
|
|
|
151578 |
pr "\n";
|
|
|
151578 |
+
|
|
|
151578 |
enter_event name;
|
|
|
151578 |
check_null_strings c_name style;
|
|
|
151578 |
reject_unknown_optargs c_name style;
|
|
|
151578 |
check_args_validity c_name style;
|
|
|
151578 |
trace_call name c_name style;
|
|
|
151578 |
|
|
|
151578 |
+ (* RHEL 7 *)
|
|
|
151578 |
+ if name = "mount" || name = "mount_ro" || name = "mount_options" ||
|
|
|
151578 |
+ name = "mount_vfs" then (
|
|
|
151578 |
+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
|
|
|
151578 |
+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
|
|
|
151578 |
+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
|
|
|
151578 |
+ pr " error (g, \"mount: unsupported filesystem type\");\n";
|
|
|
151578 |
+ pr " if (trace_flag)\n";
|
|
|
151578 |
+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
|
|
|
151578 |
+ pr " \"%s\", \"-1\");\n" name;
|
|
|
151578 |
+ pr " return %s;\n" (string_of_errcode errcode);
|
|
|
151578 |
+ pr " }\n";
|
|
|
151578 |
+ pr " }\n";
|
|
|
151578 |
+ pr "\n";
|
|
|
151578 |
+ );
|
|
|
151578 |
+
|
|
|
151578 |
(* Calculate the total size of all FileIn arguments to pass
|
|
|
151578 |
* as a progress bar hint.
|
|
|
151578 |
*)
|
|
|
151578 |
--
|
|
|
151578 |
2.14.3
|
|
|
151578 |
|