diff options
author | Volker Lendecke <vl@samba.org> | 2009-11-14 11:12:50 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-11-14 12:20:12 +0100 |
commit | f4cf1c56a20916018c9a6513754b0b08c24c9d04 (patch) | |
tree | 959d0658b45497e77b0a3b9071f5c8761dff5e51 /source3/libsmb/clifsinfo.c | |
parent | 4a777ec4d709d2fce2378b7b4d740aa73c32e73b (diff) | |
download | samba-f4cf1c56a20916018c9a6513754b0b08c24c9d04.tar.gz samba-f4cf1c56a20916018c9a6513754b0b08c24c9d04.tar.bz2 samba-f4cf1c56a20916018c9a6513754b0b08c24c9d04.zip |
s3: Add min_setup, min_param and min_data to cli_trans_recv
Every caller that expects to receive something needs to check if enough was
sent. Make this check mandatory for everyone.
Yes, this makes the parameter list for cli_trans a bit silly, but that's just
the way it is: A silly protocol request :-)
While there, convert some _done functions to tevent_req_simple_finish_ntstatus.
Diffstat (limited to 'source3/libsmb/clifsinfo.c')
-rw-r--r-- | source3/libsmb/clifsinfo.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index 9e2177a0ed..6e23dbc689 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/libsmb/clifsinfo.c @@ -71,17 +71,13 @@ static void cli_unix_extensions_version_done(struct tevent_req *subreq) uint32_t num_data; NTSTATUS status; - status = cli_trans_recv(subreq, state, NULL, NULL, NULL, NULL, - &data, &num_data); + status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL, + &data, 12, &num_data); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { tevent_req_nterror(req, status); return; } - if (num_data < 12) { - tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); - return; - } state->major = SVAL(data, 0); state->minor = SVAL(data, 2); @@ -211,8 +207,8 @@ static void cli_set_unix_extensions_capabilities_done( struct tevent_req *subreq) { return tevent_req_simple_finish_ntstatus( - subreq, cli_trans_recv(subreq, NULL, NULL, NULL, NULL, NULL, - NULL, NULL)); + subreq, cli_trans_recv(subreq, NULL, NULL, 0, NULL, + NULL, 0, NULL, NULL, 0, NULL)); } NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req) |