mirror of
https://github.com/samba-team/samba.git
synced 2025-03-03 12:58:35 +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:
parent
4e585186f2
commit
5572400a97
@ -1048,7 +1048,24 @@ static int cephwrap_fchown(struct vfs_handle_struct *handle, files_struct *fsp,
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
DBG_DEBUG("[CEPH] fchown(%p, %p, %d, %d)\n", handle, fsp, uid, gid);
|
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);
|
DBG_DEBUG("[CEPH] fchown(...) = %d\n", result);
|
||||||
WRAP_RETURN(result);
|
WRAP_RETURN(result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user