1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

vfs_ceph: assert renameat() fsps match cwd

As discussed with Jeremy in bug 14232, the vfs_ceph.renameat_fn
implementation currently ignores srcfsp and dstfsp. As a result,
relative smb_fname_src/smb_fname_dest paths will be processed as
relative to cwd.
This is currently a valid assumption, as srcfsp and dstfsp should
always match conn->cwd_fsp. Add an assert to clarify this.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan  9 20:20:05 UTC 2020 on sn-devel-184
This commit is contained in:
David Disseldorp 2020-01-09 18:20:39 +01:00 committed by Jeremy Allison
parent 4b95ea37cb
commit 60b72f589e

View File

@ -612,6 +612,9 @@ static int cephwrap_renameat(struct vfs_handle_struct *handle,
return result;
}
SMB_ASSERT(srcfsp == srcfsp->conn->cwd_fsp);
SMB_ASSERT(dstfsp == dstfsp->conn->cwd_fsp);
result = ceph_rename(handle->data, smb_fname_src->base_name, smb_fname_dst->base_name);
WRAP_RETURN(result);
}