[PATCH] libcli: Overwrite destination in cli_smb2_rename

Jeremy Allison jra at samba.org
Tue Aug 5 15:31:18 MDT 2014


On Tue, Aug 05, 2014 at 02:27:44PM -0700, Jeremy Allison wrote:
> which is what we want for libsmbclient really :-(.
> 
> SMB1 has several methods of renaming, the NTTrans
> rename overwrites the destination by default.

Ah, no - checked more carefully and no it
doesn't :-(.

Inside smbd for NTTrans rename we call:

                        status = rename_internals(ctx, conn, req,
                                                  smb_fname_old, smb_fname_new,
                                                  attrs, False, src_has_wcard,
                                                  dest_has_wcard,
                                                  DELETE_ACCESS);
                        break;

where the 'False' bool is the 'replace_if_exists'
parameter. So we return NT_STATUS_OBJECT_NAME_COLLISION
in this case.

Sorry for the mistake :-(. Yep, looks like we
can't use this in SMB1.

Jeremy.


More information about the samba-technical mailing list