summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-05-08 14:27:02 +0100
committerRichard Jones <rjones@redhat.com>2009-05-08 14:27:02 +0100
commitbd7c8ee043dd02e2cfa3eba2ac5875fc34990610 (patch)
treef8818b071ec48e4d3891971e36466b109b898405 /src
parent28e18580c25809050ecc6acd55bf9fe35740ca66 (diff)
downloadlibguestfs-bd7c8ee043dd02e2cfa3eba2ac5875fc34990610.tar.gz
libguestfs-bd7c8ee043dd02e2cfa3eba2ac5875fc34990610.tar.xz
libguestfs-bd7c8ee043dd02e2cfa3eba2ac5875fc34990610.zip
Bug: write_file doesn't work with strings containing ASCII NUL.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/generator.ml b/src/generator.ml
index ef8b3aa0..4679add0 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -1053,7 +1053,12 @@ with length C<size>.
As a special case, if C<size> is C<0>
then the length is calculated using C<strlen> (so in this case
-the content cannot contain embedded ASCII NULs).");
+the content cannot contain embedded ASCII NULs).
+
+I<NB.> Owing to a bug, writing content containing ASCII NUL
+characters does I<not> work, even if the length is specified.
+We hope to resolve this bug in a future version. In the meantime
+use C<guestfs_upload>.");
("umount", (RErr, [String "pathordevice"]), 45, [FishAlias "unmount"],
[InitEmpty, TestOutputList (
@@ -3815,6 +3820,7 @@ and c_quote str =
let str = replace_str str "\r" "\\r" in
let str = replace_str str "\n" "\\n" in
let str = replace_str str "\t" "\\t" in
+ let str = replace_str str "\000" "\\0" in
str
(* Generate a lot of different functions for guestfish. *)