]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Use cli_setfilefinfo_send() in cli_nt_delete_on_close_send()
authorVolker Lendecke <vl@samba.org>
Mon, 30 Mar 2020 13:16:02 +0000 (15:16 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 8 Apr 2020 14:46:39 +0000 (14:46 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libsmb/clifile.c

index 1f1a757f7bbb7c2333dcb7e98290fd5e700f2c8f..13555d68e819174322936f54bb9790f2a3f1e8d5 100644 (file)
@@ -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);
 }