[Libguestfs] [PATCH 1/8 v2] generator: Rearrange argt logically
Richard W.M. Jones
rjones at redhat.com
Fri Oct 22 14:57:22 UTC 2010
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
-------------- next part --------------
>From a94f83cac4fdf3afbd231b249ec146120e116292 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Wed, 20 Oct 2010 10:49:59 +0100
Subject: [PATCH 1/8] generator: Rearrange argt logically (RHBZ#642934,CVE-2010-3851).
This structure has accreted over time. Rearrange the types
into a logical order.
---
generator/generator_types.ml | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/generator/generator_types.ml b/generator/generator_types.ml
index 0ed6f74..03805cf 100644
--- a/generator/generator_types.ml
+++ b/generator/generator_types.ml
@@ -116,6 +116,9 @@ and args = argt list (* Function parameters, guestfs handle is implicit. *)
* possibility in mind.
*)
and argt =
+ | Bool of string (* boolean *)
+ | Int of string (* int (smallish ints, signed, <= 31 bits) *)
+ | Int64 of string (* any 64 bit int *)
| String of string (* const char *name, cannot be NULL *)
| Device of string (* /dev device name, cannot be NULL *)
| Pathname of string (* file name, cannot be NULL *)
@@ -123,19 +126,6 @@ and argt =
| OptString of string (* const char *name, may be NULL *)
| StringList of string(* list of strings (each string cannot be NULL) *)
| DeviceList of string(* list of Device names (each cannot be NULL) *)
- | Bool of string (* boolean *)
- | Int of string (* int (smallish ints, signed, <= 31 bits) *)
- | Int64 of string (* any 64 bit int *)
- (* These are treated as filenames (simple string parameters) in
- * the C API and bindings. But in the RPC protocol, we transfer
- * the actual file content up to or down from the daemon.
- * FileIn: local machine -> daemon (in request)
- * FileOut: daemon -> local machine (in reply)
- * In guestfish (only), the special name "-" means read from
- * stdin or write to stdout.
- *)
- | FileIn of string
- | FileOut of string
(* Opaque buffer which can contain arbitrary 8 bit data.
* In the C API, this is expressed as <const char *, size_t> pair.
* Most other languages have a string type which can contain
@@ -154,6 +144,16 @@ and argt =
* from the user.
*)
| Key of string
+ (* These are treated as filenames (simple string parameters) in
+ * the C API and bindings. But in the RPC protocol, we transfer
+ * the actual file content up to or down from the daemon.
+ * FileIn: local machine -> daemon (in request)
+ * FileOut: daemon -> local machine (in reply)
+ * In guestfish (only), the special name "-" means read from
+ * stdin or write to stdout.
+ *)
+ | FileIn of string
+ | FileOut of string
type flags =
| ProtocolLimitWarning (* display warning about protocol size limits *)
--
1.7.3.1
More information about the Libguestfs
mailing list