]> git.ipfire.org Git - thirdparty/samba.git/commit
s3/smbd: handle EACCES when fetching DOS attributes from xattr
authorRalph Boehme <slow@samba.org>
Thu, 8 Jun 2017 17:10:20 +0000 (19:10 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 14 Aug 2017 08:50:10 +0000 (10:50 +0200)
commitc493d8e6405f6a2dd33a24f7f5237d18aab3a576
tree30ea01613f881c66314173db7db9b44bddae45bf
parent5b3f03171a56c876cfae35163f46bcd406b3ea76
s3/smbd: handle EACCES when fetching DOS attributes from xattr

When trying to fetch the DOS attributes xattr via SMB_VFS_GETXATTR() if
the filesystem doesn't grant read access to the file the xattr read
request fails with EACCESS.

But 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.

So if the user can open the parent directory for reading this implies
FILE_LIST_DIRECTORY and we can safely call SMB_VFS_GETXATTR() as root,
ensuring we can read the DOS attributes xattr.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(backported from commit c54fcb7cbd0de244eed4134e877da6e9c16e7aab)
source3/smbd/dosmode.c