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 */
};
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,