summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-28 09:15:11 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-29 16:00:08 +0100
commit524d06615fd1b28f8cef14f6b7e083c4b24cae13 (patch)
tree317e47fc1e80556fdb641c4c1286104b8e1e0a42 /libcli/smb
parentf0d8038ed8030655223fc03251dbd2245b7ec402 (diff)
downloadsamba-524d06615fd1b28f8cef14f6b7e083c4b24cae13.tar.gz
samba-524d06615fd1b28f8cef14f6b7e083c4b24cae13.tar.bz2
samba-524d06615fd1b28f8cef14f6b7e083c4b24cae13.zip
smb1cli_trans: return the status from the server if possible
metze
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smb1cli_trans.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libcli/smb/smb1cli_trans.c b/libcli/smb/smb1cli_trans.c
index 791c440f30..c9a758c8e2 100644
--- a/libcli/smb/smb1cli_trans.c
+++ b/libcli/smb/smb1cli_trans.c
@@ -65,6 +65,8 @@ struct smb1cli_trans_state {
uint8_t zero_pad[4];
uint16_t vwv[32];
+ NTSTATUS status;
+
struct tevent_req *primary_subreq;
};
@@ -593,6 +595,12 @@ static void smb1cli_trans_done(struct tevent_req *subreq)
goto fail;
}
+ if (recv_iov == NULL) {
+ status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+ goto fail;
+ }
+ state->status = status;
+
sent_all = ((state->param_sent == state->num_param)
&& (state->data_sent == state->num_data));
@@ -767,12 +775,17 @@ NTSTATUS smb1cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
smb1cli_trans_cleanup_primary(state);
if (tevent_req_is_nterror(req, &status)) {
+ if (!NT_STATUS_IS_ERR(status)) {
+ status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+ }
+ tevent_req_received(req);
return status;
}
if ((state->num_rsetup < min_setup)
|| (state->rparam.total < min_param)
|| (state->rdata.total < min_data)) {
+ tevent_req_received(req);
return NT_STATUS_INVALID_NETWORK_RESPONSE;
}
@@ -801,7 +814,9 @@ NTSTATUS smb1cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
TALLOC_FREE(state->rdata.data);
}
- return NT_STATUS_OK;
+ status = state->status;
+ tevent_req_received(req);
+ return status;
}
NTSTATUS smb1cli_trans(TALLOC_CTX *mem_ctx, struct smbXcli_conn *conn,