Pass to rename_internals().
Removes one more use of the struct member original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
struct smb_filename *smb_fname_new = NULL;
char *oldname = NULL;
char *newname = NULL;
+ const char *dst_original_lcomp = NULL;
const char *p;
NTSTATUS status;
bool src_has_wcard = False;
goto out;
}
+ /* Get the last component of the destination for rename_internals(). */
+ dst_original_lcomp = get_original_lcomp(ctx,
+ conn,
+ newname,
+ ucf_flags_dst);
+ if (dst_original_lcomp == NULL) {
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ goto out;
+ }
+
if (stream_rename) {
/* smb_fname_new must be the same as smb_fname_old. */
TALLOC_FREE(smb_fname_new->base_name);
req,
smb_fname_old,
smb_fname_new,
- smb_fname_new->original_lcomp,
+ dst_original_lcomp,
attrs,
false,
src_has_wcard,