From: Noel Power Date: Thu, 8 Apr 2021 12:03:57 +0000 (+0100) Subject: VFS: Remove SMB_VFS_CHMOD, no longer used X-Git-Tag: tevent-0.11.0~1195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=534de9b28274165ac5d86f0c79fa2d543c0f09ed;p=thirdparty%2Fsamba.git VFS: Remove SMB_VFS_CHMOD, no longer used --------------- / \ / REST \ / IN \ / PEACE \ / \ | | | SMB_VFS_CHMOD | | | | | | 08 April | | 2021 | | | | | *| * * * | * _________)/\\_//(\/(/\)/\//\/\////|_)_______ Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Autobuild-User(master): Noel Power Autobuild-Date(master): Sun Apr 11 23:25:31 UTC 2021 on sn-devel-184 --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 79ed98897be..d0b14aaaae7 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -362,14 +362,6 @@ static int skel_unlinkat(vfs_handle_struct *handle, return -1; } -static int skel_chmod(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode) -{ - errno = ENOSYS; - return -1; -} - static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { @@ -1037,7 +1029,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .lstat_fn = skel_lstat, .get_alloc_size_fn = skel_get_alloc_size, .unlinkat_fn = skel_unlinkat, - .chmod_fn = skel_chmod, .fchmod_fn = skel_fchmod, .fchown_fn = skel_fchown, .lchown_fn = skel_lchown, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 6c5e9002e16..c73e04fd58b 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -491,13 +491,6 @@ static int skel_unlinkat(vfs_handle_struct *handle, flags); } -static int skel_chmod(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode) -{ - return SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode); -} - static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { @@ -1342,7 +1335,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .lstat_fn = skel_lstat, .get_alloc_size_fn = skel_get_alloc_size, .unlinkat_fn = skel_unlinkat, - .chmod_fn = skel_chmod, .fchmod_fn = skel_fchmod, .fchown_fn = skel_fchown, .lchown_fn = skel_lchown, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 3357f681b98..7bbd5e189a8 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -346,6 +346,7 @@ * Version 45 - Remove SMB_VFS_SETXATTR * Version 45 - Remove SMB_VFS_REMOVEXATTR * Version 45 - Remove SMB_VFS_GET_DOS_ATTRIBUTES() + * Version 45 - Remove SMB_VFS_CHMOD */ #define SMB_VFS_INTERFACE_VERSION 45 @@ -1005,9 +1006,6 @@ struct vfs_fn_pointers { struct files_struct *srcdir_fsp, const struct smb_filename *smb_fname, int flags); - int (*chmod_fn)(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode); int (*fchmod_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); int (*fchown_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); int (*lchown_fn)(struct vfs_handle_struct *handle, @@ -1518,9 +1516,6 @@ int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, int flags); -int smb_vfs_call_chmod(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode); int smb_vfs_call_fchmod(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); int smb_vfs_call_fchown(struct vfs_handle_struct *handle, @@ -1949,9 +1944,6 @@ int vfs_not_implemented_unlinkat(vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, int flags); -int vfs_not_implemented_chmod(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode); int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode); int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 9ec9330095a..5247d56bfc9 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -243,11 +243,6 @@ #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \ smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags)) -#define SMB_VFS_CHMOD(conn, smb_fname, mode) \ - smb_vfs_call_chmod((conn)->vfs_handles, (smb_fname), (mode)) -#define SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode) \ - smb_vfs_call_chmod((handle)->next, (smb_fname), (mode)) - #define SMB_VFS_FCHMOD(fsp, mode) \ smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode)) #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 8e98b467bd5..376d7f51ea1 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2408,18 +2408,6 @@ static int vfswrap_unlinkat(vfs_handle_struct *handle, return result; } -static int vfswrap_chmod(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode) -{ - int result; - - START_PROFILE(syscall_chmod); - result = chmod(smb_fname->base_name, mode); - END_PROFILE(syscall_chmod); - return result; -} - static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { int result; @@ -3819,7 +3807,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .lstat_fn = vfswrap_lstat, .get_alloc_size_fn = vfswrap_get_alloc_size, .unlinkat_fn = vfswrap_unlinkat, - .chmod_fn = vfswrap_chmod, .fchmod_fn = vfswrap_fchmod, .fchown_fn = vfswrap_fchown, .lchown_fn = vfswrap_lchown, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 0163bed084e..8659524c729 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -359,14 +359,6 @@ int vfs_not_implemented_unlinkat(vfs_handle_struct *handle, return -1; } -int vfs_not_implemented_chmod(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode) -{ - errno = ENOSYS; - return -1; -} - int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { @@ -1041,7 +1033,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .lstat_fn = vfs_not_implemented_lstat, .get_alloc_size_fn = vfs_not_implemented_get_alloc_size, .unlinkat_fn = vfs_not_implemented_unlinkat, - .chmod_fn = vfs_not_implemented_chmod, .fchmod_fn = vfs_not_implemented_fchmod, .fchown_fn = vfs_not_implemented_fchown, .lchown_fn = vfs_not_implemented_lchown, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index ed138514c22..90d88cef9a1 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2208,14 +2208,6 @@ int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle, flags); } -int smb_vfs_call_chmod(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - mode_t mode) -{ - VFS_FIND(chmod); - return handle->fns->chmod_fn(handle, smb_fname, mode); -} - int smb_vfs_call_fchmod(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode) {