]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Remove cli_posix_chmod
authorVolker Lendecke <vl@samba.org>
Fri, 2 Aug 2024 21:09:07 +0000 (23:09 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2024 16:29:33 +0000 (16:29 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clifile.c
source3/libsmb/proto.h

index 52fbf8ab5dad9f7aca892cc9c95bf5fe432fa9a5..57eb75eb22839ac1b759c98f181f797ba22eadf2 100644 (file)
@@ -989,98 +989,6 @@ static NTSTATUS cli_posix_chown_chmod_internal_recv(struct tevent_req *req)
        return tevent_req_simple_recv_ntstatus(req);
 }
 
-/****************************************************************************
- chmod a file (UNIX extensions).
-****************************************************************************/
-
-struct cli_posix_chmod_state {
-       uint8_t dummy;
-};
-
-static void cli_posix_chmod_done(struct tevent_req *subreq);
-
-struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct cli_state *cli,
-                                       const char *fname,
-                                       mode_t mode)
-{
-       struct tevent_req *req = NULL, *subreq = NULL;
-       struct cli_posix_chmod_state *state = NULL;
-
-       req = tevent_req_create(mem_ctx, &state, struct cli_posix_chmod_state);
-       if (req == NULL) {
-               return NULL;
-       }
-
-       subreq = cli_posix_chown_chmod_internal_send(
-               state,
-               ev,
-               cli,
-               fname,
-               unix_perms_to_wire(mode),
-               SMB_UID_NO_CHANGE,
-               SMB_GID_NO_CHANGE);
-       if (tevent_req_nomem(subreq, req)) {
-               return tevent_req_post(req, ev);
-       }
-       tevent_req_set_callback(subreq, cli_posix_chmod_done, req);
-       return req;
-}
-
-static void cli_posix_chmod_done(struct tevent_req *subreq)
-{
-       NTSTATUS status = cli_posix_chown_chmod_internal_recv(subreq);
-       tevent_req_simple_finish_ntstatus(subreq, status);
-}
-
-NTSTATUS cli_posix_chmod_recv(struct tevent_req *req)
-{
-       return tevent_req_simple_recv_ntstatus(req);
-}
-
-NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode)
-{
-       TALLOC_CTX *frame = talloc_stackframe();
-       struct tevent_context *ev = NULL;
-       struct tevent_req *req = NULL;
-       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_posix_chmod_send(frame,
-                               ev,
-                               cli,
-                               fname,
-                               mode);
-       if (req == NULL) {
-               status = NT_STATUS_NO_MEMORY;
-               goto fail;
-       }
-
-       if (!tevent_req_poll_ntstatus(req, ev, &status)) {
-               goto fail;
-       }
-
-       status = cli_posix_chmod_recv(req);
-
- fail:
-       TALLOC_FREE(frame);
-       return status;
-}
-
 struct cli_fchmod_state {
        uint8_t data[100]; /* smb1 posix extensions */
 };
index 50912451940303f803c26771d4792a1ea3b2712c..23aa14d8b6f5f67f5f8e0ae615a8330f1f8de133 100644 (file)
@@ -312,13 +312,7 @@ NTSTATUS cli_posix_stat_recv(struct tevent_req *req, struct stat_ex *sbuf);
 NTSTATUS cli_posix_stat(struct cli_state *cli,
                        const char *fname,
                        struct stat_ex *sbuf);
-struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct cli_state *cli,
-                                       const char *fname,
-                                       mode_t mode);
-NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
-NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
+;
 struct tevent_req *cli_fchmod_send(TALLOC_CTX *mem_ctx,
                                   struct tevent_context *ev,
                                   struct cli_state *cli,