s4: libcli/smb2: calculate correct credit charge for finds
authorRalph Boehme <slow@samba.org>
Thu, 22 Mar 2018 09:07:49 +0000 (10:07 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 24 Jul 2018 22:23:13 +0000 (00:23 +0200)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/libcli/smb2/find.c

index 2e0bd35f102e9623e9f2e9c89c15473f6b04888f..23ac7378212256e77d07a6cf3215c1206a9b10df 100644 (file)
@@ -35,6 +35,7 @@ struct smb2_request *smb2_find_send(struct smb2_tree *tree, struct smb2_find *io
 
        req = smb2_request_init_tree(tree, SMB2_OP_QUERY_DIRECTORY, 0x20, true, 0);
        if (req == NULL) return NULL;
+       req->credit_charge = (MAX(io->in.max_response_size, 1) - 1)/ 65536 + 1;
 
        SCVAL(req->out.body, 0x02, io->in.level);
        SCVAL(req->out.body, 0x03, io->in.continue_flags);