[PATCH v2] s3: libsmbclient: Add server-side copy support

Jeremy Allison jra at samba.org
Wed May 27 12:58:16 MDT 2015


On Tue, May 26, 2015 at 12:10:13AM +0200, David Disseldorp wrote:
> Hi Ross,
> 
> These changes look really good! I have a couple of minor remarks:
> - Please rebase your patch against the current master branch. It
>   currently conflicts with the IO priority changes in
>   e97858433e62c6f3571a65b951c5fc7c47ab8c2f.
> - The libsmbclient.so ABI change requires a corresponding version update
>   (see attached).
> 
> Once you've done that, you can add my tag:
> Reviewed-by: David Disseldorp <ddiss at samba.org>

Indeed - very nice work. Additional fixes before I'll add
my Reviewed-by: (sorry). Not too many :-).

+               state->src_offset += cc_copy_rsp.total_bytes_written;
+               state->dst_offset += cc_copy_rsp.total_bytes_written;
+               state->written += cc_copy_rsp.total_bytes_written;

The above need checking for integer wrap.

+               req_len -= cc_copy->chunks[cc_copy->chunk_count].length;

The above needs checking for underflow (and ensuring it terminates
the loop if so).

+               src_offset += cc_copy->chunks[cc_copy->chunk_count].length;
+               dst_offset += cc_copy->chunks[cc_copy->chunk_count].length;

The above need checking for integer wrap.

+               src_offset += nread;
+               dst_offset += nread;
+               remaining -= nread;

and again, integer wrap and underflow.

Cheers,

	Jeremy.


More information about the samba-technical mailing list