From 5bbb8310417563b17d83bb9ea9d08940d26e90e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 May 2018 11:48:55 -0700 Subject: [PATCH] s3: VFS: Remove SMB_VFS_FCHMOD_ACL(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- docs-xml/Samba-Developers-Guide/vfs.xml | 2 -- docs-xml/manpages/vfs_audit.8.xml | 1 - docs-xml/manpages/vfs_full_audit.8.xml | 1 - examples/VFS/skel_opaque.c | 9 --------- examples/VFS/skel_transparent.c | 8 -------- source3/include/smbprofile.h | 1 - source3/include/vfs.h | 5 +---- source3/include/vfs_macros.h | 5 ----- source3/modules/vfs_acl_common.c | 10 ---------- source3/modules/vfs_acl_common.h | 3 --- source3/modules/vfs_acl_tdb.c | 1 - source3/modules/vfs_acl_xattr.c | 1 - source3/modules/vfs_audit.c | 15 --------------- source3/modules/vfs_catia.c | 21 --------------------- source3/modules/vfs_default.c | 17 ----------------- source3/modules/vfs_extd_audit.c | 21 --------------------- source3/modules/vfs_full_audit.c | 15 --------------- source3/modules/vfs_glusterfs.c | 1 - source3/modules/vfs_streams_xattr.c | 16 ---------------- source3/modules/vfs_time_audit.c | 20 -------------------- source3/smbd/vfs.c | 7 ------- 21 files changed, 1 insertion(+), 179 deletions(-) diff --git a/docs-xml/Samba-Developers-Guide/vfs.xml b/docs-xml/Samba-Developers-Guide/vfs.xml index 4c4e39c4fc3..b58410b369d 100644 --- a/docs-xml/Samba-Developers-Guide/vfs.xml +++ b/docs-xml/Samba-Developers-Guide/vfs.xml @@ -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 */ diff --git a/docs-xml/manpages/vfs_audit.8.xml b/docs-xml/manpages/vfs_audit.8.xml index e04e9572af0..3a1576d6b40 100644 --- a/docs-xml/manpages/vfs_audit.8.xml +++ b/docs-xml/manpages/vfs_audit.8.xml @@ -47,7 +47,6 @@ unlink chmod fchmod - fchmod_acl This module is stackable. diff --git a/docs-xml/manpages/vfs_full_audit.8.xml b/docs-xml/manpages/vfs_full_audit.8.xml index 68df0a20747..7da3e3bb81c 100644 --- a/docs-xml/manpages/vfs_full_audit.8.xml +++ b/docs-xml/manpages/vfs_full_audit.8.xml @@ -50,7 +50,6 @@ disconnect disk_free fchmod - fchmod_acl fchown fget_nt_acl fgetxattr diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 61fa21b679c..446cfd5767e 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -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, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 018a18768ac..7f2c78b2e3b 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -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, diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 3c8ba2d8e2a..327c16ac2d9 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -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") \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 48d97b133c9..945e4b6b8b0 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -252,6 +252,7 @@ /* 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, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index dda275fa968..46d6728629c 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -460,11 +460,6 @@ #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) \ diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index 0fd625bec1d..6c0d931bf43 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -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; -} diff --git a/source3/modules/vfs_acl_common.h b/source3/modules/vfs_acl_common.h index 24803e0215e..f8bc48bf65b 100644 --- a/source3/modules/vfs_acl_common.h +++ b/source3/modules/vfs_acl_common.h @@ -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, diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 4b61c274441..bb69170c910 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -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 }; diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index 62d26781fd5..94626cb8e03 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -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 }; diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index f34bcd19161..24bc1e8db5f 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -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; diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index d26f7978290..fce2dcf8ca5 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -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, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 8e0831cace4..82afb054a13 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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, diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index abb019081e0..50bd6f8f758 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -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; diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index bb8c306ea40..c6b229a376a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -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, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index f000906261c..985a895257f 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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, diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 5355dd8ca44..8714007cb8d 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -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, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 13005ac1158..e85ded5e4c3 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -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, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 99119e1fddc..c3f39f32474 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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, -- 2.11.4.GIT