[PATCH] libcli: Overwrite destination in cli_smb2_rename

Ross Lagerwall rosslagerwall at gmail.com
Tue Aug 5 13:11:30 MDT 2014


On Tue, Aug 05, 2014 at 11:47:55AM -0700, Jeremy Allison wrote:
> On Tue, Aug 05, 2014 at 06:42:16PM +0100, Ross Lagerwall wrote:
> > Overwrite the destination in cli_smb2_rename by setting the
> > ReplaceIfExists byte to TRUE.
> > 
> > Signed-off-by: Ross Lagerwall <rosslagerwall at gmail.com>
> > ---
> >  source3/libsmb/cli_smb2_fnum.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
> > index 3a04ea1..1c08f7f 100644
> > --- a/source3/libsmb/cli_smb2_fnum.c
> > +++ b/source3/libsmb/cli_smb2_fnum.c
> > @@ -1910,6 +1910,7 @@ NTSTATUS cli_smb2_rename(struct cli_state *cli,
> >  		goto fail;
> >  	}
> >  
> > +	SCVAL(inbuf.data, 0, 0xFF);
> >  	SIVAL(inbuf.data, 16, converted_size_bytes);
> >  	memcpy(inbuf.data + 20, converted_str, converted_size_bytes);
> >  
> > -- 
> > 2.0.3
> 
> I'd prefer SCVAL(inbuf.data, 0, 0x1), but other
> than that LGTM. Reviewed-by: Jeremy Allison <jra at samba.org>
> 

Yes, that is better.  I had it as 1 and then changed it for some reason.
I assume whoever applies the patch can fix that up?

Cheers
-- 
Ross Lagerwall


More information about the samba-technical mailing list