1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

vfs_zfsacl: return synthesized ACL when ZFS return ENOTSUP

This allows accessing the ZFS .snapshots directory where ZFS returns
ENOTSUP when calling acl(".snapshots").

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13175

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 18 22:03:21 CEST 2018 on sn-devel-144
This commit is contained in:
Ralph Boehme 2017-12-05 08:28:28 +01:00 committed by Jeremy Allison
parent ec2a408313
commit f93cc23237

View File

@ -238,7 +238,20 @@ static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
fsp->fsp_name, &pacl);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(frame);
return status;
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);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
(*ppdesc)->type |= SEC_DESC_DACL_PROTECTED;
return NT_STATUS_OK;
}
status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, mem_ctx,
@ -260,7 +273,26 @@ 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)) {
TALLOC_FREE(frame);
return status;
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;
}
status = make_default_filesystem_acl(mem_ctx,
DEFAULT_ACL_POSIX,
smb_fname->base_name,
&smb_fname->st,
ppdesc);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
(*ppdesc)->type |= SEC_DESC_DACL_PROTECTED;
return NT_STATUS_OK;
}
status = smb_get_nt_acl_nfs4(handle->conn,