From 7d72b5dcf2634f355213eb17003de0777479c0a3 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 5 Dec 2017 08:28:28 +0100 Subject: [PATCH] vfs_zfsacl: return synthesized ACL when ZFS return ENOTSUP This allows accessing the ZFS .snapshots directory where ZFS returns ENOTSUP when calling acl(".snapshots"). --- source3/modules/vfs_zfsacl.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c index 2e277c67a24..6ca638eee6f 100644 --- a/source3/modules/vfs_zfsacl.c +++ b/source3/modules/vfs_zfsacl.c @@ -238,6 +238,14 @@ static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle, fsp->fsp_name, &pacl); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); + if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + return status; + } + status = make_default_filesystem_acl(mem_ctx, + DEFAULT_ACL_POSIX, + fsp->fsp_name->base_name, + &fsp->fsp_name->st, + ppdesc); return status; } @@ -259,7 +267,25 @@ static NTSTATUS zfsacl_get_nt_acl(struct vfs_handle_struct *handle, status = zfs_get_nt_acl_common(handle->conn, frame, smb_fname, &pacl); if (!NT_STATUS_IS_OK(status)) { + SMB_STRUCT_STAT st; + TALLOC_FREE(frame); + if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + return status; + } + + if (!VALID_STAT(smb_fname->st)) { + DBG_ERR("No stat info for [%s]\n", + smb_fname_str_dbg(smb_fname)); + return NT_STATUS_INTERNAL_ERROR; + } + st = smb_fname->st; + + status = make_default_filesystem_acl(mem_ctx, + DEFAULT_ACL_POSIX, + smb_fname->base_name, + &st, + ppdesc); return status; } -- 2.14.1