1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-02 08:58:33 +03:00

vfs_ceph: Add path based fallback mechanism for SMB_VFS_CHOWN

Fallback mechanism was missing in cephwrap_fchown() for path based call.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Anoop C S 2023-11-11 11:07:28 +05:30 committed by Jeremy Allison
parent 4e585186f2
commit 5572400a97

View File

@ -1048,7 +1048,24 @@ static int cephwrap_fchown(struct vfs_handle_struct *handle, files_struct *fsp,
int result;
DBG_DEBUG("[CEPH] fchown(%p, %p, %d, %d)\n", handle, fsp, uid, gid);
result = ceph_fchown(handle->data, fsp_get_io_fd(fsp), uid, gid);
if (!fsp->fsp_flags.is_pathref) {
/*
* We can use an io_fd to change ownership.
*/
result = ceph_fchown(handle->data,
fsp_get_io_fd(fsp),
uid,
gid);
} else {
/*
* This is no longer a handle based call.
*/
result = ceph_chown(handle->data,
fsp->fsp_name->base_name,
uid,
gid);
}
DBG_DEBUG("[CEPH] fchown(...) = %d\n", result);
WRAP_RETURN(result);
}