From: Jeremy Allison Date: Tue, 22 Jun 2021 17:22:16 +0000 (-0700) Subject: s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used. X-Git-Tag: tevent-0.11.0~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246a19661026ddfbcebeba7b291a779f6bac9a55;p=thirdparty%2Fsamba.git s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c index ef0521eda34..a3ef8cdda32 100644 --- a/source3/modules/posixacl_xattr.c +++ b/source3/modules/posixacl_xattr.c @@ -335,78 +335,6 @@ static int smb_acl_to_posixacl_xattr(SMB_ACL_T theacl, char *buf, size_t len) return size; } -SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - SMB_ACL_TYPE_T type, - TALLOC_CTX *mem_ctx) -{ - int ret; - int size; - char *buf; - const char *name; - - 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 NULL; - } - - size = ACL_EA_SIZE(20); - buf = alloca(size); - if (!buf) { - return NULL; - } - - ret = SMB_VFS_GETXATTR(handle->conn, smb_fname, - name, buf, size); - if (ret < 0 && errno == ERANGE) { - size = SMB_VFS_GETXATTR(handle->conn, smb_fname, - name, NULL, 0); - if (size > 0) { - buf = alloca(size); - if (!buf) { - return NULL; - } - ret = SMB_VFS_GETXATTR(handle->conn, - smb_fname, name, - buf, size); - } - } - - if (ret > 0) { - return posixacl_xattr_to_smb_acl(buf, ret, mem_ctx); - } - if (ret == 0 || errno == ENOATTR) { - mode_t mode = 0; - TALLOC_CTX *frame = talloc_stackframe(); - struct smb_filename *smb_fname_tmp = - cp_smb_filename_nostream(frame, smb_fname); - if (smb_fname_tmp == NULL) { - errno = ENOMEM; - ret = -1; - } else { - ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp); - if (ret == 0) { - mode = smb_fname_tmp->st.st_ex_mode; - } - } - TALLOC_FREE(frame); - if (ret == 0) { - if (type == SMB_ACL_TYPE_ACCESS) { - return mode_to_smb_acl(mode, mem_ctx); - } - if (S_ISDIR(mode)) { - return sys_acl_init(mem_ctx); - } - errno = EACCES; - } - } - return NULL; -} - SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_TYPE_T type, diff --git a/source3/modules/posixacl_xattr.h b/source3/modules/posixacl_xattr.h index 9e892dd814e..30825a4befb 100644 --- a/source3/modules/posixacl_xattr.h +++ b/source3/modules/posixacl_xattr.h @@ -21,11 +21,6 @@ #ifndef __POSIXACL_XATTR_H__ #define __POSIXACL_XATTR_H__ -SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - SMB_ACL_TYPE_T type, - TALLOC_CTX *mem_ctx); - SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_TYPE_T type,