From: Noel Power Date: Wed, 28 Apr 2021 16:55:35 +0000 (+0100) Subject: s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used X-Git-Tag: tevent-0.11.0~908 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1928459d388d6665cef0297fe18072b55277bbe1;p=thirdparty%2Fsamba.git s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used --------------- / \ / REST \ / IN \ / PEACE \ / \ | | | SMB_VFS_STREAMINFO | | | | | | 28 April | | 2021 | | | | | *| * * * | * _________)/\\_//(\/(/\)/\//\/\////|_)_______ Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index ce3672c752f..256ab2a5e41 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -628,16 +628,6 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle, return NT_STATUS_INVALID_DEVICE_REQUEST; } -static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1066,7 +1056,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .fget_compression_fn = skel_fget_compression, .set_compression_fn = skel_set_compression, - .streaminfo_fn = skel_streaminfo, .fstreaminfo_fn = skel_fstreaminfo, .get_real_filename_fn = skel_get_real_filename, .connectpath_fn = skel_connectpath, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 02b3c75969f..dfb324d52a3 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -840,21 +840,6 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle, compression_fmt); } -static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams) -{ - return SMB_VFS_NEXT_STREAMINFO(handle, - fsp, - smb_fname, - mem_ctx, - num_streams, - streams); -} - static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1376,7 +1361,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .fget_compression_fn = skel_fget_compression, .set_compression_fn = skel_set_compression, - .streaminfo_fn = skel_streaminfo, .fstreaminfo_fn = skel_fstreaminfo, .get_real_filename_fn = skel_get_real_filename, .connectpath_fn = skel_connectpath, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index dfba1cf7608..1af6bdec1fe 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -1113,13 +1113,6 @@ struct vfs_fn_pointers { char *base_path, char *snap_path); - NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams); - NTSTATUS (*fstreaminfo_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1593,12 +1586,6 @@ struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle, const SMB_STRUCT_STAT *sbuf); uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle, const SMB_STRUCT_STAT *sbuf); -NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams); NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -2059,12 +2046,6 @@ NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, struct files_struct *fsp, uint16_t compression_fmt); -NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams); NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index a5fee959dc8..27b38f50816 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3021,66 +3021,6 @@ static uint64_t vfswrap_fs_file_id(struct vfs_handle_struct *handle, return file_id; } -static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *pnum_streams, - struct stream_struct **pstreams) -{ - SMB_STRUCT_STAT sbuf; - struct stream_struct *tmp_streams = NULL; - int ret; - - if ((fsp != NULL) && (fsp->fsp_flags.is_directory)) { - /* - * No default streams on directories - */ - goto done; - } - - if ((fsp != NULL) && (fsp_get_pathref_fd(fsp) != -1)) { - ret = SMB_VFS_FSTAT(fsp, &sbuf); - } - else { - struct smb_filename *smb_fname_cp = NULL; - - smb_fname_cp = cp_smb_filename_nostream(talloc_tos(), smb_fname); - if (smb_fname_cp == NULL) { - return NT_STATUS_NO_MEMORY; - } - - ret = vfs_stat(handle->conn, smb_fname_cp); - sbuf = smb_fname_cp->st; - TALLOC_FREE(smb_fname_cp); - } - - if (ret == -1) { - return map_nt_error_from_unix(errno); - } - - if (S_ISDIR(sbuf.st_ex_mode)) { - goto done; - } - - tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct, - (*pnum_streams) + 1); - if (tmp_streams == NULL) { - return NT_STATUS_NO_MEMORY; - } - tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA"); - if (tmp_streams[*pnum_streams].name == NULL) { - return NT_STATUS_NO_MEMORY; - } - tmp_streams[*pnum_streams].size = sbuf.st_ex_size; - tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf); - - *pnum_streams += 1; - *pstreams = tmp_streams; - done: - return NT_STATUS_OK; -} - static NTSTATUS vfswrap_fstreaminfo(vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -3878,7 +3818,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .chflags_fn = vfswrap_chflags, .file_id_create_fn = vfswrap_file_id_create, .fs_file_id_fn = vfswrap_fs_file_id, - .streaminfo_fn = vfswrap_streaminfo, .fstreaminfo_fn = vfswrap_fstreaminfo, .get_real_filename_fn = vfswrap_get_real_filename, .connectpath_fn = vfswrap_connectpath, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index f52a519e68d..f1ded4fff04 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -163,7 +163,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, SMB_VFS_OP_FS_FILE_ID, - SMB_VFS_OP_STREAMINFO, SMB_VFS_OP_FSTREAMINFO, SMB_VFS_OP_GET_REAL_FILENAME, SMB_VFS_OP_CONNECTPATH, @@ -303,7 +302,6 @@ static struct { { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" }, { SMB_VFS_OP_FS_FILE_ID, "fs_file_id" }, - { SMB_VFS_OP_STREAMINFO, "streaminfo" }, { SMB_VFS_OP_FSTREAMINFO, "fstreaminfo" }, { SMB_VFS_OP_GET_REAL_FILENAME, "get_real_filename" }, { SMB_VFS_OP_CONNECTPATH, "connectpath" }, @@ -2007,26 +2005,6 @@ static uint64_t smb_full_audit_fs_file_id(struct vfs_handle_struct *handle, return result; } -static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *pnum_streams, - struct stream_struct **pstreams) -{ - NTSTATUS result; - - result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, - pnum_streams, pstreams); - - do_log(SMB_VFS_OP_STREAMINFO, - NT_STATUS_IS_OK(result), - handle, - "%s", - smb_fname_str_do_log(handle->conn, smb_fname)); - - return result; -} static NTSTATUS smb_full_audit_fstreaminfo(vfs_handle_struct *handle, struct files_struct *fsp, @@ -3002,7 +2980,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .snap_check_path_fn = smb_full_audit_snap_check_path, .snap_create_fn = smb_full_audit_snap_create, .snap_delete_fn = smb_full_audit_snap_delete, - .streaminfo_fn = smb_full_audit_streaminfo, .fstreaminfo_fn = smb_full_audit_fstreaminfo, .get_real_filename_fn = smb_full_audit_get_real_filename, .connectpath_fn = smb_full_audit_connectpath, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 230ae35ca05..c4722c3687d 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -630,16 +630,6 @@ NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle, return NT_STATUS_INVALID_DEVICE_REQUEST; } -NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1070,7 +1060,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .fget_compression_fn = vfs_not_implemented_fget_compression, .set_compression_fn = vfs_not_implemented_set_compression, - .streaminfo_fn = vfs_not_implemented_streaminfo, .fstreaminfo_fn = vfs_not_implemented_fstreaminfo, .get_real_filename_fn = vfs_not_implemented_get_real_filename, .connectpath_fn = vfs_not_implemented_connectpath, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index c2bf905a152..7cd9bf0ae25 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1645,30 +1645,6 @@ static uint64_t smb_time_audit_fs_file_id(struct vfs_handle_struct *handle, return result; } -static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *pnum_streams, - struct stream_struct **pstreams) -{ - NTSTATUS result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, - pnum_streams, pstreams); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log_fsp("streaminfo", timediff, fsp); - } - - return result; -} - static NTSTATUS smb_time_audit_fstreaminfo(vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -2839,7 +2815,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .snap_check_path_fn = smb_time_audit_snap_check_path, .snap_create_fn = smb_time_audit_snap_create, .snap_delete_fn = smb_time_audit_snap_delete, - .streaminfo_fn = smb_time_audit_streaminfo, .fstreaminfo_fn = smb_time_audit_fstreaminfo, .get_real_filename_fn = smb_time_audit_get_real_filename, .connectpath_fn = smb_time_audit_connectpath, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 55a993feb4f..7b91499dc2c 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2401,18 +2401,6 @@ uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle, return handle->fns->fs_file_id_fn(handle, sbuf); } -NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle, - struct files_struct *fsp, - const struct smb_filename *smb_fname, - TALLOC_CTX *mem_ctx, - unsigned int *num_streams, - struct stream_struct **streams) -{ - VFS_FIND(streaminfo); - return handle->fns->streaminfo_fn(handle, fsp, smb_fname, mem_ctx, - num_streams, streams); -} - NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx,