From: Jeremy Allison Date: Wed, 23 Jun 2021 19:06:19 +0000 (-0700) Subject: vfs: RIP SMB_VFS_GETXATTR() X-Git-Tag: tevent-0.11.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99dd56c5fb5922eed9ec3181fc5ea092833e6f39;p=thirdparty%2Fsamba.git vfs: RIP SMB_VFS_GETXATTR() .--. .-, .-..-.__ .'(`.-` \_.-'-./` |\_( "\__ __.>\ '; _;---,._| / __/`'--) /.--. : |/' _.--.<| / | | _..-' `\ /' /` /_/ _/_/ >_.-``-. `Y /' _;---.`|/)))) '` .-''. \|: .' __, .-'"` .'--._ `-: \/: /' '.\ _|_ /.'`\ :; /' `- `-|-` -` | | | :.; : | .-'~^~`-. |: | .' _ _ `. |:. | | |_) | |_) | :. : | | | \ | | | : ; | | | : ; | | SMB_VFS | : ; | | GETXATTR | : ; | | | .jgs. : ; | | -."-/\\\/:::. `\."-._'."-"_\\-| |///."- " -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-". Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index a65deaf3204..25241feeb26 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -821,16 +821,6 @@ static int skel_sys_acl_delete_def_fd(vfs_handle_struct *handle, return -1; } -static ssize_t skel_getxattr(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - errno = ENOSYS; - return -1; -} - struct skel_getxattrat_state { struct vfs_aio_state aio_state; ssize_t xattr_size; @@ -1069,7 +1059,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .sys_acl_delete_def_fd_fn = skel_sys_acl_delete_def_fd, /* EA operations. */ - .getxattr_fn = skel_getxattr, .getxattrat_send_fn = skel_getxattrat_send, .getxattrat_recv_fn = skel_getxattrat_recv, .fgetxattr_fn = skel_fgetxattr, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 87f974c214b..77121259550 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -1081,15 +1081,6 @@ static int skel_sys_acl_delete_def_fd(vfs_handle_struct *handle, return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FD(handle, fsp); } -static ssize_t skel_getxattr(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - return SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size); -} - struct skel_getxattrat_state { struct vfs_aio_state aio_state; ssize_t xattr_size; @@ -1374,7 +1365,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .sys_acl_delete_def_fd_fn = skel_sys_acl_delete_def_fd, /* EA operations. */ - .getxattr_fn = skel_getxattr, .getxattrat_send_fn = skel_getxattrat_send, .getxattrat_recv_fn = skel_getxattrat_recv, .fgetxattr_fn = skel_fgetxattr, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index aa2801054b2..ee6e48a62d1 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -359,6 +359,7 @@ * Version 45 - Remove SYS_ACL_GET_FILE * Version 45 - Remove SYS_ACL_BLOB_GET_FILE * Version 45 - Add SMB_VFS_FCHFLAGS + * Version 45 - Remove SMB_VFS_GETXATTR */ #define SMB_VFS_INTERFACE_VERSION 45 @@ -1227,11 +1228,6 @@ struct vfs_fn_pointers { struct files_struct *fsp); /* EA operations. */ - ssize_t (*getxattr_fn)(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size); struct tevent_req *(*getxattrat_send_fn)( TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -1733,11 +1729,6 @@ int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct *handle, SMB_ACL_T theacl); int smb_vfs_call_sys_acl_delete_def_fd(struct vfs_handle_struct *handle, struct files_struct *fsp); -ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size); struct tevent_req *smb_vfs_call_getxattrat_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -2138,11 +2129,6 @@ int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, SMB_ACL_T theacl); int vfs_not_implemented_sys_acl_delete_def_fd(vfs_handle_struct *handle, files_struct *fsp); -ssize_t vfs_not_implemented_getxattr(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size); struct tevent_req *vfs_not_implemented_getxattrat_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 0c7ce1c5d61..c20db416b54 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -499,11 +499,6 @@ #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FD(handle, fsp) \ smb_vfs_call_sys_acl_delete_def_fd((handle)->next, (fsp)) -#define SMB_VFS_GETXATTR(conn,smb_fname,name,value,size) \ - smb_vfs_call_getxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size)) -#define SMB_VFS_NEXT_GETXATTR(handle,smb_fname,name,value,size) \ - smb_vfs_call_getxattr((handle)->next,(smb_fname),(name),(value),(size)) - #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \ xattr_name, alloc_hint) \ smb_vfs_call_getxattrat_send((mem_ctx),(ev), \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index b96badc0de2..e4f6510ec0b 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3434,15 +3434,6 @@ static int vfswrap_sys_acl_delete_def_fd(vfs_handle_struct *handle, Extended attribute operations. *****************************************************************/ -static ssize_t vfswrap_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - return getxattr(smb_fname->base_name, name, value, size); -} - struct vfswrap_getxattrat_state { struct tevent_context *ev; files_struct *dir_fsp; @@ -4041,7 +4032,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .sys_acl_delete_def_fd_fn = vfswrap_sys_acl_delete_def_fd, /* EA operations. */ - .getxattr_fn = vfswrap_getxattr, .getxattrat_send_fn = vfswrap_getxattrat_send, .getxattrat_recv_fn = vfswrap_getxattrat_recv, .fgetxattr_fn = vfswrap_fgetxattr, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 1c11737964e..5dbfb19f4c0 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -202,7 +202,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_SYS_ACL_DELETE_DEF_FD, /* EA operations. */ - SMB_VFS_OP_GETXATTR, SMB_VFS_OP_GETXATTRAT_SEND, SMB_VFS_OP_GETXATTRAT_RECV, SMB_VFS_OP_FGETXATTR, @@ -329,7 +328,6 @@ static struct { { SMB_VFS_OP_SYS_ACL_BLOB_GET_FD, "sys_acl_blob_get_fd" }, { SMB_VFS_OP_SYS_ACL_SET_FD, "sys_acl_set_fd" }, { SMB_VFS_OP_SYS_ACL_DELETE_DEF_FD, "sys_acl_delete_def_fd" }, - { SMB_VFS_OP_GETXATTR, "getxattr" }, { SMB_VFS_OP_GETXATTRAT_SEND, "getxattrat_send" }, { SMB_VFS_OP_GETXATTRAT_RECV, "getxattrat_recv" }, { SMB_VFS_OP_FGETXATTR, "fgetxattr" }, @@ -2613,24 +2611,6 @@ static int smb_full_audit_sys_acl_delete_def_fd(vfs_handle_struct *handle, return result; } -static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, void *value, size_t size) -{ - ssize_t result; - - result = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size); - - do_log(SMB_VFS_OP_GETXATTR, - (result >= 0), - handle, - "%s|%s", - smb_fname_str_do_log(handle->conn, smb_fname), - name); - - return result; -} - struct smb_full_audit_getxattrat_state { struct vfs_aio_state aio_state; vfs_handle_struct *handle; @@ -2990,7 +2970,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .sys_acl_blob_get_fd_fn = smb_full_audit_sys_acl_blob_get_fd, .sys_acl_set_fd_fn = smb_full_audit_sys_acl_set_fd, .sys_acl_delete_def_fd_fn = smb_full_audit_sys_acl_delete_def_fd, - .getxattr_fn = smb_full_audit_getxattr, .getxattrat_send_fn = smb_full_audit_getxattrat_send, .getxattrat_recv_fn = smb_full_audit_getxattrat_recv, .fgetxattr_fn = smb_full_audit_fgetxattr, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 8e1d9af3870..387c06c3587 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -825,16 +825,6 @@ int vfs_not_implemented_sys_acl_delete_def_fd(vfs_handle_struct *handle, return -1; } -ssize_t vfs_not_implemented_getxattr(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - errno = ENOSYS; - return -1; -} - struct vfs_not_implemented_getxattrat_state { struct vfs_aio_state aio_state; ssize_t xattr_size; @@ -1073,7 +1063,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .sys_acl_delete_def_fd_fn = vfs_not_implemented_sys_acl_delete_def_fd, /* EA operations. */ - .getxattr_fn = vfs_not_implemented_getxattr, .getxattrat_send_fn = vfs_not_implemented_getxattrat_send, .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv, .fgetxattr_fn = vfs_not_implemented_fgetxattr, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index aef3ad6db7c..3306175513b 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -2412,29 +2412,6 @@ static int smb_time_audit_sys_acl_delete_def_fd(vfs_handle_struct *handle, return result; } -static ssize_t smb_time_audit_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - ssize_t result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log_fname("getxattr", timediff, - smb_fname->base_name); - } - - return result; -} - struct smb_time_audit_getxattrat_state { struct vfs_aio_state aio_state; files_struct *dir_fsp; @@ -2799,7 +2776,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .sys_acl_blob_get_fd_fn = smb_time_audit_sys_acl_blob_get_fd, .sys_acl_set_fd_fn = smb_time_audit_sys_acl_set_fd, .sys_acl_delete_def_fd_fn = smb_time_audit_sys_acl_delete_def_fd, - .getxattr_fn = smb_time_audit_getxattr, .getxattrat_send_fn = smb_time_audit_getxattrat_send, .getxattrat_recv_fn = smb_time_audit_getxattrat_recv, .fgetxattr_fn = smb_time_audit_fgetxattr, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index eafe3cca242..34831385e09 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2767,17 +2767,6 @@ int smb_vfs_call_sys_acl_delete_def_fd(struct vfs_handle_struct *handle, return handle->fns->sys_acl_delete_def_fd_fn(handle, fsp); } -ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - VFS_FIND(getxattr); - return handle->fns->getxattr_fn(handle, smb_fname, name, value, size); -} - - struct smb_vfs_call_getxattrat_state { files_struct *dir_fsp; ssize_t (*recv_fn)(struct tevent_req *req,