[SCM] Samba Shared Repository - branch master updated

Noel Power npower at samba.org
Sun Apr 11 23:26:01 UTC 2021


The branch, master has been updated
       via  534de9b2827 VFS: Remove SMB_VFS_CHMOD, no longer used
       via  8b24b864357 s3/modules: VFS: unityed_media: Remove um_chmod function
       via  ca6764aff3a s3/modules: VFS: time_audit: Remove smb_time_audit_chmod
       via  ad45e014569 s3/modules: VFS: snapper: Remove snapper_gmt_chmod
       via  04d6f4a153f s3/modules: VFS: shadow_copy2: Remove shadow_copy2_chmod
       via  9999205a20c s3/modules: VFS: media_harmony: Remove mh_chmod
       via  2505719cdd1 s3/modules: VFS: gpfs: Remove vfs_gpfs_chmod() function
       via  9cfbd8cb7fa s3/modules: VFS: Remove vfs_gluster_chmod() function
       via  2bcd5b92e03 s3/modules: VFS: full_audit: Remove smb_full_audit_chmod() function
       via  3df8106edc8 s3/modules: VFS: fruit: Remove fruit_chmod
       via  87223ed5b0d s3/modules: VFS: fake_acls: Remove fake_acls_chmod() function
       via  8f680b45b0e s3/modules: VFS: extd_audit: Remove audit_chmod() function
       via  27ae0e1e37c s3/modules: VFS: cep_snapshots: remove ceph_snap_gmt_chmod() function
       via  25c53f14997 s3/modules: VFS: ceph: Remove cephwrap_chmod() function
       via  bf90930a038 s3/modules: VFS: catia: Remove catia_chmod() function
       via  b1a5c292cd2 s3/modules: VFS: cap: remove cap_chmod
       via  f4e1598bbbf s3/modules: VFS: audit: Remove audit_chmod
       via  d87123648b8 s3/modules: VFS: acl_common: Remove chmod_acl_module_common() function
       via  a773d5e321f s3/modules: VFS: acl_xattr: Remove call to chmod_acl_module_common()
       via  726160a8ae6 s3/modules: VFS: acl_tdb: Remove call to chmod_acl_module_common()
       via  5cad228f555 s3/torture: Make cmd_chmod now use SMB_VFS_FCHMOD
       via  dda3d953a00 s3/modules: linux_xfs_sgid_mkdirat() SMB_VFS_NEXT_FCHMOD => SMB_VFS_NEXT_CHMOD
       via  cb571d2b476 s3/modules: nfs4acl_xattr_fset_nt_acl VFS_SMB_NEXT_CHMOD => VFS_SMB_NEXT_FCHMOD
       via  34949219eda s3/smbd: file_set_dosmode SMB_VFS_CHMOD => SMB_VFS_FCHMOD
       via  9722732b186 s3/smbd: SMB_VFS_CHMOD -> SMB_VFS_FCHMOD
       via  7501407f988 s3/modules: VFS: snapper: Add new fchmod_fn implementation
       via  a412b5cc793 s3/modules: VFS: shadow_copy2: Add new fchmod_fn implementation
       via  f54ec00eca5 s3/modules: VFS: fruit: Add new fchmod_fn implementation
       via  c1e9aea0da1 s3/modules: VFS: ceph_snapshots: Add new fchmod_fn implementation
       via  74ecb467073 s3/modules: make chmod_acl_module_common less strict so fchmod can run
       via  a749da2a5d6 VFS: ceph: Allow cephwrap_fchmod() to cope with pathref fsps.
       via  fcf696bfa28 VFS: gluster: Allow vfs_gluster_fchmod() to cope with pathref fsps.
       via  6ad10836d6e s3/modules: fchmod: fallback to path based chmod if pathref
       via  f923d1f474f vfs_default: require fchmod()
       via  1a68d34c232 VFS: Fix version SMB_VFS_GET_DOS_ATTRIBUTES was removed in
      from  9386e6ef5dd s3: VFS: streams_xattr: Now we know we will never be doing ACL operations on streams, delete the now unneeded code.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 534de9b28274165ac5d86f0c79fa2d543c0f09ed
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 13:03:57 2021 +0100

    VFS: Remove SMB_VFS_CHMOD, no longer used
    
                                   ---------------
                                  /               \
                                 /      REST       \
                                /        IN         \
                               /        PEACE        \
                              /                       \
                              |                       |
                              |     SMB_VFS_CHMOD     |
                              |                       |
                              |                       |
                              |       08 April        |
                              |         2021          |
                              |                       |
                              |                       |
                             *|     *  *  *           | *
                    _________)/\\_//(\/(/\)/\//\/\////|_)_______
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Noel Power <npower at samba.org>
    Autobuild-Date(master): Sun Apr 11 23:25:31 UTC 2021 on sn-devel-184

commit 8b24b8643571ba3fb9f2d138e5f779ab514b3697
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 13:01:06 2021 +0100

    s3/modules: VFS: unityed_media: Remove um_chmod function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit ca6764aff3a716bba76307d99442f0b8d394513a
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 13:00:36 2021 +0100

    s3/modules: VFS: time_audit: Remove smb_time_audit_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit ad45e014569e6b846d9af4e26b8bd4261b079086
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:59:06 2021 +0200

    s3/modules: VFS: snapper: Remove snapper_gmt_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 04d6f4a153f322fa1f0055bf59f47e2a218657d1
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:58:42 2021 +0200

    s3/modules: VFS: shadow_copy2: Remove shadow_copy2_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9999205a20c3cf31cb1a4f1f6925dababf7c3b63
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:52:18 2021 +0100

    s3/modules: VFS: media_harmony: Remove mh_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 2505719cdd144d272a43be8ac0a324a6baed7a99
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:51:36 2021 +0100

    s3/modules: VFS: gpfs: Remove vfs_gpfs_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9cfbd8cb7fafa9aa75424c4d2ef7d9c43a2e1907
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:50:53 2021 +0100

    s3/modules: VFS: Remove vfs_gluster_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 2bcd5b92e03b0764483052a3b700050d2bb1e95b
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:50:16 2021 +0100

    s3/modules: VFS: full_audit: Remove smb_full_audit_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 3df8106edc8d67a596fbc5c8679014492e12e04c
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:58:20 2021 +0200

    s3/modules: VFS: fruit: Remove fruit_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 87223ed5b0dd5006d339b277c3f610bb7db4e470
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:47:33 2021 +0100

    s3/modules: VFS: fake_acls: Remove fake_acls_chmod() function
    
    Also remove fake_acls_sys_acl_set_file() which is no longer called
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 8f680b45b0e978631fc3631dd3caefdfb80f2b73
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:46:27 2021 +0100

    s3/modules: VFS: extd_audit: Remove audit_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 27ae0e1e37c370aeab2e454e94d21a48e1e0a706
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:42:56 2021 +0100

    s3/modules: VFS: cep_snapshots: remove ceph_snap_gmt_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 25c53f1499750934f6c82ddd2fce4a34e48eff5e
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:42:01 2021 +0100

    s3/modules: VFS: ceph: Remove cephwrap_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit bf90930a0380ad064e2372afdabe7d3394405e77
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:41:15 2021 +0100

    s3/modules: VFS: catia: Remove catia_chmod() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b1a5c292cd23aea3b71671992bc81307e6681a7c
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:39:48 2021 +0100

    s3/modules: VFS: cap: remove cap_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f4e1598bbbfff92752763156e70bdb9ec0ab6278
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:35:56 2021 +0100

    s3/modules: VFS: audit: Remove audit_chmod
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d87123648b81fd2e39062ab3a9aac8abab41d2ce
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:34:39 2021 +0100

    s3/modules: VFS: acl_common: Remove chmod_acl_module_common() function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a773d5e321fa8b9df247af11290845f1d21c4874
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:34:02 2021 +0100

    s3/modules: VFS: acl_xattr: Remove call to chmod_acl_module_common()
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 726160a8ae6364b52fa4c962b1f836aa975847fa
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 12:32:14 2021 +0100

    s3/modules: VFS: acl_tdb: Remove call to chmod_acl_module_common()
    
    Signed-off-by: Noel Power <noel.power at suse.com>

commit 5cad228f55595b1f62c7c6e69df4908df1211f72
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 13:02:09 2021 +0100

    s3/torture: Make cmd_chmod now use SMB_VFS_FCHMOD
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit dda3d953a0082719de6f4d9ec208f6b52b00886c
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 11:24:04 2021 +0100

    s3/modules: linux_xfs_sgid_mkdirat() SMB_VFS_NEXT_FCHMOD => SMB_VFS_NEXT_CHMOD
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit cb571d2b47644f0cd4f148d2e52d9970b4d4d6c5
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 11:10:54 2021 +0100

    s3/modules: nfs4acl_xattr_fset_nt_acl VFS_SMB_NEXT_CHMOD => VFS_SMB_NEXT_FCHMOD
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 34949219eda5c1e8524106af50bbade32d5c9ce6
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 8 10:20:37 2021 +0100

    s3/smbd: file_set_dosmode SMB_VFS_CHMOD => SMB_VFS_FCHMOD
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9722732b1867e359304594ada72ff40cd1341be5
Author: Noel Power <noel.power at suse.com>
Date:   Tue Apr 6 17:11:48 2021 +0100

    s3/smbd: SMB_VFS_CHMOD -> SMB_VFS_FCHMOD
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 7501407f988d19f16a2f441f260df056ef8842b5
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:57:08 2021 +0200

    s3/modules: VFS: snapper: Add new fchmod_fn implementation
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a412b5cc793b89d6e79f5031ba462777af14c656
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:54:44 2021 +0200

    s3/modules: VFS: shadow_copy2: Add new fchmod_fn implementation
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f54ec00eca521e766690f24263555c04bd5e47e9
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:53:20 2021 +0200

    s3/modules: VFS: fruit: Add new fchmod_fn implementation
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c1e9aea0da1f1f0ad40e5089d92a76c29f51ceee
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 15:49:15 2021 +0200

    s3/modules: VFS: ceph_snapshots: Add new fchmod_fn implementation
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 74ecb467073fed08635929c82c0a9e9d70428433
Author: Noel Power <noel.power at suse.com>
Date:   Wed Apr 7 16:02:15 2021 +0100

    s3/modules: make chmod_acl_module_common less strict so fchmod can run
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a749da2a5d6775b0e583822d461a1884a44e5a1f
Author: Noel Power <noel.power at suse.com>
Date:   Tue Apr 6 17:10:35 2021 +0100

    VFS: ceph: Allow cephwrap_fchmod() to cope with pathref fsps.
    
    Ensure it only uses an io fd for a handle based call.
    
    Otherwise fall back to pathname based.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit fcf696bfa2827bb5b726c4f1d8cc24ba9c41f613
Author: Noel Power <noel.power at suse.com>
Date:   Tue Apr 6 17:08:50 2021 +0100

    VFS: gluster: Allow vfs_gluster_fchmod() to cope with pathref fsps.
    
    Ensure it only uses an io fd for a handle based call.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6ad10836d6e04d8c95773e9122b63f5a5e040487
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Apr 9 14:58:34 2021 +0200

    s3/modules: fchmod: fallback to path based chmod if pathref
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Signed-off-by: Ralph Boehme <slow at samba.org>

commit f923d1f474fa1d9a19c8fd2904d50f411803bc05
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Apr 9 14:55:06 2021 +0200

    vfs_default: require fchmod()
    
    This has been part of POSIX for long enough in 2021.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>

commit 1a68d34c2329d3862bd4bdc0a9375ce4039aa293
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 9 12:08:35 2021 +0100

    VFS: Fix version SMB_VFS_GET_DOS_ATTRIBUTES was removed in
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c            |  9 ----
 examples/VFS/skel_transparent.c       |  8 ---
 source3/include/vfs.h                 | 12 +----
 source3/include/vfs_macros.h          |  5 --
 source3/modules/vfs_acl_common.c      | 14 +-----
 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           | 17 -------
 source3/modules/vfs_cap.c             | 35 -------------
 source3/modules/vfs_catia.c           | 39 --------------
 source3/modules/vfs_ceph.c            | 27 +++++-----
 source3/modules/vfs_ceph_snapshots.c  | 12 +++--
 source3/modules/vfs_default.c         | 45 ++++++++++-------
 source3/modules/vfs_extd_audit.c      | 23 ---------
 source3/modules/vfs_fake_acls.c       | 95 -----------------------------------
 source3/modules/vfs_fruit.c           | 32 +++++++++---
 source3/modules/vfs_full_audit.c      | 21 --------
 source3/modules/vfs_glusterfs.c       | 26 ++++------
 source3/modules/vfs_gpfs.c            | 33 ------------
 source3/modules/vfs_linux_xfs_sgid.c  |  2 +-
 source3/modules/vfs_media_harmony.c   | 34 -------------
 source3/modules/vfs_nfs4acl_xattr.c   | 12 ++---
 source3/modules/vfs_not_implemented.c |  9 ----
 source3/modules/vfs_shadow_copy2.c    | 20 ++++----
 source3/modules/vfs_snapper.c         | 22 ++++----
 source3/modules/vfs_time_audit.c      | 23 ---------
 source3/modules/vfs_unityed_media.c   | 29 -----------
 source3/smbd/dosmode.c                |  2 +-
 source3/smbd/trans2.c                 |  9 +---
 source3/smbd/vfs.c                    |  8 ---
 source3/torture/cmd_vfs.c             | 22 +++++---
 32 files changed, 131 insertions(+), 519 deletions(-)


Changeset truncated at 500 lines:

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 d06a62e5151..7bbd5e189a8 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -338,7 +338,6 @@
  * Version 44 - Add 'have_proc_fds' flag to struct connection_struct.
  * Version 44 - Add 'have_proc_fds' flag to struct files_struct.
  * Version 44 - Add dirfsp arg to SMB_VFS_READDIR()
- * Version 44 - Remove SMB_VFS_GET_DOS_ATTRIBUTES()
  * Version 44 - Replace SMB_VFS_GET_COMPRESSION() with SMB_VFS_FGET_COMPRESSION()
  * Version 44 - Add type argument to SMB_VFS_SYS_ACL_SET_FD()
  * Version 44 - Remove SMB_VFS_SYS_ACL_SET_FILE()
@@ -346,6 +345,8 @@
  * Version 45 - Remove SMB_VFS_LISTXATTR
  * 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_acl_common.c b/source3/modules/vfs_acl_common.c
index db6f40d3adf..39afdcb1cf3 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1360,21 +1360,11 @@ int unlink_acl_common(struct vfs_handle_struct *handle,
 	return -1;
 }
 
-int chmod_acl_module_common(struct vfs_handle_struct *handle,
-			    const struct smb_filename *smb_fname,
-			    mode_t mode)
-{
-	if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
-		/* Only allow this on POSIX pathnames. */
-		return SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
-	}
-	return 0;
-}
-
 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
 			     struct files_struct *fsp, mode_t mode)
 {
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
+	if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES
+	    || fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
 		/* Only allow this on POSIX opens. */
 		return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 	}
diff --git a/source3/modules/vfs_acl_common.h b/source3/modules/vfs_acl_common.h
index c686395bdfa..c4b4fb9c1b3 100644
--- a/source3/modules/vfs_acl_common.h
+++ b/source3/modules/vfs_acl_common.h
@@ -43,9 +43,6 @@ int unlink_acl_common(struct vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			int flags);
-int chmod_acl_module_common(struct vfs_handle_struct *handle,
-			    const struct smb_filename *smb_fname,
-			    mode_t mode);
 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
 			     struct files_struct *fsp, mode_t mode);
 int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 4439a92557e..dab215571b2 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -448,7 +448,6 @@ static struct vfs_fn_pointers vfs_acl_tdb_fns = {
 	.connect_fn = connect_acl_tdb,
 	.disconnect_fn = disconnect_acl_tdb,
 	.unlinkat_fn = unlinkat_acl_tdb,
-	.chmod_fn = chmod_acl_module_common,
 	.fchmod_fn = fchmod_acl_module_common,
 	.fget_nt_acl_fn = acl_tdb_fget_nt_acl,
 	.get_nt_acl_at_fn = acl_tdb_get_nt_acl_at,
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 9e20896cb2f..4f092de0220 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -380,7 +380,6 @@ static NTSTATUS acl_xattr_fset_nt_acl(vfs_handle_struct *handle,
 static struct vfs_fn_pointers vfs_acl_xattr_fns = {
 	.connect_fn = connect_acl_xattr,
 	.unlinkat_fn = acl_xattr_unlinkat,
-	.chmod_fn = chmod_acl_module_common,
 	.fchmod_fn = fchmod_acl_module_common,
 	.fget_nt_acl_fn = acl_xattr_fget_nt_acl,
 	.get_nt_acl_at_fn = acl_xattr_get_nt_acl_at,
diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c
index 72d982b88ae..2b0171b9c09 100644
--- a/source3/modules/vfs_audit.c
+++ b/source3/modules/vfs_audit.c
@@ -294,22 +294,6 @@ static int audit_unlinkat(vfs_handle_struct *handle,
 	return result;
 }
 
-static int audit_chmod(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			mode_t mode)
-{
-	int result;
-
-	result = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
-
-	syslog(audit_syslog_priority(handle), "chmod %s mode 0x%x %s%s\n",
-	       smb_fname->base_name, mode,
-	       (result < 0) ? "failed: " : "",
-	       (result < 0) ? strerror(errno) : "");
-
-	return result;
-}
-
 static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
 	int result;
@@ -332,7 +316,6 @@ static struct vfs_fn_pointers vfs_audit_fns = {
 	.close_fn = audit_close,
 	.renameat_fn = audit_renameat,
 	.unlinkat_fn = audit_unlinkat,
-	.chmod_fn = audit_chmod,
 	.fchmod_fn = audit_fchmod,
 };
 
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 372acff5918..c24a2be05fd 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -333,40 +333,6 @@ static int cap_unlinkat(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int cap_chmod(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			mode_t mode)
-{
-	struct smb_filename *cap_smb_fname = NULL;
-	char *cappath = capencode(talloc_tos(), smb_fname->base_name);
-	int ret;
-	int saved_errno;
-
-	if (!cappath) {
-		errno = ENOMEM;
-		return -1;
-	}
-
-	cap_smb_fname = synthetic_smb_fname(talloc_tos(),
-					cappath,
-					NULL,
-					NULL,
-					smb_fname->twrp,
-					smb_fname->flags);
-	if (cap_smb_fname == NULL) {
-		TALLOC_FREE(cappath);
-		errno = ENOMEM;
-		return -1;
-	}
-
-	ret = SMB_VFS_NEXT_CHMOD(handle, cap_smb_fname, mode);
-	saved_errno = errno;
-	TALLOC_FREE(cappath);
-	TALLOC_FREE(cap_smb_fname);
-	errno = saved_errno;
-	return ret;
-}
-
 static int cap_lchown(vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname,
 			uid_t uid,
@@ -1017,7 +983,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
 	.stat_fn = cap_stat,
 	.lstat_fn = cap_lstat,
 	.unlinkat_fn = cap_unlinkat,
-	.chmod_fn = cap_chmod,
 	.lchown_fn = cap_lchown,
 	.chdir_fn = cap_chdir,
 	.ntimes_fn = cap_ntimes,
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index cb06a4de355..96843095f17 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -742,44 +742,6 @@ static int catia_lchown(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int catia_chmod(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			mode_t mode)
-{
-	char *name = NULL;
-	NTSTATUS status;
-	int ret;
-	int saved_errno;
-	struct smb_filename *catia_smb_fname = NULL;
-
-	status = catia_string_replace_allocate(handle->conn,
-					smb_fname->base_name,
-					&name,
-					vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		return -1;
-	}
-	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
-					name,
-					NULL,
-					&smb_fname->st,
-					smb_fname->twrp,
-					smb_fname->flags);
-	if (catia_smb_fname == NULL) {
-		TALLOC_FREE(name);
-		errno = ENOMEM;
-		return -1;
-	}
-
-	ret = SMB_VFS_NEXT_CHMOD(handle, catia_smb_fname, mode);
-	saved_errno = errno;
-	TALLOC_FREE(name);
-	TALLOC_FREE(catia_smb_fname);
-	errno = saved_errno;
-	return ret;
-}
-
 static int catia_mkdirat(vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
@@ -2185,7 +2147,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 	.fstat_fn = catia_fstat,
 	.lstat_fn = catia_lstat,
 	.unlinkat_fn = catia_unlinkat,
-	.chmod_fn = catia_chmod,
 	.fchmod_fn = catia_fchmod,
 	.fchown_fn = catia_fchown,
 	.lchown_fn = catia_lchown,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 634222df764..d627a2233ae 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -858,24 +858,24 @@ static int cephwrap_unlinkat(struct vfs_handle_struct *handle,
 	WRAP_RETURN(result);
 }
 
-static int cephwrap_chmod(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			mode_t mode)
-{
-	int result;
-
-	DBG_DEBUG("[CEPH] chmod(%p, %s, %d)\n", handle, smb_fname->base_name, mode);
-	result = ceph_chmod(handle->data, smb_fname->base_name, mode);
-	DBG_DEBUG("[CEPH] chmod(...) = %d\n", result);
-	WRAP_RETURN(result);
-}
-
 static int cephwrap_fchmod(struct vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
 	int result;
 
 	DBG_DEBUG("[CEPH] fchmod(%p, %p, %d)\n", handle, fsp, mode);
-	result = ceph_fchmod(handle->data, fsp_get_io_fd(fsp), mode);
+	if (!fsp->fsp_flags.is_pathref) {
+		/*
+		 * We can use an io_fd to remove xattrs.
+		 */
+		result = ceph_fchmod(handle->data, fsp_get_io_fd(fsp), mode);
+	} else {
+		/*
+		 * This is no longer a handle based call.
+		 */
+		result = ceph_chmod(handle->data,
+				    fsp->fsp_name->base_name,
+				    mode);
+	}
 	DBG_DEBUG("[CEPH] fchmod(...) = %d\n", result);
 	WRAP_RETURN(result);
 }
@@ -1576,7 +1576,6 @@ static struct vfs_fn_pointers ceph_fns = {
 	.fstat_fn = cephwrap_fstat,
 	.lstat_fn = cephwrap_lstat,
 	.unlinkat_fn = cephwrap_unlinkat,
-	.chmod_fn = cephwrap_chmod,
 	.fchmod_fn = cephwrap_fchmod,
 	.fchown_fn = cephwrap_fchown,
 	.lchown_fn = cephwrap_lchown,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 7b2307b19ee..eccc5fcbf3e 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -939,13 +939,15 @@ static int ceph_snap_gmt_unlinkat(vfs_handle_struct *handle,
 			flags);
 }
 
-static int ceph_snap_gmt_chmod(vfs_handle_struct *handle,
-			const struct smb_filename *csmb_fname,
-			mode_t mode)
+static int ceph_snap_gmt_fchmod(vfs_handle_struct *handle,
+				struct files_struct *fsp,
+				mode_t mode)
 {
+	const struct smb_filename *csmb_fname = NULL;
 	time_t timestamp = 0;
 	int ret;
 
+	csmb_fname = fsp->fsp_name;
 	ret = ceph_snap_gmt_strip_snapshot(handle,
 					csmb_fname,
 					&timestamp, NULL, 0);
@@ -957,7 +959,7 @@ static int ceph_snap_gmt_chmod(vfs_handle_struct *handle,
 		errno = EROFS;
 		return -1;
 	}
-	return SMB_VFS_NEXT_CHMOD(handle, csmb_fname, mode);
+	return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 }
 
 static int ceph_snap_gmt_chdir(vfs_handle_struct *handle,
@@ -1460,7 +1462,7 @@ static struct vfs_fn_pointers ceph_snap_fns = {
 	.lstat_fn = ceph_snap_gmt_lstat,
 	.openat_fn = ceph_snap_gmt_openat,
 	.unlinkat_fn = ceph_snap_gmt_unlinkat,
-	.chmod_fn = ceph_snap_gmt_chmod,
+	.fchmod_fn = ceph_snap_gmt_fchmod,
 	.chdir_fn = ceph_snap_gmt_chdir,
 	.ntimes_fn = ceph_snap_gmt_ntimes,
 	.readlinkat_fn = ceph_snap_gmt_readlinkat,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 58891a2c1c3..376d7f51ea1 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2408,29 +2408,37 @@ 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;
 
 	START_PROFILE(syscall_fchmod);
-#if defined(HAVE_FCHMOD)
-	result = fchmod(fsp_get_io_fd(fsp), mode);
-#else
-	result = -1;
-	errno = ENOSYS;
-#endif
+
+	if (!fsp->fsp_flags.is_pathref) {
+		result = fchmod(fsp_get_io_fd(fsp), mode);
+		END_PROFILE(syscall_fchmod);
+		return result;
+	}
+
+	if (fsp->fsp_flags.have_proc_fds) {
+		int fd = fsp_get_pathref_fd(fsp);
+		const char *p = NULL;
+		char buf[PATH_MAX];
+
+		p = sys_proc_fd_path(fd, buf, sizeof(buf));
+		if (p != NULL) {
+			result = chmod(p, mode);
+		} else {
+			result = -1;
+		}
+		END_PROFILE(syscall_fchmod);
+		return result;
+	}
+
+	/*
+	 * This is no longer a handle based call.
+	 */
+	result = chmod(fsp->fsp_name->base_name, mode);
 
 	END_PROFILE(syscall_fchmod);
 	return result;
@@ -3799,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_extd_audit.c b/source3/modules/vfs_extd_audit.c
index 45e8f1c5b3b..98ad9bdcacb 100644
--- a/source3/modules/vfs_extd_audit.c
+++ b/source3/modules/vfs_extd_audit.c
@@ -339,28 +339,6 @@ static int audit_unlinkat(vfs_handle_struct *handle,
 	return result;
 }
 
-static int audit_chmod(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list