From 6a82cb7b687caa89c7e994b85715a15bfe6d3fe3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 30 Sep 2014 10:02:01 +0200 Subject: libcli/smb: list NT_STATUS_FILE_CLOSED as expected ioctl response. Some IOCTL requests change the behavior with new protocol versions. E.g. FSCTL_VALIDATE_NEGOTIATE_INFO resulted in NT_STATUS_FILE_CLOSED for old servers. As SMB2 signing might be skipped for responses with NT_STATUS_FILE_CLOSED we need to list it explicitly in the expected return values. This way we'll get NT_STATUS_ACCESS_DENIED, if the server doesn't sign the response to a signed requests. Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- libcli/smb/smb2cli_ioctl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libcli/smb/smb2cli_ioctl.c b/libcli/smb/smb2cli_ioctl.c index 30906935b6..b0f8eea65b 100644 --- a/libcli/smb/smb2cli_ioctl.c +++ b/libcli/smb/smb2cli_ioctl.c @@ -184,7 +184,17 @@ static void smb2cli_ioctl_done(struct tevent_req *subreq) { .status = STATUS_BUFFER_OVERFLOW, .body_size = 0x31 - } + }, + { + /* + * We need to make sure that + * a response with NT_STATUS_FILE_CLOSED + * without signing generates NT_STATUS_ACCESS_DENIED + * if the request was signed. + */ + .status = NT_STATUS_FILE_CLOSED, + .body_size = 0x09, + }, }; status = smb2cli_req_recv(subreq, state, &iov, -- cgit