1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3: libsmb: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.

The info level it uses doesn't return that, previously we
were using the field that is returned as the EA size as
the inode number (which is usually zero, so the code in
libsmbclient would then synthesize an inode number from
a hash of the pathname, which is all it can do for SMB1).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Jeremy Allison 2019-10-17 11:39:02 -07:00 committed by Andreas Schneider
parent 7c83b1ade7
commit d495074ee2

View File

@ -878,7 +878,15 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
*size = IVAL2_TO_SMB_BIG_UINT(state->data,48);
}
if (ino) {
*ino = IVAL(state->data, 64);
/*
* SMB1 qpathinfo2 uses SMB_QUERY_FILE_ALL_INFO
* which doesn't return an inode number (fileid).
* We can't change this to one of the FILE_ID
* info levels as only Win2003 and above support
* these [MS-SMB: 2.2.2.3.1] and the SMB1 code
* needs to support older servers.
*/
*ino = 0;
}
return NT_STATUS_OK;
}