From: Jeremy Allison Date: Thu, 17 Jun 2021 19:28:30 +0000 (-0700) Subject: s3: VFS: syncops: Use real dirfsp for SMB_VFS_RENAMEAT() X-Git-Tag: tevent-0.11.0~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c04d6e8464f6db634e74de720433794e9ae19e8d;p=thirdparty%2Fsamba.git s3: VFS: syncops: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index bc8b641c1b0..679d8b06dcb 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -144,6 +144,8 @@ static int syncops_renameat(vfs_handle_struct *handle, { int ret; + struct smb_filename *full_fname_src = NULL; + struct smb_filename *full_fname_dst = NULL; struct syncops_config_data *config; SMB_VFS_HANDLE_GET_DATA(handle, config, @@ -165,9 +167,26 @@ static int syncops_renameat(vfs_handle_struct *handle, return ret; } + full_fname_src = full_path_from_dirfsp_atname(talloc_tos(), + srcfsp, + smb_fname_src); + if (full_fname_src == NULL) { + errno = ENOMEM; + return ret; + } + full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(), + dstfsp, + smb_fname_dst); + if (full_fname_dst == NULL) { + TALLOC_FREE(full_fname_src); + errno = ENOMEM; + return ret; + } syncops_two_names(handle->conn, - smb_fname_src, - smb_fname_dst); + full_fname_src, + full_fname_dst); + TALLOC_FREE(full_fname_src); + TALLOC_FREE(full_fname_dst); return ret; }