From: Jeremy Allison Date: Fri, 19 Mar 2021 21:02:17 +0000 (-0700) Subject: s3: VFS: vxfs: Remove vxfs_remove_xattr() - no longer called. X-Git-Tag: tevent-0.11.0~1277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2a06e71cad98b730d26ca0cb9ebe7eb516a10a9;p=thirdparty%2Fsamba.git s3: VFS: vxfs: Remove vxfs_remove_xattr() - no longer called. Also remove supporting function from lib_vxfs.c. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/lib_vxfs.c b/source3/modules/lib_vxfs.c index 13b2e612a27..432eadd1865 100644 --- a/source3/modules/lib_vxfs.c +++ b/source3/modules/lib_vxfs.c @@ -121,27 +121,6 @@ int vxfs_removexattr_fd(int fd, const char *name) return ret; } -int vxfs_removexattr_path(const char *path, const char *name, bool is_dir) -{ - int ret, fd = -1; - - if (is_dir) { - fd = open(path, O_RDONLY|O_DIRECTORY); - } else { - fd = open(path, O_WRONLY); - } - if (fd == -1) { - DEBUG(10, ("file not opened: vxfs_removexattr_path for %s\n", - path)); - return -1; - } - - ret = vxfs_removexattr_fd(fd, name); - close(fd); - - return ret; -} - int vxfs_listxattr_fd(int fd, char *list, size_t size) { int ret; diff --git a/source3/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c index 3dedf8d489d..6c6f92e1f52 100644 --- a/source3/modules/vfs_vxfs.c +++ b/source3/modules/vfs_vxfs.c @@ -585,57 +585,6 @@ static ssize_t vxfs_fget_xattr(struct vfs_handle_struct *handle, return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size); } -static int vxfs_remove_xattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname_in, - const char *name) -{ - bool is_dir = false; - int ret = 0, ret_new = 0, old_errno; - struct smb_filename *smb_fname = NULL; - - DEBUG(10, ("In vxfs_remove_xattr\n")); - - smb_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname_in); - if (smb_fname == NULL) { - errno = ENOMEM; - return -1; - } - - /* Remove with old way */ - if (strcmp(name, XATTR_NTACL_NAME) == 0) { - ret = SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, - XATTR_USER_NTACL); - } else { - if (strcasecmp(name, XATTR_USER_NTACL) != 0) { - ret = SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, - name); - } - } - /* Remove with new way */ - old_errno = errno; - - 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); - TALLOC_FREE(smb_fname); - /* - * If both fail, return failuer else return whichever succeeded - */ - ret_new = vxfs_removexattr_path(smb_fname_in->base_name, name, is_dir); - if (errno == ENOTSUP || errno == ENOSYS) { - errno = old_errno; - } - if ((ret_new != -1) && (ret == -1)) { - ret = ret_new; - } - - return ret; - -} - static int vxfs_fremove_xattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name){ int ret = 0, ret_new = 0, old_errno; @@ -831,7 +780,6 @@ static struct vfs_fn_pointers vfs_vxfs_fns = { .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv, .fgetxattr_fn = vxfs_fget_xattr, .flistxattr_fn = vxfs_flistxattr, - .removexattr_fn = vxfs_remove_xattr, .fremovexattr_fn = vxfs_fremove_xattr, .fsetxattr_fn = vxfs_fset_xattr, }; diff --git a/source3/modules/vfs_vxfs.h b/source3/modules/vfs_vxfs.h index e081baa0fc7..afeccd85502 100644 --- a/source3/modules/vfs_vxfs.h +++ b/source3/modules/vfs_vxfs.h @@ -23,7 +23,6 @@ int vxfs_setxattr_fd(int, const char *, const void *, size_t, int); int vxfs_getxattr_path(const char *, const char *, void *, size_t); int vxfs_getxattr_fd(int, const char *, void *, size_t); -int vxfs_removexattr_path(const char *, const char *, bool); int vxfs_removexattr_fd(int, const char *); int vxfs_listxattr_fd(int, char *, size_t);