From: Volker Lendecke Date: Mon, 30 Mar 2020 13:16:02 +0000 (+0200) Subject: libsmb: Use cli_setfilefinfo_send() in cli_nt_delete_on_close_send() X-Git-Tag: ldb-2.2.0~952 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b46b5a6408dfa002f6a38f3c0dcd592085ba93ac;p=thirdparty%2Fsamba.git libsmb: Use cli_setfilefinfo_send() in cli_nt_delete_on_close_send() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 1f1a757f7bb..13555d68e81 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -2206,8 +2206,6 @@ NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname) ****************************************************************************/ struct doc_state { - uint16_t setup; - uint8_t param[6]; uint8_t data[1]; }; @@ -2240,34 +2238,17 @@ struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx, return req; } - /* Setup setup word. */ - SSVAL(&state->setup, 0, TRANSACT2_SETFILEINFO); - - /* Setup param array. */ - SSVAL(state->param,0,fnum); - SSVAL(state->param,2,SMB_SET_FILE_DISPOSITION_INFO); - /* Setup data array. */ SCVAL(&state->data[0], 0, flag ? 1 : 0); - subreq = cli_trans_send(state, /* mem ctx. */ - ev, /* event ctx. */ - cli, /* cli_state. */ - 0, /* additional_flags2 */ - SMBtrans2, /* cmd. */ - NULL, /* pipe name. */ - -1, /* fid. */ - 0, /* function. */ - 0, /* flags. */ - &state->setup, /* setup. */ - 1, /* num setup uint16_t words. */ - 0, /* max returned setup. */ - state->param, /* param. */ - 6, /* num param. */ - 2, /* max returned param. */ - state->data, /* data. */ - 1, /* num data. */ - 0); /* max returned data. */ + subreq = cli_setfileinfo_send( + state, + ev, + cli, + fnum, + SMB_SET_FILE_DISPOSITION_INFO, + state->data, + sizeof(state->data)); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); @@ -2280,8 +2261,7 @@ struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx, static void cli_nt_delete_on_close_smb1_done(struct tevent_req *subreq) { - NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL, - NULL, 0, NULL, NULL, 0, NULL); + NTSTATUS status = cli_setfileinfo_recv(subreq); tevent_req_simple_finish_ntstatus(subreq, status); }