]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Remove sync cli_smb2_chkpath()
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:39 +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 be610a390aa2aedc55318786d451b93f3a105a89..bc021ac60aca5283204ff8434030e945098bbe13 100644 (file)
@@ -1621,51 +1621,6 @@ NTSTATUS cli_smb2_chkpath_recv(struct tevent_req *req)
        return tevent_req_simple_recv_ntstatus(req);
 }
 
-/***************************************************************
- Wrapper that allows SMB2 to check if a path is a directory.
- Synchronous only.
-***************************************************************/
-
-NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
-                               const char *name)
-{
-       NTSTATUS status;
-       uint16_t fnum = 0xffff;
-
-       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;
-       }
-
-       /* Ensure this is a directory. */
-       status = cli_smb2_create_fnum(cli,
-                       name,
-                       0,                      /* create_flags */
-                       SMB2_IMPERSONATION_IMPERSONATION,
-                       FILE_READ_ATTRIBUTES,   /* desired_access */
-                       FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access */
-                       FILE_OPEN,              /* 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_query_info_fnum_state {
        DATA_BLOB outbuf;
 };
index 61a17cd6a97989e6135bb07e49f1f3a07c3bffe5..517d104d70cd63fe5007750b79a67a13be20e710 100644 (file)
@@ -109,8 +109,6 @@ struct tevent_req *cli_smb2_chkpath_send(
        struct cli_state *cli,
        const char *name);
 NTSTATUS cli_smb2_chkpath_recv(struct tevent_req *req);
-NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
-                       const char *name);
 struct tevent_req *cli_smb2_query_info_fnum_send(
        TALLOC_CTX *mem_ctx,
        struct tevent_context *ev,