From: Jeremy Allison Date: Tue, 8 Jun 2021 20:04:57 +0000 (-0700) Subject: vfs: RIP SMB_VFS_GET_NT_ACL_AT() X-Git-Tag: tevent-0.11.0~500 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cbf0acc0dbee67d041b472bf7902a2a44f5b463;p=thirdparty%2Fsamba.git vfs: RIP SMB_VFS_GET_NT_ACL_AT() .--. .-, .-..-.__ .'(`.-` \_.-'-./` |\_( "\__ __.>\ '; _;---,._| / __/`'--) /.--. : |/' _.--.<| / | | _..-' `\ /' /` /_/ _/_/ >_.-``-. `Y /' _;---.`|/)))) '` .-''. \|: .' __, .-'"` .'--._ `-: \/: /' '.\ _|_ /.'`\ :; /' `- `-|-` -` | | | :.; : | .-'~^~`-. |: | .' _ _ `. |:. | | |_) | |_) | :. : | | | \ | | | : ; | | | : ; | | SMB_VFS | : ; | | GET_NT_ | : ; | | ACL_AT | .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 8ec6e0dff38..da41f19acdb 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -781,16 +781,6 @@ static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return NT_STATUS_NOT_IMPLEMENTED; } -static NTSTATUS skel_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) @@ -1088,7 +1078,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { /* NT ACL operations. */ .fget_nt_acl_fn = skel_fget_nt_acl, - .get_nt_acl_at_fn = skel_get_nt_acl_at, .fset_nt_acl_fn = skel_fset_nt_acl, /* POSIX ACL operations. */ diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index bd22b62e5d0..24385dc99df 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -1044,21 +1044,6 @@ static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, ppdesc); } -static NTSTATUS skel_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - return SMB_VFS_NEXT_GET_NT_ACL_AT(handle, - dirfsp, - smb_fname, - security_info, - mem_ctx, - ppdesc); -} - static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) @@ -1397,7 +1382,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { /* NT ACL operations. */ .fget_nt_acl_fn = skel_fget_nt_acl, - .get_nt_acl_at_fn = skel_get_nt_acl_at, .fset_nt_acl_fn = skel_fset_nt_acl, /* POSIX ACL operations. */ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 679aa871430..52e445ee04f 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -355,6 +355,7 @@ * Version 45 - Add SMB_VFS_SYS_ACL_DELETE_DEF_FD * Version 45 - Remove SMB_VFS_SYS_ACL_DELETE_DEF_FILE * Version 45 - Add SMB_VFS_PARENT_PATHNAME + * Version 45 - Remove SMB_VFS_GET_NT_ACL_AT */ #define SMB_VFS_INTERFACE_VERSION 45 @@ -1195,12 +1196,6 @@ struct vfs_fn_pointers { uint32_t security_info, TALLOC_CTX *mem_ctx, struct security_descriptor **ppdesc); - NTSTATUS (*get_nt_acl_at_fn)(struct vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc); NTSTATUS (*fset_nt_acl_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32_t security_info_sent, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index be113932d57..8c2b59bfcea 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -474,11 +474,6 @@ #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \ smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc)) -#define SMB_VFS_GET_NT_ACL_AT(conn, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \ - smb_vfs_call_get_nt_acl_at((conn)->vfs_handles, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc)) -#define SMB_VFS_NEXT_GET_NT_ACL_AT(handle, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \ - smb_vfs_call_get_nt_acl_at((handle)->next, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc)) - #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \ smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied)) #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 58ecff4da26..4687c08f411 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3201,28 +3201,6 @@ static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle, return result; } -static NTSTATUS vfswrap_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - NTSTATUS result; - - START_PROFILE(get_nt_acl_at); - - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); - - result = posix_get_nt_acl(handle->conn, - smb_fname, - security_info, - mem_ctx, - ppdesc); - END_PROFILE(get_nt_acl_at); - return result; -} - static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) { NTSTATUS result; @@ -3905,7 +3883,6 @@ static struct vfs_fn_pointers vfs_default_fns = { /* NT ACL operations. */ .fget_nt_acl_fn = vfswrap_fget_nt_acl, - .get_nt_acl_at_fn = vfswrap_get_nt_acl_at, .fset_nt_acl_fn = vfswrap_fset_nt_acl, .audit_file_fn = vfswrap_audit_file, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index f5177bf7d32..5e388cc403c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -191,7 +191,6 @@ typedef enum _vfs_op_type { /* NT ACL operations. */ SMB_VFS_OP_FGET_NT_ACL, - SMB_VFS_OP_GET_NT_ACL_AT, SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_OP_AUDIT_FILE, @@ -326,7 +325,6 @@ static struct { { SMB_VFS_OP_FGET_DOS_ATTRIBUTES, "fget_dos_attributes" }, { SMB_VFS_OP_FSET_DOS_ATTRIBUTES, "fset_dos_attributes" }, { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, - { SMB_VFS_OP_GET_NT_ACL_AT, "get_nt_acl_at" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, { SMB_VFS_OP_AUDIT_FILE, "audit_file" }, { SMB_VFS_OP_SYS_ACL_GET_FILE, "sys_acl_get_file" }, @@ -2479,31 +2477,6 @@ static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_stru return result; } -static NTSTATUS smb_full_audit_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - NTSTATUS result; - - result = SMB_VFS_NEXT_GET_NT_ACL_AT(handle, - dirfsp, - smb_fname, - security_info, - mem_ctx, - ppdesc); - - do_log(SMB_VFS_OP_GET_NT_ACL_AT, - NT_STATUS_IS_OK(result), - handle, - "%s", - smb_fname_str_do_log(handle->conn, smb_fname)); - - return result; -} - static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) @@ -3026,7 +2999,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .fget_dos_attributes_fn = smb_full_audit_fget_dos_attributes, .fset_dos_attributes_fn = smb_full_audit_fset_dos_attributes, .fget_nt_acl_fn = smb_full_audit_fget_nt_acl, - .get_nt_acl_at_fn = smb_full_audit_get_nt_acl_at, .fset_nt_acl_fn = smb_full_audit_fset_nt_acl, .audit_file_fn = smb_full_audit_audit_file, .sys_acl_get_file_fn = smb_full_audit_sys_acl_get_file, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 24e4f6b07a7..bc763b8b48a 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -785,16 +785,6 @@ NTSTATUS vfs_not_implemented_fget_nt_acl(vfs_handle_struct *handle, files_struct return NT_STATUS_NOT_IMPLEMENTED; } -NTSTATUS vfs_not_implemented_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) @@ -1092,7 +1082,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { /* NT ACL operations. */ .fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl, - .get_nt_acl_at_fn = vfs_not_implemented_get_nt_acl_at, .fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl, /* POSIX ACL operations. */ diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 9f407a721d9..2a38aabeff6 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -2266,36 +2266,6 @@ static NTSTATUS smb_time_audit_fget_nt_acl(vfs_handle_struct *handle, return result; } -static NTSTATUS smb_time_audit_get_nt_acl_at(vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - NTSTATUS result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_GET_NT_ACL_AT(handle, - dirfsp, - smb_fname, - security_info, - mem_ctx, - ppdesc); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log_fname("get_nt_acl", - timediff, - smb_fname->base_name); - } - - return result; -} - static NTSTATUS smb_time_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, @@ -2857,7 +2827,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .fget_dos_attributes_fn = smb_time_fget_dos_attributes, .fset_dos_attributes_fn = smb_time_fset_dos_attributes, .fget_nt_acl_fn = smb_time_audit_fget_nt_acl, - .get_nt_acl_at_fn = smb_time_audit_get_nt_acl_at, .fset_nt_acl_fn = smb_time_audit_fset_nt_acl, .audit_file_fn = smb_time_audit_audit_file, .sys_acl_get_file_fn = smb_time_audit_sys_acl_get_file, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 866ad9d2e85..3cfd0203b8c 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2708,22 +2708,6 @@ NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle, mem_ctx, ppdesc); } -NTSTATUS smb_vfs_call_get_nt_acl_at(struct vfs_handle_struct *handle, - struct files_struct *dirfsp, - const struct smb_filename *smb_fname, - uint32_t security_info, - TALLOC_CTX *mem_ctx, - struct security_descriptor **ppdesc) -{ - VFS_FIND(get_nt_acl_at); - return handle->fns->get_nt_acl_at_fn(handle, - dirfsp, - smb_fname, - security_info, - mem_ctx, - ppdesc); -} - NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32_t security_info_sent,