]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO
authorNoel Power <noel.power@suse.com>
Tue, 27 Apr 2021 15:09:35 +0000 (16:09 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 11 May 2021 15:49:28 +0000 (15:49 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index eabed7eb883073c8499a47e0fb07975458495454..e90443d01a960362dfdb20d793c0544f0c6710e8 100644 (file)
@@ -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,