diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-08-31 00:40:06 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-18 05:33:10 +0200 |
commit | 271f78a9bb814ed10bcc8883a60d6609e1eef500 (patch) | |
tree | 5a33c7c4a1971696c43e30f1986a2ecf7e43d5ac /source3/libsmb/smb2cli_create.c | |
parent | b6b767a2c47b26c1758520212b4f09ddb934c9f3 (diff) | |
download | samba-271f78a9bb814ed10bcc8883a60d6609e1eef500.tar.gz samba-271f78a9bb814ed10bcc8883a60d6609e1eef500.tar.bz2 samba-271f78a9bb814ed10bcc8883a60d6609e1eef500.zip |
s3:smb2cli: pass an array of expected status/body_size pairs to smb2cli_req_recv()
This gives the caller more control and correctly reports unexpected
errors to the caller, instead of return NT_STATUS_INVALID_NETWOR_RESPONSE
metze
Diffstat (limited to 'source3/libsmb/smb2cli_create.c')
-rw-r--r-- | source3/libsmb/smb2cli_create.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_create.c b/source3/libsmb/smb2cli_create.c index 2145ce25f6..eaabf68431 100644 --- a/source3/libsmb/smb2cli_create.c +++ b/source3/libsmb/smb2cli_create.c @@ -162,8 +162,15 @@ static void smb2cli_create_done(struct tevent_req *subreq) struct iovec *iov; uint8_t *body; uint32_t offset, length; + static const struct smb2cli_req_expected_response expected[] = { + { + .status = NT_STATUS_OK, + .body_size = 0x59 + } + }; - status = smb2cli_req_recv(subreq, talloc_tos(), &iov, 89); + status = smb2cli_req_recv(subreq, talloc_tos(), &iov, + expected, ARRAY_SIZE(expected)); if (tevent_req_nterror(req, status)) { return; } |