1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libcli: Make smb2cli_create return blobs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2014-06-27 09:32:34 +00:00 committed by Jeremy Allison
parent f0f18c56c6
commit 9f3e894468
5 changed files with 36 additions and 23 deletions

View File

@ -238,7 +238,9 @@ static void smb2cli_create_done(struct tevent_req *subreq)
NTSTATUS smb2cli_create_recv(struct tevent_req *req,
uint64_t *fid_persistent,
uint64_t *fid_volatile,
struct smb_create_returns *cr)
struct smb_create_returns *cr,
TALLOC_CTX *mem_ctx,
struct smb2_create_blobs *blobs)
{
struct smb2cli_create_state *state =
tevent_req_data(req,
@ -253,6 +255,10 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
if (cr) {
*cr = state->cr;
}
if (blobs) {
blobs->num_blobs = state->blobs.num_blobs;
blobs->blobs = talloc_move(mem_ctx, &state->blobs.blobs);
}
return NT_STATUS_OK;
}
@ -271,7 +277,9 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
struct smb2_create_blobs *blobs,
uint64_t *fid_persistent,
uint64_t *fid_volatile,
struct smb_create_returns *cr)
struct smb_create_returns *cr,
TALLOC_CTX *mem_ctx,
struct smb2_create_blobs *ret_blobs)
{
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev;
@ -302,7 +310,8 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
if (!tevent_req_poll_ntstatus(req, ev, &status)) {
goto fail;
}
status = smb2cli_create_recv(req, fid_persistent, fid_volatile, cr);
status = smb2cli_create_recv(req, fid_persistent, fid_volatile, cr,
mem_ctx, ret_blobs);
fail:
TALLOC_FREE(frame);
return status;

View File

@ -461,7 +461,9 @@ struct tevent_req *smb2cli_create_send(
NTSTATUS smb2cli_create_recv(struct tevent_req *req,
uint64_t *fid_persistent,
uint64_t *fid_volatile,
struct smb_create_returns *cr);
struct smb_create_returns *cr,
TALLOC_CTX *mem_ctx,
struct smb2_create_blobs *blobs);
NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
@ -477,7 +479,9 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
struct smb2_create_blobs *blobs,
uint64_t *fid_persistent,
uint64_t *fid_volatile,
struct smb_create_returns *cr);
struct smb_create_returns *cr,
TALLOC_CTX *mem_ctx,
struct smb2_create_blobs *ret_blobs);
struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,

View File

@ -279,7 +279,7 @@ static void tstream_smbXcli_np_open_done(struct tevent_req *subreq)
status = smb2cli_create_recv(subreq,
&state->fid_persistent,
&state->fid_volatile,
NULL);
NULL, NULL, NULL);
}
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {

View File

@ -234,7 +234,7 @@ static void cli_smb2_create_fnum_done(struct tevent_req *subreq)
NTSTATUS status;
status = smb2cli_create_recv(subreq, &h.fid_persistent,
&h.fid_volatile, &state->cr);
&h.fid_volatile, &state->cr, NULL, NULL);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;

View File

@ -84,7 +84,7 @@ bool run_smb2_basic(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
@ -147,7 +147,7 @@ bool run_smb2_basic(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
@ -347,7 +347,7 @@ bool run_smb2_session_reconnect(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli1 %s\n", nt_errstr(status));
return false;
@ -584,7 +584,7 @@ bool run_smb2_session_reconnect(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) &&
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
@ -645,7 +645,7 @@ bool run_smb2_session_reconnect(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED) &&
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED))
{
@ -673,7 +673,7 @@ bool run_smb2_session_reconnect(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
return false;
@ -769,7 +769,7 @@ bool run_smb2_tcon_dependence(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli %s\n", nt_errstr(status));
return false;
@ -1181,7 +1181,7 @@ bool run_smb2_multi_channel(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
return false;
@ -1344,7 +1344,7 @@ bool run_smb2_multi_channel(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
@ -1362,7 +1362,7 @@ bool run_smb2_multi_channel(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
@ -1380,7 +1380,7 @@ bool run_smb2_multi_channel(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
@ -1512,7 +1512,7 @@ bool run_smb2_session_reauth(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
@ -1532,7 +1532,7 @@ bool run_smb2_session_reauth(int dummy)
NULL, /* smb2_create_blobs *blobs */
&dir_persistent,
&dir_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
@ -1718,7 +1718,7 @@ bool run_smb2_session_reauth(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
@ -1738,7 +1738,7 @@ bool run_smb2_session_reauth(int dummy)
NULL, /* smb2_create_blobs *blobs */
&dir_persistent,
&dir_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
@ -1894,7 +1894,7 @@ bool run_smb2_session_reauth(int dummy)
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
&fid_volatile,
NULL);
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;