libsmb: Remove sync cli_smb2_mkdir()
authorVolker Lendecke <vl@samba.org>
Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 28 May 2020 19:11:40 +0000 (19:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/cli_smb2_fnum.c
source3/libsmb/cli_smb2_fnum.h

index 8e9db844f84e4b07cc4bae95f779961ac7fc9051..c1c755a97ea836bced4646a3497aec27f340f438 100644 (file)
@@ -840,48 +840,6 @@ NTSTATUS cli_smb2_mkdir_recv(struct tevent_req *req)
        return tevent_req_simple_recv_ntstatus(req);
 }
 
-/***************************************************************
- Small wrapper that allows SMB2 to create a directory
- Synchronous only.
-***************************************************************/
-
-NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dname)
-{
-       NTSTATUS status;
-       uint16_t fnum;
-
-       if (smbXcli_conn_has_async_calls(cli->conn)) {
-               /*
-                * Can't use sync call while an async call is in flight
-                */
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       status = cli_smb2_create_fnum(cli,
-                       dname,
-                       0,                      /* create_flags */
-                       SMB2_IMPERSONATION_IMPERSONATION,
-                       FILE_READ_ATTRIBUTES,   /* desired_access */
-                       FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */
-                       FILE_CREATE,            /* create_disposition */
-                       FILE_DIRECTORY_FILE,    /* create_options */
-                       NULL,
-                       &fnum,
-                       NULL,
-                       NULL,
-                       NULL);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-       return cli_smb2_close_fnum(cli, fnum);
-}
-
 struct cli_smb2_rmdir_state {
        struct tevent_context *ev;
        struct cli_state *cli;
index c09defeaadded12938997a9138e5adb16c8156f4..b921d066ed3c42207e605fdc024bcd4d03146729 100644 (file)
@@ -79,7 +79,6 @@ struct tevent_req *cli_smb2_mkdir_send(
        struct cli_state *cli,
        const char *name);
 NTSTATUS cli_smb2_mkdir_recv(struct tevent_req *req);
-NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
 struct tevent_req *cli_smb2_rmdir_send(
        TALLOC_CTX *mem_ctx,
        struct tevent_context *ev,