[PATCH 0/13] add SMB2 server-side copy support - V2

David Disseldorp ddiss at suse.de
Wed Nov 28 14:42:16 MST 2012


Hi Jeremy,

On Tue, 27 Nov 2012 14:04:49 -0800
Jeremy Allison <jra at samba.org> wrote:

> Sorry it's taken a while to get to this review. But there
> are a couple of changes I'd still like to see (sorry).

No problem, thanks a lot for the feedback.

> In this patch:
> 
>     smb2_ioctl: add support for FSCTL_SRV_COPYCHUNK
...
> We're actually doing a write operation (via the COPYCHUNK request).
> However, there is no CHECK_WRITE(fsp) call on the destination
> fsp. This function checks that the fsp is open for writing and
> writing is allowed on this share - without it we could be writing
> to a file opened without FILE_WRITE access.
> 
> I think inside fsctl_srv_copychunk_send() you should have a check
> similar to the one inside source3/smbd/smb2_write. Look for
> the CHECK_WRITE macro inside that file for details.

Good catch, looks like a CHECK_READ on the src_fsp is also needed.

> Secondly in this patch:
> 
>     s3-vfs: add copy_chunk vfs hooks
...
> There's a segment:
> 
> --- a/source3/smbd/vfs.c
> +++ b/source3/smbd/vfs.c
> @@ -2157,11 +2157,33 @@ NTSTATUS smb_vfs_call_fsctl(struct vfs_handle_struct *handle,
>                             uint32_t *out_len)
>  {
>         VFS_FIND(fsctl);
> -       return handle->fns->fsctl_fn(handle, fsp, ctx, function, req_flags, 
> -                                    in_data, in_len, out_data, max_out_len, 
> +       return handle->fns->fsctl_fn(handle, fsp, ctx, function, req_flags,
> +                                    in_data, in_len, out_data, max_out_len,
>                                      out_len);
> 
> Looks like just a whitespace fix to me. Can you make that a separate
> change please.

Will do.

> Hope this is ok - shouldn't be too many more goes
> around before we get this into master.

I'll roll these changes into a new patch set and repost.

Cheers, David


More information about the samba-technical mailing list