[PATCH#2][2nd REVIEW?] fake data io module for samba
jra at samba.org
Fri Oct 31 16:26:16 MDT 2014
On Thu, Oct 30, 2014 at 04:50:38PM +0100, Peter Somogyi wrote:
> Hi Jeremy,
> Please find the next attempt of fake io module.
> Missing calls: as stated later, they either do what is expected (ftrunc,
> falloc) or unsupported (aio) or not called (read/write).
> Streams: not supported (documented now), I have no valid business use case for
> However, increased the error to level from 1 to 10 not to get hurt (though I
> haven't met any during my tests).
> Added documentation (man page).
> Review appreciated.
The only thing that worries me is this:
+static ssize_t vfs_fake_io_pread(vfs_handle_struct *handle, files_struct *fsp,
+ void *data, size_t n, off_t offset)
+ return n;
That means any read return is sending uninitialized allocated
server memory contents out onto the wire.
Now that might be OK, as this is a test module - but at the
very least that needs to be documented I think.
Would it be possible to add an additional module specific
parameter, on by default, that changes vfs_fake_io_pread()
static ssize_t vfs_fake_io_pread(vfs_handle_struct *handle, files_struct *fsp,
void *data, size_t n, off_t offset)
"expose server memory contents",
memset(data, '\0', n);
That way you have to set:
"fake_io:expose server memory contents = true"
to be insecure (but correctly measure smbd performace).
Just a thought.
More information about the samba-technical