s3:pylibsmb: Add FILE_READ_ATTRIBUTES access to .loadfile() API
commitc9fdea2e361c842d566d662255a361c07932d003
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 11 Jan 2019 01:25:32 +0000 (11 14:25 +1300)
committerKarolin Seeger <kseeger@samba.org>
Mon, 4 Feb 2019 08:50:08 +0000 (4 09:50 +0100)
tree41753e95e1bb056b2aa1d7231bce15943fe19036
parentb47e42e04006549ae24360191e3b36f6cc01dc2f
s3:pylibsmb: Add FILE_READ_ATTRIBUTES access to .loadfile() API

Add FILE_READ_ATTRIBUTES when opening the file handle, as we need to
read the file's size.

The .loadfile() API can end up calling cli_qfileinfo_basic() to get the
file size. This can end up doing a 'FILE_ALL_INFORMATION' SMBv2 request
underneath, which the MS-SMB2 spec (section 3.3.5.20.1 Handling
SMB2_0_INFO_FILE) says the file handle must have FILE_READ_ATTRIBUTES
access granted.

I noticed this problem when running .loadfile() against the NTVFS
server.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0304b08de5ba1b4a6e08568a559c52f7d9e943d3)
source3/libsmb/pylibsmb.c