New API: write for creating files with fixed content (RHBZ#501889).
authorRichard Jones <rjones@redhat.com>
Tue, 18 May 2010 20:51:05 +0000 (21:51 +0100)
committerRichard Jones <rjones@redhat.com>
Thu, 20 May 2010 09:30:12 +0000 (10:30 +0100)
commit3920ad95f6b2db8fbf20aa26692877a09070cb04
treeeb3ffe5779f720c96a33506d1b50807c430ca977
parentbda6cf75f259992bcba23c3c4c2339c50552f491
New API: write for creating files with fixed content (RHBZ#501889).

The guestfs_write call can be used to create small files with
arbitrary 8 bit content, including \0 bytes.

This replaces and deprecates write-file, which cannot be modified
to use BufferIn because of an unfortunate choice in the ABI: the
size parameter to write-file, if zero, means that the daemon tries
to calculate the length of the buffer using strlen.  However this
fails if we pass a zero-length buffer using BufferIn because then
the daemon tries to do strlen on a (really) zero length buffer, not
even containing a terminating \0 character, thus segfaulting.
daemon/file.c
fish/edit.c
fish/fish.c
fish/guestfish.pod
fuse/test-fuse.sh
recipes/clone.sh
src/MAX_PROC_NR
src/generator.ml
src/guestfs.pod
tools/make-test-img.sh