]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/modules: VFS: cap: remove cap_chmod
authorNoel Power <noel.power@suse.com>
Thu, 8 Apr 2021 11:39:48 +0000 (12:39 +0100)
committerNoel Power <npower@samba.org>
Sun, 11 Apr 2021 22:27:34 +0000 (22:27 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_cap.c

index 372acff591869573b3322aeb6bd8db3c4c9c8a95..c24a2be05fd19d8968392925c245580dfed4b979 100644 (file)
@@ -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,