vfs_posixacl: support SMB_ACL_TYPE_DEFAULT in posixacl_sys_acl_set_fd()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 06:57:45 +0000 (07:57 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:28 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_posixacl.c

index d573461e9874449e7335466e7486a7e28749a3a0..72c8884ec38a4bb3a1e0bb2ca3d67bc57d424cbb 100644 (file)
@@ -148,7 +148,7 @@ int posixacl_sys_acl_set_fd(vfs_handle_struct *handle,
                return -1;
        }
 
-       if (!fsp->fsp_flags.is_pathref) {
+       if (!fsp->fsp_flags.is_pathref && type == SMB_ACL_TYPE_ACCESS) {
                res = acl_set_fd(fd, acl);
        } else if (fsp->fsp_flags.have_proc_fds) {
                const char *proc_fd_path = NULL;
@@ -158,13 +158,13 @@ int posixacl_sys_acl_set_fd(vfs_handle_struct *handle,
                if (proc_fd_path == NULL) {
                        return -1;
                }
-               res = acl_set_file(proc_fd_path, ACL_TYPE_ACCESS, acl);
+               res = acl_set_file(proc_fd_path, type, acl);
        } else {
                /*
                 * This is no longer a handle based call.
                 */
                res = acl_set_file(fsp->fsp_name->base_name,
-                                  ACL_TYPE_ACCESS,
+                                  type,
                                   acl);
        }