From 2a430625e77ecf81552f06b98b7bf91f5112a7df Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 18 Mar 2019 11:03:32 +0100 Subject: [PATCH] libsmb: Make SMB1-only cli_nt_hardlink calls static Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Mar 20 23:32:31 UTC 2019 on sn-devel-144 --- source3/libsmb/clifile.c | 42 ++-------------------------------------- source3/libsmb/proto.h | 8 -------- 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 0ceffe8bce7..f2bfdcce23d 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1458,7 +1458,7 @@ NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char * NT hardlink a file. ****************************************************************************/ -struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx, +static struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, const char *fname_src, @@ -1472,49 +1472,11 @@ struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx, RENAME_FLAG_HARD_LINK); } -NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req) +static NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req) { return cli_ntrename_internal_recv(req); } -NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst) -{ - TALLOC_CTX *frame = talloc_stackframe(); - struct tevent_context *ev; - struct tevent_req *req; - NTSTATUS status = NT_STATUS_OK; - - if (smbXcli_conn_has_async_calls(cli->conn)) { - /* - * Can't use sync call while an async call is in flight - */ - status = NT_STATUS_INVALID_PARAMETER; - goto fail; - } - - ev = samba_tevent_context_init(frame); - if (ev == NULL) { - status = NT_STATUS_NO_MEMORY; - goto fail; - } - - req = cli_nt_hardlink_send(frame, ev, cli, fname_src, fname_dst); - if (req == NULL) { - status = NT_STATUS_NO_MEMORY; - goto fail; - } - - if (!tevent_req_poll_ntstatus(req, ev, &status)) { - goto fail; - } - - status = cli_nt_hardlink_recv(req); - - fail: - TALLOC_FREE(frame); - return status; -} - struct cli_smb2_hardlink_state { struct tevent_context *ev; struct cli_state *cli; diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index a42f424df1e..4b9cfbea96e 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -352,14 +352,6 @@ struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx, NTSTATUS cli_ntrename_recv(struct tevent_req *req); NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst); -struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - const char *fname_src, - const char *fname_dst); -NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req); -NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst); - struct tevent_req *cli_hardlink_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, -- 2.34.1