]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used.
authorJeremy Allison <jra@samba.org>
Tue, 22 Jun 2021 17:22:16 +0000 (10:22 -0700)
committerNoel Power <npower@samba.org>
Wed, 23 Jun 2021 09:04:36 +0000 (09:04 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/modules/posixacl_xattr.c
source3/modules/posixacl_xattr.h

index ef0521eda3476c1e910e0bb5362b433b4c76cd73..a3ef8cdda323131436805e281c46665409a82955 100644 (file)
@@ -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,
index 9e892dd814e5aba30eeff570c3fd357170855ceb..30825a4befb97392c1de772e978aaf85a8ecf572 100644 (file)
 #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,