From: Noel Power Date: Tue, 27 Apr 2021 15:09:35 +0000 (+0100) Subject: s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO X-Git-Tag: tevent-0.11.0~928 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e469af3cf3d0c9f1eb82ec74097d685326a649a;p=thirdparty%2Fsamba.git s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index eabed7eb883..e90443d01a9 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -3872,6 +3872,46 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle, return NT_STATUS_OK; } +static NTSTATUS fruit_fstreaminfo(vfs_handle_struct *handle, + struct files_struct *fsp, + TALLOC_CTX *mem_ctx, + unsigned int *pnum_streams, + struct stream_struct **pstreams) +{ + struct fruit_config_data *config = NULL; + const struct smb_filename *smb_fname = NULL; + NTSTATUS status; + + smb_fname = fsp->fsp_name; + + SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data, + return NT_STATUS_UNSUCCESSFUL); + + DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname)); + + status = SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, + pnum_streams, pstreams); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + fruit_filter_empty_streams(pnum_streams, pstreams); + + status = fruit_streaminfo_meta(handle, fsp, smb_fname, + mem_ctx, pnum_streams, pstreams); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = fruit_streaminfo_rsrc(handle, fsp, smb_fname, + mem_ctx, pnum_streams, pstreams); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + return NT_STATUS_OK; +} + static int fruit_fntimes(vfs_handle_struct *handle, files_struct *fsp, struct smb_file_time *ft) @@ -5209,6 +5249,7 @@ static struct vfs_fn_pointers vfs_fruit_fns = { .lstat_fn = fruit_lstat, .fstat_fn = fruit_fstat, .streaminfo_fn = fruit_streaminfo, + .fstreaminfo_fn = fruit_fstreaminfo, .fntimes_fn = fruit_fntimes, .ftruncate_fn = fruit_ftruncate, .fallocate_fn = fruit_fallocate,