From: Samuel Cabrero Date: Thu, 13 May 2021 11:36:31 +0000 (+0200) Subject: s3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used X-Git-Tag: tevent-0.11.0~875 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96f1af04ffce5e276443e390d5d6339dbf17a06d;p=thirdparty%2Fsamba.git s3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used ---------------- / \ / REST \ / IN \ / PEACE \ / \ | | | SMB_VFS_READDIR_ATTR | | | | | | 13 May | | 2021 | | | | | *| * * * | * _________)/\\_//(\/(/\)/\//\/\///\/|_)_______ Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 781c976b5dd..bb98c001d25 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -697,14 +697,6 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, return NT_STATUS_NOT_IMPLEMENTED; } -static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS skel_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1072,7 +1064,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .strict_lock_check_fn = skel_strict_lock_check, .translate_name_fn = skel_translate_name, .fsctl_fn = skel_fsctl, - .readdir_attr_fn = skel_readdir_attr, .freaddir_attr_fn = skel_freaddir_attr, .audit_file_fn = skel_audit_file, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index f6a66d2b8f9..4811bad3b2c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -917,14 +917,6 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, in_len, _out_data, max_out_len, out_len); } -static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data) -{ - return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data); -} - static NTSTATUS skel_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1377,7 +1369,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .strict_lock_check_fn = skel_strict_lock_check, .translate_name_fn = skel_translate_name, .fsctl_fn = skel_fsctl, - .readdir_attr_fn = skel_readdir_attr, .freaddir_attr_fn = skel_freaddir_attr, .audit_file_fn = skel_audit_file, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 3382bb9fa2f..1c076c2c8f6 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -351,6 +351,7 @@ * Version 45 - Remove SMB_VFS_NTIMES * Version 45 - ADD SMB_VFS_FSTREAMINFO * Version 45 - Add SMB_VFS_FREADDIR_ATTR + * Version 45 - Remove SMB_VFS_READDIR_ATTR */ #define SMB_VFS_INTERFACE_VERSION 45 @@ -1270,10 +1271,6 @@ struct vfs_fn_pointers { struct files_struct **fsp, DATA_BLOB *new_cookie); - NTSTATUS (*readdir_attr_fn)(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **attr_data); NTSTATUS (*freaddir_attr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1786,10 +1783,6 @@ NTSTATUS smb_vfs_call_durable_reconnect(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, struct files_struct **fsp, DATA_BLOB *new_cookie); -NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **attr_data); NTSTATUS smb_vfs_call_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -2089,10 +2082,6 @@ NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle, uint32_t in_len, uint8_t **_out_data, uint32_t max_out_len, uint32_t *out_len); -NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data); NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *dirfsp, TALLOC_CTX *mem_ctx, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index e0b0423689c..0f69dcc930f 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -587,11 +587,6 @@ (smb1req), (op), (old_cookie), \ (mem_ctx), (fsp), (new_cookie)) -#define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ - smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data)) -#define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ - smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data)) - #define SMB_VFS_FREADDIR_ATTR(fsp, mem_ctx, attr_data) \ smb_vfs_call_freaddir_attr((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (attr_data)) #define SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, attr_data) \ diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org index b3437ecb7c2..f9d96995d4b 100644 --- a/source3/modules/The_New_VFS.org +++ b/source3/modules/The_New_VFS.org @@ -272,7 +272,7 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_PWRITE_SEND() | [[fsp][fsp]] | - | | SMB_VFS_READ_DFS_PATHAT() | [[Symlink][Symlink]] | Todo | | SMB_VFS_READDIR() | [[fsp][fsp]] | - | -| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | Todo | +| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | - | | SMB_VFS_READLINKAT() | [[Symlink][Symlink]] | - | | SMB_VFS_REALPATH() | [[P2px][P2px]] | - | | SMB_VFS_RECVFILE() | [[fsp][fsp]] | - | @@ -309,7 +309,6 @@ whenever VFS access is done in a piecemeal fashion. | VFS Function | Group | Status | |---------------------------------+----------+--------| | SMB_VFS_SYS_ACL_DELETE_DEF_FD() | [[xpathref][xpathref]] | Todo | -| SMB_VFS_READDIR_ATTRAT() | [[Enum][Enum]] | Todo | | SMB_VFS_FNTIMENS() | [[fsp][fsp]] | - | |---------------------------------+----------+--------| @@ -438,7 +437,6 @@ whenever VFS access is done in a piecemeal fashion. *** AT VFS functions needed for directory enumeration <> - SMB_VFS_GET_DOS_ATTRIBUTES_SEND() - SMB_VFS_GETXATTRAT_SEND() - - SMB_VFS_READDIR_ATTRAT() (NEW) *** Handle based VFS functions not allowed on O_PATH opened handles <> - SMB_VFS_FGETXATTR() - SMB_VFS_FLISTXATTR() diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt index 7b97f8a0fce..003b740ebf0 100644 --- a/source3/modules/The_New_VFS.txt +++ b/source3/modules/The_New_VFS.txt @@ -340,7 +340,7 @@ Table of Contents SMB_VFS_PWRITE_SEND() [fsp] - SMB_VFS_READ_DFS_PATHAT() [Symlink] Todo SMB_VFS_READDIR() [fsp] - - SMB_VFS_READDIR_ATTR() [Path] Todo + SMB_VFS_READDIR_ATTR() [Path] - SMB_VFS_READLINKAT() [Symlink] - SMB_VFS_REALPATH() [P2px] - SMB_VFS_RECVFILE() [fsp] - @@ -399,7 +399,6 @@ Table of Contents VFS Function Group Status ───────────────────────────────────────────────────── SMB_VFS_SYS_ACL_DELETE_DEF_FD() [xpathref] Todo - SMB_VFS_READDIR_ATTRAT() [Enum] Todo SMB_VFS_FNTIMENS() [fsp] - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -556,7 +555,6 @@ Table of Contents • SMB_VFS_GET_DOS_ATTRIBUTES_SEND() • SMB_VFS_GETXATTRAT_SEND() - • SMB_VFS_READDIR_ATTRAT() (NEW) 2.2.7 Handle based VFS functions not allowed on O_PATH opened handles diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 7a0992ea6c5..722a3424c31 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -631,14 +631,6 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle, return result; } -static NTSTATUS vfswrap_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **attr_data) -{ - return NT_STATUS_NOT_SUPPORTED; -} - static NTSTATUS vfswrap_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -3776,7 +3768,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .fdopendir_fn = vfswrap_fdopendir, .readdir_fn = vfswrap_readdir, - .readdir_attr_fn = vfswrap_readdir_attr, .freaddir_attr_fn = vfswrap_freaddir_attr, .seekdir_fn = vfswrap_seekdir, .telldir_fn = vfswrap_telldir, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index d205faee253..508ef491af3 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -225,7 +225,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_DURABLE_DISCONNECT, SMB_VFS_OP_DURABLE_RECONNECT, - SMB_VFS_OP_READDIR_ATTR, SMB_VFS_OP_FREADDIR_ATTR, /* This should always be last enum value */ @@ -348,7 +347,6 @@ static struct { { SMB_VFS_OP_DURABLE_COOKIE, "durable_cookie" }, { SMB_VFS_OP_DURABLE_DISCONNECT, "durable_disconnect" }, { SMB_VFS_OP_DURABLE_RECONNECT, "durable_reconnect" }, - { SMB_VFS_OP_READDIR_ATTR, "readdir_attr" }, { SMB_VFS_OP_FREADDIR_ATTR, "freaddir_attr" }, { SMB_VFS_OP_LAST, NULL } }; @@ -2262,21 +2260,6 @@ static NTSTATUS smb_full_audit_set_compression(vfs_handle_struct *handle, return result; } -static NTSTATUS smb_full_audit_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data) -{ - NTSTATUS status; - - status = SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data); - - do_log(SMB_VFS_OP_READDIR_ATTR, NT_STATUS_IS_OK(status), handle, "%s", - smb_fname_str_do_log(handle->conn, fname)); - - return status; -} - static NTSTATUS smb_full_audit_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -3033,7 +3016,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .durable_cookie_fn = smb_full_audit_durable_cookie, .durable_disconnect_fn = smb_full_audit_durable_disconnect, .durable_reconnect_fn = smb_full_audit_durable_reconnect, - .readdir_attr_fn = smb_full_audit_readdir_attr, .freaddir_attr_fn = smb_full_audit_freaddir_attr, }; diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 257cbd6e7d7..b4139644fef 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -700,14 +700,6 @@ NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle, return NT_STATUS_NOT_IMPLEMENTED; } -NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -1076,7 +1068,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .strict_lock_check_fn = vfs_not_implemented_strict_lock_check, .translate_name_fn = vfs_not_implemented_translate_name, .fsctl_fn = vfs_not_implemented_fsctl, - .readdir_attr_fn = vfs_not_implemented_readdir_attr, .freaddir_attr_fn = vfs_not_implemented_freaddir_attr, .audit_file_fn = vfs_not_implemented_audit_file, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 1115d1cc076..972fec54564 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -2194,27 +2194,6 @@ static NTSTATUS smb_time_audit_set_compression(vfs_handle_struct *handle, return result; } -static NTSTATUS smb_time_audit_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **pattr_data) -{ - NTSTATUS status; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - status = SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log_smb_fname("readdir_attr", timediff, fname); - } - - return status; -} - static NTSTATUS smb_time_audit_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx, @@ -2869,7 +2848,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .durable_cookie_fn = smb_time_audit_durable_cookie, .durable_disconnect_fn = smb_time_audit_durable_disconnect, .durable_reconnect_fn = smb_time_audit_durable_reconnect, - .readdir_attr_fn = smb_time_audit_readdir_attr, .freaddir_attr_fn = smb_time_audit_freaddir_attr, }; diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 15f989b43ee..67a2e67f124 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2978,15 +2978,6 @@ NTSTATUS smb_vfs_call_durable_reconnect(struct vfs_handle_struct *handle, new_cookie); } -NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle, - const struct smb_filename *fname, - TALLOC_CTX *mem_ctx, - struct readdir_attr_data **attr_data) -{ - VFS_FIND(readdir_attr); - return handle->fns->readdir_attr_fn(handle, fname, mem_ctx, attr_data); -} - NTSTATUS smb_vfs_call_freaddir_attr(struct vfs_handle_struct *handle, struct files_struct *fsp, TALLOC_CTX *mem_ctx,