[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Feb 22 15:24:10 MST 2010


The branch, master has been updated
       via  82f6f39... s3: Explicitly handle inbuf in cli_trans_done
       via  964210b... s3: Explicitly handle inbuf in cli_write_andx_done
       via  78d7f27... s3: Explicitly handle inbuf in cli_read_andx_done
       via  486f734... s3: Explicitly handle inbuf in cli_message_start_done
       via  be62ca1... s3: Explicitly handle inbuf in cli_dskattr_done
       via  327f93b... s3: Explicitly handle inbuf in cli_getatr_done
       via  41ebf58... s3: Explicitly handle inbuf in cli_getattrE_done
       via  409fd66... s3: Explicitly handle inbuf in cli_open_done
       via  12863ff... s3: Explicitly handle inbuf in cli_ntcreate_done
       via  1fab94a... s3: Explicitly handle inbuf in cli_echo_done
       via  fdd82e6... s3: Explicitly handle inbuf in cli_negprot_done
       via  160c459... s3: Explicitly handle inbuf in cli_tcon_andx_done
       via  036fcaf... s3: Explicitly handle inbuf in cli_sesssetup_blob_done
       via  47c61b4... s3: Explicitly handle inbuf in cli_session_setup_guest_done
       via  299d9c4... s3: Explicitly handle inbuf in cli_smb_oplock_break_waiter_done
       via  d122bfc... s3: Add a talloc_move for the inbuf to cli_smb_recv
      from  91bf841... s4:registry/regf.c - specify the context when freeing the "regf" variable

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 82f6f3920c3127caf5e32de4c81830e74300e0f8
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:27:48 2010 +0100

    s3: Explicitly handle inbuf in cli_trans_done

commit 964210b89a9438356c3c37a4f9d227ce6cf09c8f
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:27:22 2010 +0100

    s3: Explicitly handle inbuf in cli_write_andx_done

commit 78d7f27993ee67f6df48e437b994c5b8e1aba165
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:26:06 2010 +0100

    s3: Explicitly handle inbuf in cli_read_andx_done

commit 486f734fd8794fb424d44b21695973cbd01a348b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:25:34 2010 +0100

    s3: Explicitly handle inbuf in cli_message_start_done

commit be62ca140335c7f841e44195450090201e09437a
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:23:31 2010 +0100

    s3: Explicitly handle inbuf in cli_dskattr_done

commit 327f93bf1c49d725964a637e657915ccf460e8e4
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:21:01 2010 +0100

    s3: Explicitly handle inbuf in cli_getatr_done

commit 41ebf583e86a17fd2d1dc4443b81ef1ad27e1f4c
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:20:38 2010 +0100

    s3: Explicitly handle inbuf in cli_getattrE_done

commit 409fd662b062c282fc748200ccbd62e415e87f8a
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:19:45 2010 +0100

    s3: Explicitly handle inbuf in cli_open_done

commit 12863ffa5667acca1b7e34cad599a26d6d1ae20c
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:19:28 2010 +0100

    s3: Explicitly handle inbuf in cli_ntcreate_done

commit 1fab94a31bd6060fe64e1ac5245a19149b97e035
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:18:38 2010 +0100

    s3: Explicitly handle inbuf in cli_echo_done

commit fdd82e69abfa05fe11523f5b158384cb82d3bc8b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:17:29 2010 +0100

    s3: Explicitly handle inbuf in cli_negprot_done

commit 160c459b54c5e18c59a0c155c3b94896267715bb
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:16:55 2010 +0100

    s3: Explicitly handle inbuf in cli_tcon_andx_done

commit 036fcafe242363bd290b179c21406dafc0d3a678
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:15:28 2010 +0100

    s3: Explicitly handle inbuf in cli_sesssetup_blob_done

commit 47c61b4f15a8b366e51bc0de0a3427eecd0d65a3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 15:14:43 2010 +0100

    s3: Explicitly handle inbuf in cli_session_setup_guest_done

commit 299d9c409dd20b1b5abe4abf2a11c121c8a76abb
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 11:50:05 2010 +0100

    s3: Explicitly handle inbuf in cli_smb_oplock_break_waiter_done

commit d122bfc064a0265b1e08dd52bbce61caac1d6a6b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 20 09:53:58 2010 +0100

    s3: Add a talloc_move for the inbuf to cli_smb_recv

-----------------------------------------------------------------------

Summary of changes:
 source3/include/async_smb.h   |    5 ++-
 source3/libsmb/async_smb.c    |   14 +++++++---
 source3/libsmb/cliconnect.c   |   40 +++++++++++++++-----------
 source3/libsmb/clientgen.c    |    7 +++-
 source3/libsmb/clifile.c      |   60 ++++++++++++++++++++++++-----------------
 source3/libsmb/climessage.c   |   10 ++++---
 source3/libsmb/clioplock.c    |    2 +-
 source3/libsmb/clireadwrite.c |   12 +++++---
 source3/libsmb/clitrans.c     |   12 +++++++-
 9 files changed, 100 insertions(+), 62 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h
index 47fed92..b73aed0 100644
--- a/source3/include/async_smb.h
+++ b/source3/include/async_smb.h
@@ -57,8 +57,9 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 				uint8_t wct, uint16_t *vwv,
 				uint32_t num_bytes,
 				const uint8_t *bytes);
-NTSTATUS cli_smb_recv(struct tevent_req *req, uint8_t min_wct,
-		      uint8_t *pwct, uint16_t **pvwv,
+NTSTATUS cli_smb_recv(struct tevent_req *req,
+		      TALLOC_CTX *mem_ctx, uint8_t **pinbuf,
+		      uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
 		      uint32_t *pnum_bytes, uint8_t **pbytes);
 
 struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 59226e1..520861c 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -755,8 +755,9 @@ static void cli_smb_received(struct tevent_req *subreq)
 	}
 }
 
-NTSTATUS cli_smb_recv(struct tevent_req *req, uint8_t min_wct,
-		      uint8_t *pwct, uint16_t **pvwv,
+NTSTATUS cli_smb_recv(struct tevent_req *req,
+		      TALLOC_CTX *mem_ctx, uint8_t **pinbuf,
+		      uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
 		      uint32_t *pnum_bytes, uint8_t **pbytes)
 {
 	struct cli_smb_state *state = tevent_req_data(
@@ -868,6 +869,9 @@ no_err:
 	if (pbytes != NULL) {
 		*pbytes = (uint8_t *)state->inbuf + bytes_offset + 2;
 	}
+	if ((mem_ctx != NULL) && (pinbuf != NULL)) {
+		*pinbuf = talloc_move(mem_ctx, &state->inbuf);
+	}
 
 	return status;
 }
@@ -1053,11 +1057,13 @@ static void cli_smb_oplock_break_waiter_done(struct tevent_req *subreq)
 	uint16_t *vwv;
 	uint32_t num_bytes;
 	uint8_t *bytes;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 8, &wct, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 8, &wct, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index a81cb06..256ca2e 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -264,19 +264,21 @@ static void cli_session_setup_guest_done(struct tevent_req *subreq)
 		req, struct cli_session_setup_guest_state);
 	struct cli_state *cli = state->cli;
 	uint32_t num_bytes;
+	uint8_t *in;
 	char *inbuf;
 	uint8_t *bytes;
 	uint8_t *p;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &in, 0, NULL, NULL,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
 
-	inbuf = (char *)cli_smb_inbuf(subreq);
+	inbuf = (char *)in;
 	p = bytes;
 
 	cli->vuid = SVAL(inbuf, smb_uid);
@@ -292,8 +294,6 @@ static void cli_session_setup_guest_done(struct tevent_req *subreq)
 		cli->is_samba = True;
 	}
 
-	TALLOC_FREE(subreq);
-
 	status = cli_set_username(cli, "");
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -730,11 +730,13 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq)
 	NTSTATUS status;
 	uint8_t *p;
 	uint16_t blob_length;
+	uint8_t *inbuf;
 
-	status = cli_smb_recv(subreq, 1, &wct, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)
 	    && !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
@@ -742,12 +744,11 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq)
 	state->status = status;
 	TALLOC_FREE(state->buf);
 
-	state->inbuf = (char *)cli_smb_inbuf(subreq);
+	state->inbuf = (char *)inbuf;
 	cli->vuid = SVAL(state->inbuf, smb_uid);
 
 	blob_length = SVAL(vwv+3, 0);
 	if (blob_length > num_bytes) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
 		return;
 	}
@@ -770,7 +771,6 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq)
 	}
 
 	if (state->blob.length != 0) {
-		TALLOC_FREE(subreq);
 		/*
 		 * More to send
 		 */
@@ -1527,7 +1527,7 @@ static void cli_ulogoff_done(struct tevent_req *subreq)
 		req, struct cli_ulogoff_state);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
@@ -1751,20 +1751,24 @@ static void cli_tcon_andx_done(struct tevent_req *subreq)
 	struct cli_tcon_andx_state *state = tevent_req_data(
 		req, struct cli_tcon_andx_state);
 	struct cli_state *cli = state->cli;
-	char *inbuf = (char *)cli_smb_inbuf(subreq);
+	uint8_t *in;
+	char *inbuf;
 	uint8_t wct;
 	uint16_t *vwv;
 	uint32_t num_bytes;
 	uint8_t *bytes;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, &wct, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &in, 0, &wct, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
 
+	inbuf = (char *)in;
+
 	clistr_pull(inbuf, cli->dev, bytes, sizeof(fstring), num_bytes,
 		    STR_TERMINATE|STR_ASCII);
 
@@ -1874,7 +1878,7 @@ static void cli_tdis_done(struct tevent_req *subreq)
 		req, struct cli_tdis_state);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -2029,10 +2033,12 @@ static void cli_negprot_done(struct tevent_req *subreq)
 	uint8_t *bytes;
 	NTSTATUS status;
 	uint16_t protnum;
+	uint8_t *inbuf;
 
-	status = cli_smb_recv(subreq, 1, &wct, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 0afa9e6..1b43809 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -851,8 +851,10 @@ static void cli_echo_done(struct tevent_req *subreq)
 	NTSTATUS status;
 	uint32_t num_bytes;
 	uint8_t *bytes;
+	uint8_t *inbuf;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 0, NULL, NULL,
+			      &num_bytes, &bytes);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
@@ -989,7 +991,8 @@ NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
         if (!tevent_req_poll_ntstatus(req, ev, &status)) {
                 goto fail;
         }
-        status = cli_smb_recv(req, min_wct, pwct, pvwv, pnum_bytes, pbytes);
+        status = cli_smb_recv(req, NULL, NULL, min_wct, pwct, pvwv,
+			      pnum_bytes, pbytes);
 fail:
         TALLOC_FREE(ev);
 	if (NT_STATUS_IS_OK(status)) {
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 6c4ae1a..6e7a74f 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1238,7 +1238,7 @@ static void cli_rename_done(struct tevent_req *subreq)
 				subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -1364,7 +1364,7 @@ static void cli_ntrename_internal_done(struct tevent_req *subreq)
 				subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -1559,7 +1559,7 @@ static void cli_unlink_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -1667,7 +1667,7 @@ static void cli_mkdir_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -1775,7 +1775,7 @@ static void cli_rmdir_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -2038,11 +2038,13 @@ static void cli_ntcreate_done(struct tevent_req *subreq)
 	uint16_t *vwv;
 	uint32_t num_bytes;
 	uint8_t *bytes;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 3, &wct, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 3, &wct, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
@@ -2250,11 +2252,13 @@ static void cli_open_done(struct tevent_req *subreq)
 		req, struct cli_open_state);
 	uint8_t wct;
 	uint16_t *vwv;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 3, &wct, &vwv, NULL, NULL);
+	status = cli_smb_recv(subreq, state, &inbuf, 3, &wct, &vwv, NULL,
+			      NULL);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
@@ -2382,7 +2386,7 @@ static void cli_close_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -2723,7 +2727,7 @@ static void cli_unlock_done(struct tevent_req *subreq)
 				subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -2898,7 +2902,7 @@ static void cli_unlock64_done(struct tevent_req *subreq)
 				subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -3263,9 +3267,12 @@ static void cli_getattrE_done(struct tevent_req *subreq)
 		req, struct cli_getattrE_state);
 	uint8_t wct;
 	uint16_t *vwv = NULL;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 11, &wct, &vwv, NULL, NULL);
+	status = cli_smb_recv(subreq, state, &inbuf, 11, &wct, &vwv,
+			      NULL, NULL);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
@@ -3277,7 +3284,6 @@ static void cli_getattrE_done(struct tevent_req *subreq)
 	state->access_time = make_unix_date2(vwv+2, state->zone_offset);
 	state->write_time = make_unix_date2(vwv+4, state->zone_offset);
 
-	TALLOC_FREE(subreq);
 	tevent_req_done(req);
 }
 
@@ -3425,9 +3431,12 @@ static void cli_getatr_done(struct tevent_req *subreq)
 		req, struct cli_getatr_state);
 	uint8_t wct;
 	uint16_t *vwv = NULL;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 4, &wct, &vwv, NULL, NULL);
+	status = cli_smb_recv(subreq, state, &inbuf, 4, &wct, &vwv, NULL,
+			      NULL);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
@@ -3437,7 +3446,6 @@ static void cli_getatr_done(struct tevent_req *subreq)
 	state->size = (SMB_OFF_T)IVAL(vwv+3,0);
 	state->write_time = make_unix_date3(vwv+1, state->zone_offset);
 
-	TALLOC_FREE(subreq);
 	tevent_req_done(req);
 }
 
@@ -3561,7 +3569,7 @@ static void cli_setattrE_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -3695,7 +3703,7 @@ static void cli_setatr_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -3806,7 +3814,7 @@ static void cli_chkpath_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -3919,9 +3927,12 @@ static void cli_dskattr_done(struct tevent_req *subreq)
 		req, struct cli_dskattr_state);
 	uint8_t wct;
 	uint16_t *vwv = NULL;
+	uint8_t *inbuf;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 4, &wct, &vwv, NULL, NULL);
+	status = cli_smb_recv(subreq, state, &inbuf, 4, &wct, &vwv, NULL,
+			      NULL);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
@@ -3929,7 +3940,6 @@ static void cli_dskattr_done(struct tevent_req *subreq)
 	state->bsize = SVAL(vwv+1, 0)*SVAL(vwv+2,0);
 	state->total = SVAL(vwv+0, 0);
 	state->avail = SVAL(vwv+3, 0);
-	TALLOC_FREE(subreq);
 	tevent_req_done(req);
 }
 
@@ -4051,18 +4061,18 @@ static void cli_ctemp_done(struct tevent_req *subreq)
 	uint16_t *vwv;
 	uint32_t num_bytes = 0;
 	uint8_t *bytes = NULL;
+	uint8_t *inbuf;
 
-	status = cli_smb_recv(subreq, 1, &wcnt, &vwv, &num_bytes, &bytes);
+	status = cli_smb_recv(subreq, state, &inbuf, 1, &wcnt, &vwv,
+			      &num_bytes, &bytes);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
-		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
 		return;
 	}
 
 	state->fnum = SVAL(vwv+0, 0);
 
-	TALLOC_FREE(subreq);
-
 	/* From W2K3, the result is just the ASCII name */
 	if (num_bytes < 2) {
 		tevent_req_nterror(req, NT_STATUS_DATA_ERROR);
diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c
index 2c8ef58..bdf2977 100644
--- a/source3/libsmb/climessage.c
+++ b/source3/libsmb/climessage.c
@@ -91,8 +91,11 @@ static void cli_message_start_done(struct tevent_req *subreq)
 	NTSTATUS status;
 	uint8_t wct;
 	uint16_t *vwv;
+	uint8_t *inbuf;
 
-	status = cli_smb_recv(subreq, 0, &wct, &vwv, NULL, NULL);
+	status = cli_smb_recv(subreq, state, &inbuf, 0, &wct, &vwv,
+			      NULL, NULL);
+	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		TALLOC_FREE(subreq);
 		tevent_req_nterror(req, status);
@@ -103,7 +106,6 @@ static void cli_message_start_done(struct tevent_req *subreq)
 	} else {
 		state->grp = 0;
 	}
-	TALLOC_FREE(subreq);
 	tevent_req_done(req);
 }
 
@@ -183,7 +185,7 @@ static void cli_message_text_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -234,7 +236,7 @@ static void cli_message_end_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
diff --git a/source3/libsmb/clioplock.c b/source3/libsmb/clioplock.c
index 7350c4a..8904ac9 100644
--- a/source3/libsmb/clioplock.c
+++ b/source3/libsmb/clioplock.c
@@ -66,7 +66,7 @@ static void cli_oplock_ack_done(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+	status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list