vfs: RIP SMB_VFS_GET_NT_ACL_AT()
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 20:04:57 +0000 (13:04 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
                  .--. .-,       .-..-.__
                .'(`.-` \_.-'-./`  |\_( "\__
             __.>\ ';  _;---,._|   / __/`'--)
            /.--.  : |/' _.--.<|  /  | |
        _..-'    `\     /' /`  /_/ _/_/
         >_.-``-. `Y  /' _;---.`|/))))
        '` .-''. \|:  .'   __, .-'"`
         .'--._ `-:  \/:  /'  '.\             _|_
             /.'`\ :;   /'      `-           `-|-`
            -`    |     |                      |
                  :.; : |                  .-'~^~`-.
                  |:    |                .' _     _ `.
                  |:.   |                | |_) | |_) |
                  :. :  |                | | \ | |   |
                  : ;   |                |           |
                  : ;   |                |  SMB_VFS  |
                  : ;   |                |  GET_NT_  |
                  : ;   |                |  ACL_AT   |
                .jgs. : ;                |           |
        -."-/\\\/:::.    `\."-._'."-"_\\-|           |///."-
        " -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-".

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_time_audit.c
source3/smbd/vfs.c

index 8ec6e0dff387f09a8b776bec9e113dacf367eb25..da41f19acdb79d1218a4c543e2aa70acf3870d9f 100644 (file)
@@ -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. */
index bd22b62e5d000e42fc6b074b80fffdddec6bf97c..24385dc99dff15716fdb3f7cbe66266ee9d7e671 100644 (file)
@@ -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. */
index 679aa8714301dcd0af19ff868bde160c769998e1..52e445ee04f0b159b75c8dbf7ceb29566b9b3a3f 100644 (file)
  * 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,
index be113932d57f6f896e044d6290452a0bf830462b..8c2b59bfceaf7bd9ff3768cb70eb536c92e7ade2 100644 (file)
 #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) \
index 58ecff4da26cef0b577ad6a296e2805ef5d6687b..4687c08f4112f4f45e10d99dea12cc31093a697c 100644 (file)
@@ -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,
 
index f5177bf7d327222988ba7a05f250d78310b2e414..5e388cc403c19642b620bbab1e5879c1b236cc62 100644 (file)
@@ -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,
index 24e4f6b07a77a29088a471d7255a9dd510541e21..bc763b8b48a04dcfebdafd83265a39974963b9c5 100644 (file)
@@ -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. */
index 9f407a721d9c8838f05ca863612ddce9d076b46e..2a38aabeff6b2e64dc4377b4fabea4d932d89fa3 100644 (file)
@@ -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,
index 866ad9d2e8598dbcfd0cbcfcb7a092a9aecbaf2c..3cfd0203b8cbd95889d99759279d928642819f8e 100644 (file)
@@ -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,