From 467dbdbdde30a8214200bf2be7674bbcb07460f8 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sun, 13 Dec 2020 08:55:39 +0100 Subject: [PATCH] posixacl_xattr: add support for SMB_ACL_TYPE_DEFAULT in posixacl_xattr_acl_set_fd() No need to handle pathref fsps here, as that is taken care of by SMB_VFS_FSETXATTR(). Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/modules/posixacl_xattr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c index e88c6cecace..7582ceb121e 100644 --- a/source3/modules/posixacl_xattr.c +++ b/source3/modules/posixacl_xattr.c @@ -483,10 +483,20 @@ int posixacl_xattr_acl_set_fd(vfs_handle_struct *handle, SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { + const char *name = NULL; char *buf; ssize_t size; int ret; + if (type == SMB_ACL_TYPE_ACCESS) { + name = ACL_EA_ACCESS; + } else if (type == SMB_ACL_TYPE_DEFAULT) { + name = ACL_EA_DEFAULT; + } else { + errno = EINVAL; + return -1; + } + size = smb_acl_to_posixacl_xattr(theacl, NULL, 0); buf = alloca(size); if (!buf) { @@ -499,7 +509,7 @@ int posixacl_xattr_acl_set_fd(vfs_handle_struct *handle, return -1; } - return SMB_VFS_FSETXATTR(fsp, ACL_EA_ACCESS, buf, size, 0); + return SMB_VFS_FSETXATTR(fsp, name, buf, size, 0); } int posixacl_xattr_acl_delete_def_file(vfs_handle_struct *handle, -- 2.47.2