From b01169ff32188939752c064e2eb803f57a837522 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Oct 2019 14:35:37 -0700 Subject: [PATCH] s3: VFS: Complete the removal of SMB_VFS_CHOWN() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No longer used anywhere. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Oct 15 20:07:51 UTC 2019 on sn-devel-184 --- examples/VFS/skel_opaque.c | 10 ---------- examples/VFS/skel_transparent.c | 9 --------- source3/include/smbprofile.h | 1 - source3/include/vfs.h | 13 +------------ source3/include/vfs_macros.h | 5 ----- source3/modules/vfs_default.c | 14 -------------- source3/modules/vfs_not_implemented.c | 10 ---------- source3/smbd/vfs.c | 9 --------- 8 files changed, 1 insertion(+), 70 deletions(-) diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 497ec90760e..4f0622bccc6 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -361,15 +361,6 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, return -1; } -static int skel_chown(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid) -{ - errno = ENOSYS; - return -1; -} - static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { @@ -1080,7 +1071,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .unlinkat_fn = skel_unlinkat, .chmod_fn = skel_chmod, .fchmod_fn = skel_fchmod, - .chown_fn = skel_chown, .fchown_fn = skel_fchown, .lchown_fn = skel_lchown, .chdir_fn = skel_chdir, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index c8277017565..fd19e433ba3 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -480,14 +480,6 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode); } -static int skel_chown(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid) -{ - return SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid); -} - static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { @@ -1377,7 +1369,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .unlinkat_fn = skel_unlinkat, .chmod_fn = skel_chmod, .fchmod_fn = skel_fchmod, - .chown_fn = skel_chown, .fchown_fn = skel_fchown, .lchown_fn = skel_lchown, .chdir_fn = skel_chdir, diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 41621c4e862..a003a1d9df0 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -69,7 +69,6 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_unlinkat) \ SMBPROFILE_STATS_BASIC(syscall_chmod) \ SMBPROFILE_STATS_BASIC(syscall_fchmod) \ - SMBPROFILE_STATS_BASIC(syscall_chown) \ SMBPROFILE_STATS_BASIC(syscall_fchown) \ SMBPROFILE_STATS_BASIC(syscall_lchown) \ SMBPROFILE_STATS_BASIC(syscall_chdir) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 5ea4f805817..802eb8d0292 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -285,6 +285,7 @@ /* Version 42 - Add SMB_VFS_FCNTL */ /* Version 42 - Remove SMB_VFS_RMDIR. Use SMB_VFS_UNLINKAT(.., AT_REMOVEDIR) instead. */ +/* Version 42 - Remove SMB_VFS_CHOWN */ #define SMB_VFS_INTERFACE_VERSION 42 @@ -786,10 +787,6 @@ struct vfs_fn_pointers { 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 (*chown_fn)(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid); 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, const struct smb_filename *smb_fname, @@ -1316,10 +1313,6 @@ int smb_vfs_call_chmod(struct vfs_handle_struct *handle, mode_t mode); int smb_vfs_call_fchmod(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); -int smb_vfs_call_chown(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid); int smb_vfs_call_fchown(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); int smb_vfs_call_lchown(struct vfs_handle_struct *handle, @@ -1755,10 +1748,6 @@ int vfs_not_implemented_chmod(vfs_handle_struct *handle, mode_t mode); int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode); -int vfs_not_implemented_chown(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid); int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid); int vfs_not_implemented_lchown(vfs_handle_struct *handle, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 95cf4cf3088..6a7cbf2275d 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -231,11 +231,6 @@ #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \ smb_vfs_call_fchmod((handle)->next, (fsp), (mode)) -#define SMB_VFS_CHOWN(conn, smb_fname, uid, gid) \ - smb_vfs_call_chown((conn)->vfs_handles, (smb_fname), (uid), (gid)) -#define SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid) \ - smb_vfs_call_chown((handle)->next, (smb_fname), (uid), (gid)) - #define SMB_VFS_FCHOWN(fsp, uid, gid) \ smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid)) #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 13d849c5084..421772da377 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2245,19 +2245,6 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t m return result; } -static int vfswrap_chown(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid) -{ - int result; - - START_PROFILE(syscall_chown); - result = chown(smb_fname->base_name, uid, gid); - END_PROFILE(syscall_chown); - return result; -} - static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { #ifdef HAVE_FCHOWN @@ -3529,7 +3516,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .unlinkat_fn = vfswrap_unlinkat, .chmod_fn = vfswrap_chmod, .fchmod_fn = vfswrap_fchmod, - .chown_fn = vfswrap_chown, .fchown_fn = vfswrap_fchown, .lchown_fn = vfswrap_lchown, .chdir_fn = vfswrap_chdir, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 083ebc9e1f1..b68b9e2e8b9 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -359,15 +359,6 @@ int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp, return -1; } -int vfs_not_implemented_chown(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid) -{ - errno = ENOSYS; - return -1; -} - int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { @@ -1085,7 +1076,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .unlinkat_fn = vfs_not_implemented_unlinkat, .chmod_fn = vfs_not_implemented_chmod, .fchmod_fn = vfs_not_implemented_fchmod, - .chown_fn = vfs_not_implemented_chown, .fchown_fn = vfs_not_implemented_fchown, .lchown_fn = vfs_not_implemented_lchown, .chdir_fn = vfs_not_implemented_chdir, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 588580314e8..a104921784f 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2025,15 +2025,6 @@ int smb_vfs_call_fchmod(struct vfs_handle_struct *handle, return handle->fns->fchmod_fn(handle, fsp, mode); } -int smb_vfs_call_chown(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - uid_t uid, - gid_t gid) -{ - VFS_FIND(chown); - return handle->fns->chown_fn(handle, smb_fname, uid, gid); -} - int smb_vfs_call_fchown(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid) { -- 2.34.1