VFS: Remove SMB_VFS_SETXATTR, no longer used
authorNoel Power <noel.power@suse.com>
Fri, 19 Feb 2021 10:39:49 +0000 (10:39 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 11 Mar 2021 17:50:30 +0000 (17:50 +0000)
                                   ---------------
                                  /               \
                                 /      REST       \
                                /        IN         \
                               /        PEACE        \
                              /                       \
                              |                       |
                              |   SMB_VFS_SETXATTR    |
                              |                       |
                              |                       |
                              |       19 February     |
                              |          2021         |
                              |                       |
                              |                       |
                             *|     *  *  *           | *
                    _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Noel Power <noel.power@suse.com>
21 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_ceph.c
source3/modules/vfs_ceph_snapshots.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_posix_eadb.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_vxfs.c
source3/modules/vfs_xattr_tdb.c
source3/smbd/vfs.c

index 3fcbd321564efd35ffaf74ee076a46e2715e32c4..92ae46f7f5a8c9bb5a2f0a7ffc3deb82b2a50993 100644 (file)
@@ -948,17 +948,6 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_setxattr(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
                          const char *name, const void *value, size_t size,
                          int flags)
@@ -1133,7 +1122,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .flistxattr_fn = skel_flistxattr,
        .removexattr_fn = skel_removexattr,
        .fremovexattr_fn = skel_fremovexattr,
-       .setxattr_fn = skel_setxattr,
        .fsetxattr_fn = skel_fsetxattr,
 
        /* aio operations */
index 87eec7544d14e249c3080f2c4d3456a9ef3b070e..93e5626f8acd218063007cac7f1c50baa477e204 100644 (file)
@@ -1239,17 +1239,6 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
 }
 
-static int skel_setxattr(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
-                       name, value, size, flags);
-}
-
 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
                          const char *name, const void *value, size_t size,
                          int flags)
@@ -1439,7 +1428,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .flistxattr_fn = skel_flistxattr,
        .removexattr_fn = skel_removexattr,
        .fremovexattr_fn = skel_fremovexattr,
-       .setxattr_fn = skel_setxattr,
        .fsetxattr_fn = skel_fsetxattr,
 
        /* aio operations */
index db2283b7cd03a7883120f67122b93239fb601a78..96477f27e890610030f454f1617e252969cf952d 100644 (file)
  * Version 44 - Remove SMB_VFS_SYS_ACL_SET_FILE()
  * Change to Version 45 - will ship with 4.15
  * Version 45 - Remove SMB_VFS_LISTXATTR
+ * Version 45 - Remove SMB_VFS_SETXATTR
  */
 
 #define SMB_VFS_INTERFACE_VERSION 45
@@ -1251,12 +1252,6 @@ struct vfs_fn_pointers {
                                        const struct smb_filename *smb_fname,
                                        const char *name);
        int (*fremovexattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name);
-       int (*setxattr_fn)(struct vfs_handle_struct *handle,
-                                       const struct smb_filename *smb_fname,
-                                       const char *name,
-                                       const void *value,
-                                       size_t size,
-                                       int flags);
        int (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags);
 
        /* aio operations */
@@ -1775,12 +1770,6 @@ int smb_vfs_call_removexattr(struct vfs_handle_struct *handle,
                                const char *name);
 int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle,
                              struct files_struct *fsp, const char *name);
-int smb_vfs_call_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags);
 int smb_vfs_call_lsetxattr(struct vfs_handle_struct *handle, const char *path,
                           const char *name, const void *value, size_t size,
                           int flags);
index d006aaf60bdc9e1d13cd1134ca2cac77c05cc514..dab0c306a68befe82283fe242a72980a8c2067ac 100644 (file)
 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
        smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
 
-#define SMB_VFS_SETXATTR(conn,smb_fname,name,value,size,flags) \
-       smb_vfs_call_setxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size),(flags))
-#define SMB_VFS_NEXT_SETXATTR(handle,smb_fname,name,value,size,flags) \
-       smb_vfs_call_setxattr((handle)->next,(smb_fname),(name),(value),(size),(flags))
-
 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
        smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
index 5c2474e66e79b1757010da4d125f27c398668115..4c65361e4e23eba10448b66cf9a4049b473af6b1 100644 (file)
@@ -960,49 +960,6 @@ static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,
         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, cappath);
 }
 
-static int cap_setxattr(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       struct smb_filename *cap_smb_fname = NULL;
-       char *cappath = capencode(talloc_tos(), smb_fname->base_name);
-       char *capname = capencode(talloc_tos(), name);
-       int ret;
-       int saved_errno = 0;
-
-       if (!cappath || !capname) {
-               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);
-               TALLOC_FREE(capname);
-               errno = ENOMEM;
-               return -1;
-       }
-       ret = SMB_VFS_NEXT_SETXATTR(handle, cap_smb_fname,
-                               capname, value, size, flags);
-       if (ret == -1) {
-               saved_errno = errno;
-       }
-       TALLOC_FREE(cappath);
-       TALLOC_FREE(capname);
-       TALLOC_FREE(cap_smb_fname);
-       if (saved_errno) {
-               errno = saved_errno;
-       }
-       return ret;
-}
-
 static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path, const void *value, size_t size, int flags)
 {
        char *cappath = capencode(talloc_tos(), path);
@@ -1116,7 +1073,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
        .fgetxattr_fn = cap_fgetxattr,
        .removexattr_fn = cap_removexattr,
        .fremovexattr_fn = cap_fremovexattr,
-       .setxattr_fn = cap_setxattr,
        .fsetxattr_fn = cap_fsetxattr,
        .create_dfs_pathat_fn = cap_create_dfs_pathat,
        .read_dfs_pathat_fn = cap_read_dfs_pathat
index 977d5d561c6bdc70d59433daeaa26fc96ea6976a..8e648816c68f4b9d482a6cf1c4458446074e2d16 100644 (file)
@@ -1298,66 +1298,6 @@ catia_removexattr(vfs_handle_struct *handle,
        return ret;
 }
 
-static int
-catia_setxattr(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       struct smb_filename *mapped_smb_fname = NULL;
-       char *mapped_name = NULL;
-       char *mapped_ea_name = NULL;
-       NTSTATUS status;
-       ssize_t ret;
-       int saved_errno = 0;
-
-       status = catia_string_replace_allocate(handle->conn,
-                               smb_fname->base_name,
-                               &mapped_name,
-                               vfs_translate_to_unix);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
-               return -1;
-       }
-
-       status = catia_string_replace_allocate(handle->conn,
-                               name, &mapped_ea_name, vfs_translate_to_unix);
-       if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(mapped_name);
-               errno = map_errno_from_nt_status(status);
-               return -1;
-       }
-
-       mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       mapped_name,
-                                       NULL,
-                                       &smb_fname->st,
-                                       smb_fname->twrp,
-                                       smb_fname->flags);
-       if (mapped_smb_fname == NULL) {
-               TALLOC_FREE(mapped_name);
-               TALLOC_FREE(mapped_ea_name);
-               errno = ENOMEM;
-               return -1;
-       }
-
-       ret = SMB_VFS_NEXT_SETXATTR(handle, mapped_smb_fname, mapped_ea_name,
-                       value, size, flags);
-       if (ret == -1) {
-               saved_errno = errno;
-       }
-       TALLOC_FREE(mapped_name);
-       TALLOC_FREE(mapped_ea_name);
-       TALLOC_FREE(mapped_smb_fname);
-       if (saved_errno != 0) {
-               errno = saved_errno;
-       }
-
-       return ret;
-}
-
 static int catia_fstat(vfs_handle_struct *handle,
                       files_struct *fsp,
                       SMB_STRUCT_STAT *sbuf)
@@ -2388,7 +2328,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = catia_removexattr,
-       .setxattr_fn = catia_setxattr,
        .fgetxattr_fn = catia_fgetxattr,
        .flistxattr_fn = catia_flistxattr,
        .fremovexattr_fn = catia_fremovexattr,
index d37e749455a3650cb6ce76c42aba428acbf18388..6eb432e2c98aa414220a76b13733c5e14a8d2553 100644 (file)
@@ -1312,22 +1312,6 @@ static int cephwrap_fremovexattr(struct vfs_handle_struct *handle, struct files_
        WRAP_RETURN(ret);
 }
 
-static int cephwrap_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags)
-{
-       int ret;
-       DBG_DEBUG("[CEPH] setxattr(%p, %s, %s, %p, %llu, %d)\n", handle,
-                       smb_fname->base_name, name, value, llu(size), flags);
-       ret = ceph_setxattr(handle->data, smb_fname->base_name,
-                       name, value, size, flags);
-       DBG_DEBUG("[CEPH] setxattr(...) = %d\n", ret);
-       WRAP_RETURN(ret);
-}
-
 static int cephwrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
 {
        int ret;
@@ -1582,7 +1566,6 @@ static struct vfs_fn_pointers ceph_fns = {
        .flistxattr_fn = cephwrap_flistxattr,
        .removexattr_fn = cephwrap_removexattr,
        .fremovexattr_fn = cephwrap_fremovexattr,
-       .setxattr_fn = cephwrap_setxattr,
        .fsetxattr_fn = cephwrap_fsetxattr,
 
        /* Posix ACL Operations */
index a6d06df98c6a4538832accf78e389e0527f5ef4c..3211c1c7dce6ce06008fda757956a48dd1209874 100644 (file)
@@ -1319,29 +1319,6 @@ static int ceph_snap_gmt_removexattr(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_REMOVEXATTR(handle, csmb_fname, aname);
 }
 
-static int ceph_snap_gmt_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *csmb_fname,
-                               const char *aname, const void *value,
-                               size_t size, int flags)
-{
-       time_t timestamp = 0;
-       int ret;
-
-       ret = ceph_snap_gmt_strip_snapshot(handle,
-                                       csmb_fname,
-                                       &timestamp, NULL, 0);
-       if (ret < 0) {
-               errno = -ret;
-               return -1;
-       }
-       if (timestamp != 0) {
-               errno = EROFS;
-               return -1;
-       }
-       return SMB_VFS_NEXT_SETXATTR(handle, csmb_fname,
-                               aname, value, size, flags);
-}
-
 static int ceph_snap_gmt_fsetxattr(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                const char *aname, const void *value,
@@ -1516,7 +1493,6 @@ static struct vfs_fn_pointers ceph_snap_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = ceph_snap_gmt_removexattr,
-       .setxattr_fn = ceph_snap_gmt_setxattr,
        .fsetxattr_fn = ceph_snap_gmt_fsetxattr,
        .chflags_fn = ceph_snap_gmt_chflags,
        .get_real_filename_fn = ceph_snap_gmt_get_real_filename,
index 7291813f60931b5c49304f41f37ddc5909576351..e48deb022a7e79f52640b84ce4bbe37c60111593 100644 (file)
@@ -3671,16 +3671,6 @@ static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_s
        return removexattr(fsp->fsp_name->base_name, name);
 }
 
-static int vfswrap_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags)
-{
-       return setxattr(smb_fname->base_name, name, value, size, flags);
-}
-
 static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
 {
        int fd = fsp_get_pathref_fd(fsp);
@@ -3891,7 +3881,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .flistxattr_fn = vfswrap_flistxattr,
        .removexattr_fn = vfswrap_removexattr,
        .fremovexattr_fn = vfswrap_fremovexattr,
-       .setxattr_fn = vfswrap_setxattr,
        .fsetxattr_fn = vfswrap_fsetxattr,
 
        /* aio operations */
index eb7f836a84edd2fcf1a809f52e0601716910a759..e89307ce6a101f132155dc25739963b651db0fb4 100644 (file)
@@ -212,7 +212,6 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_FLISTXATTR,
        SMB_VFS_OP_REMOVEXATTR,
        SMB_VFS_OP_FREMOVEXATTR,
-       SMB_VFS_OP_SETXATTR,
        SMB_VFS_OP_FSETXATTR,
 
        /* aio operations */
@@ -343,7 +342,6 @@ static struct {
        { SMB_VFS_OP_FLISTXATTR,        "flistxattr" },
        { SMB_VFS_OP_REMOVEXATTR,       "removexattr" },
        { SMB_VFS_OP_FREMOVEXATTR,      "fremovexattr" },
-       { SMB_VFS_OP_SETXATTR,  "setxattr" },
        { SMB_VFS_OP_FSETXATTR, "fsetxattr" },
        { SMB_VFS_OP_AIO_FORCE, "aio_force" },
        { SMB_VFS_OP_IS_OFFLINE, "is_offline" },
@@ -2863,26 +2861,6 @@ static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
-                         const struct smb_filename *smb_fname,
-                         const char *name, const void *value, size_t size,
-                         int flags)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
-                                      flags);
-
-       do_log(SMB_VFS_OP_SETXATTR,
-              (result >= 0),
-              handle,
-              "%s|%s",
-              smb_fname_str_do_log(handle->conn, smb_fname),
-              name);
-
-       return result;
-}
-
 static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
                           struct files_struct *fsp, const char *name,
                           const void *value, size_t size, int flags)
@@ -3078,7 +3056,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .flistxattr_fn = smb_full_audit_flistxattr,
        .removexattr_fn = smb_full_audit_removexattr,
        .fremovexattr_fn = smb_full_audit_fremovexattr,
-       .setxattr_fn = smb_full_audit_setxattr,
        .fsetxattr_fn = smb_full_audit_fsetxattr,
        .aio_force_fn = smb_full_audit_aio_force,
        .durable_cookie_fn = smb_full_audit_durable_cookie,
index 8cfc8f80fa9a4686dd94a7b6b6fe4ee460924821..c3fe1c60f7f8a464acdbbf5b20a4da6b038c8049 100644 (file)
@@ -2072,14 +2072,6 @@ static int vfs_gluster_fremovexattr(struct vfs_handle_struct *handle,
        return glfs_fremovexattr(glfd, name);
 }
 
-static int vfs_gluster_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value, size_t size, int flags)
-{
-       return glfs_setxattr(handle->data, smb_fname->base_name, name, value, size, flags);
-}
-
 static int vfs_gluster_fsetxattr(struct vfs_handle_struct *handle,
                                 files_struct *fsp, const char *name,
                                 const void *value, size_t size, int flags)
@@ -2352,7 +2344,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
        .flistxattr_fn = vfs_gluster_flistxattr,
        .removexattr_fn = vfs_gluster_removexattr,
        .fremovexattr_fn = vfs_gluster_fremovexattr,
-       .setxattr_fn = vfs_gluster_setxattr,
        .fsetxattr_fn = vfs_gluster_fsetxattr,
 
        /* AIO Operations */
index 4c1e9aa657639387a6e2a5c2389be1cbd708aeae..67ac950cbd7eb40aa983a6bab1e6705129fb7521 100644 (file)
@@ -2166,37 +2166,6 @@ out:
  * Failure: set errno, return -1
  * In this case, "name" is an attr name.
  */
-static int mh_setxattr(struct vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               const char *name,
-               const void *value,
-               size_t size,
-               int flags)
-{
-       int status;
-       struct smb_filename *clientFname = NULL;
-
-       DEBUG(MH_INFO_DEBUG, ("Entering mh_setxattr\n"));
-       if (!is_in_media_files(smb_fname->base_name)) {
-               status = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value,
-                               size, flags);
-               goto out;
-       }
-
-       status = alloc_get_client_smb_fname(handle,
-                               talloc_tos(),
-                               smb_fname,
-                               &clientFname);
-       if (status != 0) {
-               goto err;
-       }
-       status = SMB_VFS_NEXT_SETXATTR(handle, clientFname, name, value,
-                       size, flags);
-err:
-       TALLOC_FREE(clientFname);
-out:
-       return status;
-}
 
 /* VFS operations structure */
 
@@ -2250,7 +2219,6 @@ static struct vfs_fn_pointers vfs_mh_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = mh_removexattr,
-       .setxattr_fn = mh_setxattr,
 
        /* aio operations */
 };
index 316f92d654542fa1f11d20c94e99be698febff84..52dd75f982976827eb08d7ddbd8f3b78e8890e7a 100644 (file)
@@ -952,17 +952,6 @@ int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
        return -1;
 }
 
-int vfs_not_implemented_setxattr(vfs_handle_struct *handle,
-                                const struct smb_filename *smb_fname,
-                                const char *name,
-                                const void *value,
-                                size_t size,
-                                int flags)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
                                  const char *name, const void *value, size_t size,
                                  int flags)
@@ -1137,7 +1126,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .flistxattr_fn = vfs_not_implemented_flistxattr,
        .removexattr_fn = vfs_not_implemented_removexattr,
        .fremovexattr_fn = vfs_not_implemented_fremovexattr,
-       .setxattr_fn = vfs_not_implemented_setxattr,
        .fsetxattr_fn = vfs_not_implemented_fsetxattr,
 
        /* aio operations */
index 8779e274886e3cc9cc7a727119fe6f6a227badaa..c00fb699dafa1c2c40cc1e0f4ed1cb591e7c1c26 100644 (file)
@@ -126,21 +126,6 @@ static int posix_eadb_setattr(struct tdb_wrap *db_ctx,
        return 0;
 }
 
-static int posix_eadb_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags)
-{
-       struct tdb_wrap *db;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, db, struct tdb_wrap, return -1);
-
-       return posix_eadb_setattr(db, smb_fname->base_name,
-                       -1, name, value, size, flags);
-}
-
 static int posix_eadb_fsetxattr(struct vfs_handle_struct *handle,
                               struct files_struct *fsp,
                               const char *name, const void *value,
@@ -476,7 +461,6 @@ static struct vfs_fn_pointers vfs_posix_eadb_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .fgetxattr_fn = posix_eadb_fgetxattr,
-       .setxattr_fn = posix_eadb_setxattr,
        .fsetxattr_fn = posix_eadb_fsetxattr,
        .flistxattr_fn = posix_eadb_flistxattr,
        .removexattr_fn = posix_eadb_removexattr,
index 4903f18c3689143ffb23fe6458f987c59195a58a..fbeebf026cbef1ae654fe9e64369607c9e2e4c64 100644 (file)
@@ -2333,28 +2333,6 @@ static int shadow_copy2_removexattr(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, aname);
 }
 
-static int shadow_copy2_setxattr(struct vfs_handle_struct *handle,
-                                const struct smb_filename *smb_fname,
-                                const char *aname, const void *value,
-                                size_t size, int flags)
-{
-       time_t timestamp = 0;
-
-       if (!shadow_copy2_strip_snapshot(talloc_tos(),
-                               handle,
-                               smb_fname,
-                               &timestamp,
-                               NULL)) {
-               return -1;
-       }
-       if (timestamp != 0) {
-               errno = EROFS;
-               return -1;
-       }
-       return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
-                               aname, value, size, flags);
-}
-
 static int shadow_copy2_fsetxattr(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
                                 const char *aname, const void *value,
@@ -3225,7 +3203,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = shadow_copy2_removexattr,
-       .setxattr_fn = shadow_copy2_setxattr,
        .fsetxattr_fn = shadow_copy2_fsetxattr,
        .chflags_fn = shadow_copy2_chflags,
        .get_real_filename_fn = shadow_copy2_get_real_filename,
index a9d88e6fcd67dfba88e41fde21987fca0eca4ee5..564b4bee125bc00a5252d3238057b205135eaa2e 100644 (file)
@@ -2531,28 +2531,6 @@ static int snapper_gmt_removexattr(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, aname);
 }
 
-static int snapper_gmt_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *aname, const void *value,
-                               size_t size, int flags)
-{
-       time_t timestamp = 0;
-
-       if (!snapper_gmt_strip_snapshot(talloc_tos(),
-                                       handle,
-                                       smb_fname,
-                                       &timestamp,
-                                       NULL)) {
-               return -1;
-       }
-       if (timestamp != 0) {
-               errno = EROFS;
-               return -1;
-       }
-       return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
-                               aname, value, size, flags);
-}
-
 static int snapper_gmt_fsetxattr(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                const char *aname, const void *value,
@@ -2779,7 +2757,6 @@ static struct vfs_fn_pointers snapper_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = snapper_gmt_removexattr,
-       .setxattr_fn = snapper_gmt_setxattr,
        .fsetxattr_fn = snapper_gmt_fsetxattr,
        .chflags_fn = snapper_gmt_chflags,
        .get_real_filename_fn = snapper_gmt_get_real_filename,
index 4de617c262bd4afbc3df182d3bd9eb36c714bce1..4c7f65020b1c57738c24a3af785bdd497448dbea 100644 (file)
@@ -2694,31 +2694,6 @@ static int smb_time_audit_fremovexattr(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_time_audit_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
-                                      flags);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("setxattr", timediff,
-                               smb_fname->base_name);
-       }
-
-       return result;
-}
-
 static int smb_time_audit_fsetxattr(struct vfs_handle_struct *handle,
                                    struct files_struct *fsp, const char *name,
                                    const void *value, size_t size, int flags)
@@ -2929,7 +2904,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .flistxattr_fn = smb_time_audit_flistxattr,
        .removexattr_fn = smb_time_audit_removexattr,
        .fremovexattr_fn = smb_time_audit_fremovexattr,
-       .setxattr_fn = smb_time_audit_setxattr,
        .fsetxattr_fn = smb_time_audit_fsetxattr,
        .aio_force_fn = smb_time_audit_aio_force,
        .durable_cookie_fn = smb_time_audit_durable_cookie,
index ca0d84d8aebe98cdeb38ef62c1db25ef1106664a..e2d445ca9d723a4e4abe594f83f4b3ad7a8b6b1c 100644 (file)
@@ -1759,39 +1759,6 @@ err:
        return status;
 }
 
-static int um_setxattr(struct vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname,
-                      const char *name,
-                      const void *value,
-                      size_t size,
-                      int flags)
-{
-       int status;
-       struct smb_filename *client_fname = NULL;
-
-       DEBUG(10, ("Entering um_setxattr\n"));
-
-       if (!is_in_media_files(smb_fname->base_name)) {
-               return SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value,
-                                            size, flags);
-       }
-
-       status = alloc_get_client_smb_fname(handle,
-                               talloc_tos(),
-                               smb_fname,
-                               &client_fname);
-       if (status != 0) {
-               goto err;
-       }
-
-       status = SMB_VFS_NEXT_SETXATTR(handle, client_fname, name, value,
-                                      size, flags);
-
-err:
-       TALLOC_FREE(client_fname);
-       return status;
-}
-
 static int um_connect(vfs_handle_struct *handle,
                         const char *service,
                         const char *user)
@@ -1882,7 +1849,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
        .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
        .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
        .removexattr_fn = um_removexattr,
-       .setxattr_fn = um_setxattr,
 };
 
 static_decl_vfs;
index 00877c5f7ea39d939630719525acc96f2c381fd1..3dedf8d489d2fc30bcce26bcc6c5c6bc62545e10 100644 (file)
@@ -499,84 +499,6 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl);
 }
 
-static int vxfs_set_xattr(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname_in,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       struct smb_filename *smb_fname = NULL;
-       bool is_dir = false;
-       int ret = 0;
-       int saved_errno = 0;
-
-       DEBUG(10, ("In vxfs_set_xattr\n"));
-
-       smb_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname_in);
-       if (smb_fname == NULL) {
-               errno = ENOMEM;
-               return -1;
-       }
-
-       if (SMB_VFS_NEXT_STAT(handle, smb_fname) != 0) {
-               TALLOC_FREE(smb_fname);
-               return -1;
-       }
-
-       is_dir = S_ISDIR(smb_fname->st.st_ex_mode);
-
-       ret = vxfs_setxattr_path(smb_fname_in->base_name, name, value, size,
-                                flags, is_dir);
-       if ((ret == 0) ||
-           ((ret == -1) && (errno != ENOTSUP) && (errno != ENOSYS))) {
-               /*
-                * Now remve old style xattr if it exists
-                */
-               SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, name);
-               /*
-                * Do not bother about return value
-                */
-               if (ret != 0) {
-                       saved_errno = errno;
-               }
-               goto fail;
-       }
-
-       DEBUG(10, ("Fallback to xattr\n"));
-       if (strcmp(name, XATTR_NTACL_NAME) == 0) {
-               ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
-                                           XATTR_USER_NTACL,
-                                           value, size, flags);
-               if (ret != 0) {
-                       saved_errno = errno;
-                       goto fail;
-               }
-               return 0;
-       }
-
-       /* Clients can't set XATTR_USER_NTACL directly. */
-       if (strcasecmp(name, XATTR_USER_NTACL) == 0) {
-               saved_errno = EACCES;
-               ret = -1;
-               goto fail;
-       }
-
-       ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
-                                   name, value, size, flags);
-       if (ret != 0) {
-               saved_errno = errno;
-               goto fail;
-       }
-
-fail:
-       TALLOC_FREE(smb_fname);
-       if (saved_errno != 0) {
-               saved_errno = errno;
-       }
-       return ret;
-}
-
 static int vxfs_fset_xattr(struct vfs_handle_struct *handle,
                           struct files_struct *fsp, const char *name,
                           const void *value, size_t size,  int flags){
@@ -911,7 +833,6 @@ static struct vfs_fn_pointers vfs_vxfs_fns = {
        .flistxattr_fn = vxfs_flistxattr,
        .removexattr_fn = vxfs_remove_xattr,
        .fremovexattr_fn = vxfs_fremove_xattr,
-       .setxattr_fn = vxfs_set_xattr,
        .fsetxattr_fn = vxfs_fset_xattr,
 };
 
index 81ee8be493a34ae899f90a485143a5ebf55e1cab..bc233abd0a6b89b6d07cdbfcb85dffcab674ad94 100644 (file)
@@ -283,35 +283,6 @@ static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
        return xattr_size;
 }
 
-static int xattr_tdb_setxattr(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *name,
-                               const void *value,
-                               size_t size,
-                               int flags)
-{
-       struct file_id id;
-       struct db_context *db;
-       int ret;
-       TALLOC_CTX *frame = talloc_stackframe();
-
-       SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
-                               if (!xattr_tdb_init(-1, frame, &db))
-                               {
-                                       TALLOC_FREE(frame); return -1;
-                               });
-
-       ret = xattr_tdb_get_file_id(handle, smb_fname->base_name, &id);
-       if (ret == -1) {
-               TALLOC_FREE(frame);
-               return -1;
-       }
-
-       ret = xattr_tdb_setattr(db, &id, name, value, size, flags);
-       TALLOC_FREE(frame);
-       return ret;
-}
-
 static int xattr_tdb_fsetxattr(struct vfs_handle_struct *handle,
                               struct files_struct *fsp,
                               const char *name, const void *value,
@@ -710,7 +681,6 @@ static struct vfs_fn_pointers vfs_xattr_tdb_fns = {
        .getxattrat_send_fn = xattr_tdb_getxattrat_send,
        .getxattrat_recv_fn = xattr_tdb_getxattrat_recv,
        .fgetxattr_fn = xattr_tdb_fgetxattr,
-       .setxattr_fn = xattr_tdb_setxattr,
        .fsetxattr_fn = xattr_tdb_fsetxattr,
        .flistxattr_fn = xattr_tdb_flistxattr,
        .removexattr_fn = xattr_tdb_removexattr,
index d15e6b3ec29547d60544270cf313e3815c5c052c..c966135d27dcba8c5d78325e02001438d15734c7 100644 (file)
@@ -2940,18 +2940,6 @@ int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle,
        return handle->fns->fremovexattr_fn(handle, fsp, name);
 }
 
-int smb_vfs_call_setxattr(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *name,
-                       const void *value,
-                       size_t size,
-                       int flags)
-{
-       VFS_FIND(setxattr);
-       return handle->fns->setxattr_fn(handle, smb_fname,
-                       name, value, size, flags);
-}
-
 int smb_vfs_call_fsetxattr(struct vfs_handle_struct *handle,
                           struct files_struct *fsp, const char *name,
                           const void *value, size_t size, int flags)