]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove unused get_ea_dos_attribute()
authorRalph Boehme <slow@samba.org>
Tue, 3 Nov 2020 06:57:37 +0000 (07:57 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:32 +0000 (09:08 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dosmode.c
source3/smbd/proto.h

index b6abbe57688ee02ed6f5bb4cc7fba2fa9328633e..1d2f309a5951df35140df633ec36b70a5d7846bf 100644 (file)
@@ -363,79 +363,6 @@ NTSTATUS parse_dos_attribute_blob(struct smb_filename *smb_fname,
        return NT_STATUS_OK;
 }
 
-NTSTATUS get_ea_dos_attribute(connection_struct *conn,
-                             struct smb_filename *smb_fname,
-                             uint32_t *pattr)
-{
-       DATA_BLOB blob;
-       ssize_t sizeret;
-       fstring attrstr;
-       NTSTATUS status;
-
-       if (!lp_store_dos_attributes(SNUM(conn))) {
-               return NT_STATUS_NOT_IMPLEMENTED;
-       }
-
-       /* Don't reset pattr to zero as we may already have filename-based attributes we
-          need to preserve. */
-
-       sizeret = SMB_VFS_GETXATTR(conn, smb_fname,
-                                  SAMBA_XATTR_DOS_ATTRIB, attrstr,
-                                  sizeof(attrstr));
-       if (sizeret == -1 && errno == EACCES) {
-               int saved_errno = 0;
-
-               /*
-                * According to MS-FSA 2.1.5.1.2.1 "Algorithm to Check Access to
-                * an Existing File" FILE_LIST_DIRECTORY on a directory implies
-                * FILE_READ_ATTRIBUTES for directory entries. Being able to
-                * stat() a file implies FILE_LIST_DIRECTORY for the directory
-                * containing the file.
-                */
-
-               if (!VALID_STAT(smb_fname->st)) {
-                       /*
-                        * Safety net: dos_mode() already checks this, but as we
-                        * become root based on this, add an additional layer of
-                        * defense.
-                        */
-                       DBG_ERR("Rejecting root override, invalid stat [%s]\n",
-                               smb_fname_str_dbg(smb_fname));
-                       return NT_STATUS_ACCESS_DENIED;
-               }
-
-               become_root();
-               sizeret = SMB_VFS_GETXATTR(conn, smb_fname,
-                                          SAMBA_XATTR_DOS_ATTRIB,
-                                          attrstr,
-                                          sizeof(attrstr));
-               if (sizeret == -1) {
-                       saved_errno = errno;
-               }
-               unbecome_root();
-
-               if (saved_errno != 0) {
-                       errno = saved_errno;
-               }
-       }
-       if (sizeret == -1) {
-               DBG_INFO("Cannot get attribute "
-                        "from EA on file %s: Error = %s\n",
-                        smb_fname_str_dbg(smb_fname), strerror(errno));
-               return map_nt_error_from_unix(errno);
-       }
-
-       blob.data = (uint8_t *)attrstr;
-       blob.length = sizeret;
-
-       status = parse_dos_attribute_blob(smb_fname, blob, pattr);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-
-       return NT_STATUS_OK;
-}
-
 NTSTATUS fget_ea_dos_attribute(struct files_struct *fsp,
                              uint32_t *pattr)
 {
index 2af994922d5119d3ec3c9a2986b0dad53bd57927..4c436c004e6ab57026f09b45b00b70c1646a9a4b 100644 (file)
@@ -287,9 +287,6 @@ bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
 bool set_sticky_write_time_fsp(struct files_struct *fsp,
                               struct timespec mtime);
 
-NTSTATUS get_ea_dos_attribute(connection_struct *conn,
-                             struct smb_filename *smb_fname,
-                             uint32_t *pattr);
 NTSTATUS fget_ea_dos_attribute(struct files_struct *fsp,
                              uint32_t *pattr);
 NTSTATUS set_ea_dos_attribute(connection_struct *conn,