s3: VFS: Remove SMB_VFS_FCHMOD_ACL().
authorJeremy Allison <jra@samba.org>
Thu, 17 May 2018 18:48:55 +0000 (11:48 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 25 May 2018 16:39:25 +0000 (18:39 +0200)
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
21 files changed:
docs-xml/Samba-Developers-Guide/vfs.xml
docs-xml/manpages/vfs_audit.8.xml
docs-xml/manpages/vfs_full_audit.8.xml
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/smbprofile.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_acl_common.c
source3/modules/vfs_acl_common.h
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c
source3/modules/vfs_audit.c
source3/modules/vfs_catia.c
source3/modules/vfs_default.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_time_audit.c
source3/smbd/vfs.c

index 4c4e39c..b58410b 100644 (file)
@@ -630,8 +630,6 @@ struct vfs_ops example_ops = {
        NULL,                           /* fset_nt_acl */
        NULL,                           /* set_nt_acl */
 
-       NULL,                           /* fchmod_acl */
-
        NULL,                           /* sys_acl_get_entry */
        NULL,                           /* sys_acl_get_tag_type */
        NULL,                           /* sys_acl_get_permset */
index e04e957..3a1576d 100644 (file)
@@ -47,7 +47,6 @@
        <member>unlink</member>
        <member>chmod</member>
        <member>fchmod</member>
-       <member>fchmod_acl</member>
        </simplelist>
 
        <para>This module is stackable.</para>
index 68df0a2..7da3e3b 100644 (file)
@@ -50,7 +50,6 @@
         <member>disconnect</member>
         <member>disk_free</member>
         <member>fchmod</member>
-        <member>fchmod_acl</member>
         <member>fchown</member>
         <member>fget_nt_acl</member>
         <member>fgetxattr</member>
index 61fa21b..446cfd5 100644 (file)
@@ -751,13 +751,6 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                          mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
                                       const struct smb_filename *smb_fname,
                                       SMB_ACL_TYPE_T type,
@@ -997,8 +990,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
 
        /* POSIX ACL operations. */
 
-       .fchmod_acl_fn = skel_fchmod_acl,
-
        .sys_acl_get_file_fn = skel_sys_acl_get_file,
        .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
index 018a187..7f2c78b 100644 (file)
@@ -942,12 +942,6 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 }
 
-static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                          mode_t mode)
-{
-       return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-}
-
 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
                                       const struct smb_filename *smb_fname,
                                       SMB_ACL_TYPE_T type,
@@ -1174,8 +1168,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
 
        /* POSIX ACL operations. */
 
-       .fchmod_acl_fn = skel_fchmod_acl,
-
        .sys_acl_get_file_fn = skel_sys_acl_get_file,
        .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
index 3c8ba2d..327c16a 100644 (file)
@@ -101,7 +101,6 @@ struct tevent_context;
        SMBPROFILE_STATS_BASIC(get_nt_acl) \
        SMBPROFILE_STATS_BASIC(fget_nt_acl) \
        SMBPROFILE_STATS_BASIC(fset_nt_acl) \
-       SMBPROFILE_STATS_BASIC(fchmod_acl) \
        SMBPROFILE_STATS_SECTION_END \
        \
        SMBPROFILE_STATS_SECTION_START(statcache, "Stat Cache") \
index 48d97b1..945e4b6 100644 (file)
 /* Version 39 - Remove SMB_VFS_WRITE
                All users are now pwrite or async versions. */
 /* Version 39 - Remove SMB_VFS_CHMOD_ACL - no longer used. */
+/* Version 39 - Remove SMB_VFS_FCHMOD_ACL - no longer used. */
 
 #define SMB_VFS_INTERFACE_VERSION 39
 
@@ -917,8 +918,6 @@ struct vfs_fn_pointers {
 
        /* POSIX ACL operations. */
 
-       int (*fchmod_acl_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode);
-
        SMB_ACL_T (*sys_acl_get_file_fn)(struct vfs_handle_struct *handle,
                                         const struct smb_filename *smb_fname,
                                         SMB_ACL_TYPE_T type,
@@ -1408,8 +1407,6 @@ NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle,
 int smb_vfs_call_chmod_acl(struct vfs_handle_struct *handle,
                                const struct smb_filename *file,
                                mode_t mode);
-int smb_vfs_call_fchmod_acl(struct vfs_handle_struct *handle,
-                           struct files_struct *fsp, mode_t mode);
 SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
                                        const struct smb_filename *smb_fname,
                                        SMB_ACL_TYPE_T type,
index dda275f..46d6728 100644 (file)
 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
        smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
 
-#define SMB_VFS_FCHMOD_ACL(fsp, mode) \
-       smb_vfs_call_fchmod_acl((fsp)->conn->vfs_handles, (fsp), (mode))
-#define SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode) \
-       smb_vfs_call_fchmod_acl((handle)->next, (fsp), (mode))
-
 #define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx)               \
        smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx)                \
index 0fd625b..6c0d931 100644 (file)
@@ -1244,13 +1244,3 @@ int fchmod_acl_module_common(struct vfs_handle_struct *handle,
        }
        return 0;
 }
-
-int fchmod_acl_acl_module_common(struct vfs_handle_struct *handle,
-                                struct files_struct *fsp, mode_t mode)
-{
-       if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
-               /* Only allow this on POSIX opens. */
-               return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-       }
-       return 0;
-}
index 24803e0..f8bc48b 100644 (file)
@@ -44,9 +44,6 @@ int fchmod_acl_module_common(struct vfs_handle_struct *handle,
 int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname,
                                mode_t mode);
-int fchmod_acl_acl_module_common(struct vfs_handle_struct *handle,
-                                struct files_struct *fsp, mode_t mode);
-
 NTSTATUS get_nt_acl_common(
        NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx,
                                    vfs_handle_struct *handle,
index 4b61c27..bb69170 100644 (file)
@@ -496,7 +496,6 @@ static struct vfs_fn_pointers vfs_acl_tdb_fns = {
        .fget_nt_acl_fn = acl_tdb_fget_nt_acl,
        .get_nt_acl_fn = acl_tdb_get_nt_acl,
        .fset_nt_acl_fn = acl_tdb_fset_nt_acl,
-       .fchmod_acl_fn = fchmod_acl_acl_module_common,
        .sys_acl_set_file_fn = sys_acl_set_file_tdb,
        .sys_acl_set_fd_fn = sys_acl_set_fd_tdb
 };
index 62d2678..94626cb 100644 (file)
@@ -323,7 +323,6 @@ static struct vfs_fn_pointers vfs_acl_xattr_fns = {
        .fget_nt_acl_fn = acl_xattr_fget_nt_acl,
        .get_nt_acl_fn = acl_xattr_get_nt_acl,
        .fset_nt_acl_fn = acl_xattr_fset_nt_acl,
-       .fchmod_acl_fn = fchmod_acl_acl_module_common,
        .sys_acl_set_file_fn = sys_acl_set_file_xattr,
        .sys_acl_set_fd_fn = sys_acl_set_fd_xattr
 };
index f34bcd1..24bc1e8 100644 (file)
@@ -247,20 +247,6 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mod
        return result;
 }
 
-static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-
-       syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
-              fsp->fsp_name->base_name, mode,
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : "");
-
-       return result;
-}
-
 static struct vfs_fn_pointers vfs_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
@@ -273,7 +259,6 @@ static struct vfs_fn_pointers vfs_audit_fns = {
        .unlink_fn = audit_unlink,
        .chmod_fn = audit_chmod,
        .fchmod_fn = audit_fchmod,
-       .fchmod_acl_fn = audit_fchmod_acl
 };
 
 static_decl_vfs;
index d26f797..fce2dcf 100644 (file)
@@ -1731,25 +1731,6 @@ static int catia_sys_acl_set_fd(vfs_handle_struct *handle,
        return ret;
 }
 
-static int catia_fchmod_acl(vfs_handle_struct *handle,
-                           files_struct *fsp,
-                           mode_t mode)
-{
-       struct catia_cache *cc = NULL;
-       int ret;
-
-       ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc);
-       if (ret != 0) {
-               return ret;
-       }
-
-       ret = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-
-       CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
-
-       return ret;
-}
-
 static NTSTATUS catia_fget_nt_acl(vfs_handle_struct *handle,
                                  files_struct *fsp,
                                  uint32_t security_info,
@@ -2478,8 +2459,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
        .fset_nt_acl_fn = catia_fset_nt_acl,
 
        /* POSIX ACL operations. */
-       .fchmod_acl_fn = catia_fchmod_acl,
-
        .sys_acl_get_file_fn = catia_sys_acl_get_file,
        .sys_acl_get_fd_fn = catia_sys_acl_get_fd,
        .sys_acl_blob_get_fd_fn = catia_sys_acl_blob_get_fd,
index 8e0831c..82afb05 100644 (file)
@@ -2674,21 +2674,6 @@ static NTSTATUS vfswrap_audit_file(struct vfs_handle_struct *handle,
        return NT_STATUS_OK; /* Nothing to do here ... */
 }
 
-static int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
-{
-#ifdef HAVE_NO_ACL
-       errno = ENOSYS;
-       return -1;
-#else
-       int result;
-
-       START_PROFILE(fchmod_acl);
-       result = fchmod_acl(fsp, mode);
-       END_PROFILE(fchmod_acl);
-       return result;
-#endif
-}
-
 static SMB_ACL_T vfswrap_sys_acl_get_file(vfs_handle_struct *handle,
                                          const struct smb_filename *smb_fname,
                                          SMB_ACL_TYPE_T type,
@@ -2950,8 +2935,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
 
        /* POSIX ACL operations. */
 
-       .fchmod_acl_fn = vfswrap_fchmod_acl,
-
        .sys_acl_get_file_fn = vfswrap_sys_acl_get_file,
        .sys_acl_get_fd_fn = vfswrap_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = posix_sys_acl_blob_get_file,
index abb0190..50bd6f8 100644 (file)
@@ -312,26 +312,6 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mod
        return result;
 }
 
-static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-
-       if (lp_syslog() > 0) {
-               syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
-                      fsp->fsp_name->base_name, mode,
-                      (result < 0) ? "failed: " : "",
-                      (result < 0) ? strerror(errno) : "");
-       }
-       DEBUG(1, ("vfs_extd_audit: fchmod_acl %s mode 0x%x %s %s",
-               fsp_str_dbg(fsp),  (unsigned int)mode,
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : ""));
-
-       return result;
-}
-
 static struct vfs_fn_pointers vfs_extd_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
@@ -344,7 +324,6 @@ static struct vfs_fn_pointers vfs_extd_audit_fns = {
        .unlink_fn = audit_unlink,
        .chmod_fn = audit_chmod,
        .fchmod_fn = audit_fchmod,
-       .fchmod_acl_fn = audit_fchmod_acl,
 };
 
 static_decl_vfs;
index bb8c306..c6b229a 100644 (file)
@@ -324,7 +324,6 @@ static struct {
        { SMB_VFS_OP_GET_NT_ACL,        "get_nt_acl" },
        { SMB_VFS_OP_FSET_NT_ACL,       "fset_nt_acl" },
        { SMB_VFS_OP_AUDIT_FILE,        "audit_file" },
-       { SMB_VFS_OP_FCHMOD_ACL,        "fchmod_acl" },
        { SMB_VFS_OP_SYS_ACL_GET_FILE,  "sys_acl_get_file" },
        { SMB_VFS_OP_SYS_ACL_GET_FD,    "sys_acl_get_fd" },
        { SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,     "sys_acl_blob_get_file" },
@@ -2130,19 +2129,6 @@ static NTSTATUS smb_full_audit_audit_file(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                                    mode_t mode)
-{
-       int result;
-       
-       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-
-       do_log(SMB_VFS_OP_FCHMOD_ACL, (result >= 0), handle,
-              "%s|%o", fsp_str_do_log(fsp), mode);
-
-       return result;
-}
-
 static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname,
                                SMB_ACL_TYPE_T type,
@@ -2529,7 +2515,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .get_nt_acl_fn = smb_full_audit_get_nt_acl,
        .fset_nt_acl_fn = smb_full_audit_fset_nt_acl,
        .audit_file_fn = smb_full_audit_audit_file,
-       .fchmod_acl_fn = smb_full_audit_fchmod_acl,
        .sys_acl_get_file_fn = smb_full_audit_sys_acl_get_file,
        .sys_acl_get_fd_fn = smb_full_audit_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = smb_full_audit_sys_acl_blob_get_file,
index f000906..985a895 100644 (file)
@@ -1499,7 +1499,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
        .audit_file_fn = NULL,
 
        /* Posix ACL Operations */
-       .fchmod_acl_fn = NULL,  /* passthrough to default */
        .sys_acl_get_file_fn = posixacl_xattr_acl_get_file,
        .sys_acl_get_fd_fn = posixacl_xattr_acl_get_fd,
        .sys_acl_blob_get_file_fn = posix_sys_acl_blob_get_file,
index 5355dd8..8714007 100644 (file)
@@ -1390,20 +1390,6 @@ static int streams_xattr_fsetxattr(struct vfs_handle_struct *handle,
        return -1;
 }
 
-static int streams_xattr_fchmod_acl(vfs_handle_struct *handle,
-                                   files_struct *fsp,
-                                   mode_t mode)
-{
-       struct stream_io *sio =
-               (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-
-       if (sio == NULL) {
-               return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-       }
-
-       return 0;
-}
-
 static SMB_ACL_T streams_xattr_sys_acl_get_fd(vfs_handle_struct *handle,
                                              files_struct *fsp,
                                              TALLOC_CTX *mem_ctx)
@@ -1677,8 +1663,6 @@ static struct vfs_fn_pointers vfs_streams_xattr_fns = {
        .fremovexattr_fn = streams_xattr_fremovexattr,
        .fsetxattr_fn = streams_xattr_fsetxattr,
 
-       .fchmod_acl_fn = streams_xattr_fchmod_acl,
-
        .sys_acl_get_fd_fn = streams_xattr_sys_acl_get_fd,
        .sys_acl_blob_get_fd_fn = streams_xattr_sys_acl_blob_get_fd,
        .sys_acl_set_fd_fn = streams_xattr_sys_acl_set_fd,
index 13005ac..e85ded5 100644 (file)
@@ -2159,25 +2159,6 @@ static NTSTATUS smb_time_audit_audit_file(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_time_audit_fchmod_acl(vfs_handle_struct *handle,
-                                    files_struct *fsp, mode_t mode)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("fchmod_acl", timediff, fsp);
-       }
-
-       return result;
-}
-
 static SMB_ACL_T smb_time_audit_sys_acl_get_file(vfs_handle_struct *handle,
                                        const struct smb_filename *smb_fname,
                                        SMB_ACL_TYPE_T type,
@@ -2678,7 +2659,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .get_nt_acl_fn = smb_time_audit_get_nt_acl,
        .fset_nt_acl_fn = smb_time_audit_fset_nt_acl,
        .audit_file_fn = smb_time_audit_audit_file,
-       .fchmod_acl_fn = smb_time_audit_fchmod_acl,
        .sys_acl_get_file_fn = smb_time_audit_sys_acl_get_file,
        .sys_acl_get_fd_fn = smb_time_audit_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = smb_time_audit_sys_acl_blob_get_file,
index 99119e1..c3f39f3 100644 (file)
@@ -2490,13 +2490,6 @@ NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle,
                                          access_denied);
 }
 
-int smb_vfs_call_fchmod_acl(struct vfs_handle_struct *handle,
-                           struct files_struct *fsp, mode_t mode)
-{
-       VFS_FIND(fchmod_acl);
-       return handle->fns->fchmod_acl_fn(handle, fsp, mode);
-}
-
 SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
                                        const struct smb_filename *smb_fname,
                                        SMB_ACL_TYPE_T type,