diff options
-rw-r--r-- | lib/async_req/async_req.c | 67 | ||||
-rw-r--r-- | lib/async_req/async_req.h | 20 | ||||
-rw-r--r-- | lib/async_req/async_req_ntstatus.c | 82 | ||||
-rw-r--r-- | lib/async_req/async_req_ntstatus.h | 37 | ||||
-rw-r--r-- | lib/async_req/async_sock.c | 30 | ||||
-rw-r--r-- | lib/async_req/config.mk | 2 | ||||
-rw-r--r-- | source3/Makefile.in | 2 | ||||
-rw-r--r-- | source3/include/includes.h | 2 | ||||
-rw-r--r-- | source3/lib/util_sock.c | 26 | ||||
-rw-r--r-- | source3/lib/wb_reqtrans.c | 50 | ||||
-rw-r--r-- | source3/lib/wbclient.c | 54 | ||||
-rw-r--r-- | source3/libsmb/async_smb.c | 4 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 8 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 6 | ||||
-rw-r--r-- | source3/libsmb/clifile.c | 6 | ||||
-rw-r--r-- | source3/libsmb/clireadwrite.c | 32 | ||||
-rw-r--r-- | source3/libsmb/clitrans.c | 14 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 106 | ||||
-rw-r--r-- | source3/rpc_client/rpc_transport_np.c | 18 | ||||
-rw-r--r-- | source3/rpc_client/rpc_transport_smbd.c | 30 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 12 |
21 files changed, 343 insertions, 265 deletions
diff --git a/lib/async_req/async_req.c b/lib/async_req/async_req.c index be70a56380..1b9fc5517b 100644 --- a/lib/async_req/async_req.c +++ b/lib/async_req/async_req.c @@ -43,8 +43,8 @@ char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req) { - return talloc_asprintf(mem_ctx, "async_req: state=%d, status=%s, " - "priv=%s", req->state, nt_errstr(req->status), + return talloc_asprintf(mem_ctx, "async_req: state=%d, error=%d, " + "priv=%s", req->state, (int)req->error, talloc_get_name(req->private_data)); } @@ -81,7 +81,7 @@ struct async_req *async_req_new(TALLOC_CTX *mem_ctx) void async_req_done(struct async_req *req) { - req->status = NT_STATUS_OK; + req->error = 0; req->state = ASYNC_REQ_DONE; if (req->async.fn != NULL) { req->async.fn(req); @@ -98,9 +98,9 @@ void async_req_done(struct async_req *req) * function with the appropriate status code. */ -void async_req_error(struct async_req *req, NTSTATUS status) +void async_req_error(struct async_req *req, uint32_t error) { - req->status = status; + req->error = error; req->state = ASYNC_REQ_ERROR; if (req->async.fn != NULL) { req->async.fn(req); @@ -121,11 +121,11 @@ static void async_trigger(struct tevent_context *ev, struct tevent_timer *te, struct async_req *req = talloc_get_type_abort(priv, struct async_req); TALLOC_FREE(te); - if (NT_STATUS_IS_OK(req->status)) { + if (req->error == 0) { async_req_done(req); } else { - async_req_error(req, req->status); + async_req_error(req, req->error); } } @@ -142,10 +142,10 @@ static void async_trigger(struct tevent_context *ev, struct tevent_timer *te, * conventions, independent of whether the request was actually deferred. */ -bool async_post_status(struct async_req *req, struct tevent_context *ev, - NTSTATUS status) +bool async_post_error(struct async_req *req, struct tevent_context *ev, + uint32_t error) { - req->status = status; + req->error = error; if (tevent_add_timer(ev, req, timeval_zero(), async_trigger, req) == NULL) { @@ -154,55 +154,18 @@ bool async_post_status(struct async_req *req, struct tevent_context *ev, return true; } -/** - * @brief Helper function for nomem check - * @param[in] p The pointer to be checked - * @param[in] req The request being processed - * - * Convenience helper to easily check alloc failure within a callback - * implementing the next step of an async request. - * - * Call pattern would be - * \code - * p = talloc(mem_ctx, bla); - * if (async_req_nomem(p, req)) { - * return; - * } - * \endcode - */ - -bool async_req_nomem(const void *p, struct async_req *req) -{ - if (p != NULL) { - return false; - } - async_req_error(req, NT_STATUS_NO_MEMORY); - return true; -} - -bool async_req_is_error(struct async_req *req, NTSTATUS *status) +bool async_req_is_error(struct async_req *req, uint32_t *error) { if (req->state < ASYNC_REQ_DONE) { - *status = NT_STATUS_INTERNAL_ERROR; return true; } if (req->state == ASYNC_REQ_ERROR) { - *status = req->status; + *error = req->error; return true; } return false; } -NTSTATUS async_req_simple_recv(struct async_req *req) -{ - NTSTATUS status; - - if (async_req_is_error(req, &status)) { - return status; - } - return NT_STATUS_OK; -} - static void async_req_timedout(struct tevent_context *ev, struct tevent_timer *te, struct timeval now, @@ -211,7 +174,7 @@ static void async_req_timedout(struct tevent_context *ev, struct async_req *req = talloc_get_type_abort( priv, struct async_req); TALLOC_FREE(te); - async_req_error(req, NT_STATUS_IO_TIMEOUT); + async_req_nterror(req, NT_STATUS_IO_TIMEOUT); } bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev, @@ -240,9 +203,9 @@ struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, return result; } -NTSTATUS async_wait_recv(struct async_req *req) +bool async_wait_recv(struct async_req *req) { - return NT_STATUS_OK; + return true; } struct async_queue_entry { diff --git a/lib/async_req/async_req.h b/lib/async_req/async_req.h index 59f5bd19b2..19b052a788 100644 --- a/lib/async_req/async_req.h +++ b/lib/async_req/async_req.h @@ -20,7 +20,7 @@ #ifndef __ASYNC_REQ_H__ #define __ASYNC_REQ_H__ -#include "includes.h" +#include "lib/talloc/talloc.h" /** * An async request moves between the following 4 states: @@ -92,9 +92,9 @@ struct async_req { * @brief status code when finished * * This status can be queried in the async completion function. It - * will be set to NT_STATUS_OK when everything went fine. + * will be set to 0 when everything went fine. **/ - NTSTATUS status; + uint32_t error; /** * @brief What to do on completion @@ -121,16 +121,12 @@ char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req); void async_req_done(struct async_req *req); -void async_req_error(struct async_req *req, NTSTATUS status); +void async_req_error(struct async_req *req, uint32_t error); -bool async_post_status(struct async_req *req, struct tevent_context *ev, - NTSTATUS status); +bool async_post_error(struct async_req *req, struct tevent_context *ev, + uint32_t error); -bool async_req_nomem(const void *p, struct async_req *req); - -bool async_req_is_error(struct async_req *req, NTSTATUS *status); - -NTSTATUS async_req_simple_recv(struct async_req *req); +bool async_req_is_error(struct async_req *req, uint32_t *error); bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev, struct timeval to); @@ -139,7 +135,7 @@ struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct timeval to); -NTSTATUS async_wait_recv(struct async_req *req); +bool async_wait_recv(struct async_req *req); struct async_req_queue; diff --git a/lib/async_req/async_req_ntstatus.c b/lib/async_req/async_req_ntstatus.c new file mode 100644 index 0000000000..dd81026074 --- /dev/null +++ b/lib/async_req/async_req_ntstatus.c @@ -0,0 +1,82 @@ +/* + Unix SMB/CIFS implementation. + NTSTATUS wrappers for async_req.h + Copyright (C) Volker Lendecke 2008, 2009 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "includes.h" +#include "lib/tevent/tevent.h" +#include "lib/talloc/talloc.h" +#include "lib/util/dlinklist.h" +#include "lib/async_req/async_req_ntstatus.h" + +/** + * @brief Helper function for nomem check + * @param[in] p The pointer to be checked + * @param[in] req The request being processed + * + * Convenience helper to easily check alloc failure within a callback + * implementing the next step of an async request. + * + * Call pattern would be + * \code + * p = talloc(mem_ctx, bla); + * if (async_req_ntnomem(p, req)) { + * return; + * } + * \endcode + */ + +bool async_req_ntnomem(const void *p, struct async_req *req) +{ + if (p != NULL) { + return false; + } + async_req_nterror(req, NT_STATUS_NO_MEMORY); + return true; +} + +void async_req_nterror(struct async_req *req, NTSTATUS status) +{ + async_req_error(req, NT_STATUS_V(status)); +} + +bool async_post_ntstatus(struct async_req *req, struct tevent_context *ev, + NTSTATUS status) +{ + return async_post_error(req, ev, NT_STATUS_V(status)); +} + +bool async_req_is_nterror(struct async_req *req, NTSTATUS *status) +{ + uint32_t error = NT_STATUS_V(NT_STATUS_INTERNAL_ERROR); + + if (async_req_is_error(req, &error)) { + *status = NT_STATUS(error); + return true; + } + return false; +} + +NTSTATUS async_req_simple_recv_ntstatus(struct async_req *req) +{ + NTSTATUS status; + + if (async_req_is_nterror(req, &status)) { + return status; + } + return NT_STATUS_OK; +} diff --git a/lib/async_req/async_req_ntstatus.h b/lib/async_req/async_req_ntstatus.h new file mode 100644 index 0000000000..7cc8caa14c --- /dev/null +++ b/lib/async_req/async_req_ntstatus.h @@ -0,0 +1,37 @@ +/* + Unix SMB/CIFS implementation. + NTSTATUS wrappers for async_req.h + Copyright (C) Volker Lendecke 2008, 2009 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __ASYNC_REQ_NTSTATUS_H__ +#define __ASYNC_REQ_NTSTATUS_H__ + +#include "lib/async_req/async_req.h" +#include "includes.h" + +void async_req_nterror(struct async_req *req, NTSTATUS status); + +bool async_post_ntstatus(struct async_req *req, struct tevent_context *ev, + NTSTATUS status); + +bool async_req_is_nterror(struct async_req *req, NTSTATUS *status); + +NTSTATUS async_req_simple_recv_ntstatus(struct async_req *req); + +bool async_req_ntnomem(const void *p, struct async_req *req); + +#endif diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index 7febc54fd4..b992320669 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -239,7 +239,7 @@ static void async_send_callback(struct tevent_context *ev, struct param_send *p = &state->param.param_send; if (state->syscall_type != ASYNC_SYSCALL_SEND) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -306,7 +306,7 @@ static void async_sendall_callback(struct tevent_context *ev, struct param_sendall *p = &state->param.param_sendall; if (state->syscall_type != ASYNC_SYSCALL_SENDALL) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -316,18 +316,18 @@ static void async_sendall_callback(struct tevent_context *ev, state->sys_errno = errno; if (state->result.result_ssize_t == -1) { - async_req_error(req, map_nt_error_from_unix(state->sys_errno)); + async_req_nterror(req, map_nt_error_from_unix(state->sys_errno)); return; } if (state->result.result_ssize_t == 0) { - async_req_error(req, NT_STATUS_END_OF_FILE); + async_req_nterror(req, NT_STATUS_END_OF_FILE); return; } p->sent += state->result.result_ssize_t; if (p->sent > p->length) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -376,7 +376,7 @@ struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, NTSTATUS sendall_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } /** @@ -398,7 +398,7 @@ static void async_recv_callback(struct tevent_context *ev, struct param_recv *p = &state->param.param_recv; if (state->syscall_type != ASYNC_SYSCALL_RECV) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -466,7 +466,7 @@ static void async_recvall_callback(struct tevent_context *ev, struct param_recvall *p = &state->param.param_recvall; if (state->syscall_type != ASYNC_SYSCALL_RECVALL) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -476,18 +476,18 @@ static void async_recvall_callback(struct tevent_context *ev, state->sys_errno = errno; if (state->result.result_ssize_t == -1) { - async_req_error(req, map_nt_error_from_unix(state->sys_errno)); + async_req_nterror(req, map_nt_error_from_unix(state->sys_errno)); return; } if (state->result.result_ssize_t == 0) { - async_req_error(req, NT_STATUS_END_OF_FILE); + async_req_nterror(req, NT_STATUS_END_OF_FILE); return; } p->received += state->result.result_ssize_t; if (p->received > p->length) { - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } @@ -535,7 +535,7 @@ struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, NTSTATUS recvall_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct async_connect_state { @@ -627,7 +627,7 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx, status = map_nt_error_from_unix(state->sys_errno); post_status: fcntl(fd, F_SETFL, state->old_sockflags); - if (!async_post_status(result, ev, status)) { + if (!async_post_ntstatus(result, ev, status)) { goto fail; } return result; @@ -675,7 +675,7 @@ static void async_connect_connected(struct tevent_context *ev, DEBUG(10, ("connect returned %s\n", strerror(errno))); fcntl(state->fd, F_SETFL, state->old_sockflags); - async_req_error(req, map_nt_error_from_unix(state->sys_errno)); + async_req_nterror(req, map_nt_error_from_unix(state->sys_errno)); return; } @@ -693,7 +693,7 @@ NTSTATUS async_connect_recv(struct async_req *req, int *perrno) *perrno = state->sys_errno; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } if (state->sys_errno == 0) { diff --git a/lib/async_req/config.mk b/lib/async_req/config.mk index 8cc594082c..820f890fd0 100644 --- a/lib/async_req/config.mk +++ b/lib/async_req/config.mk @@ -1,3 +1,3 @@ [SUBSYSTEM::LIBASYNC_REQ] -LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_req.o async_sock.o) +LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_req.o async_sock.o async_req_ntstatus.o) diff --git a/source3/Makefile.in b/source3/Makefile.in index babdd51248..fa57db7f3f 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -343,7 +343,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \ lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o \ lib/interfaces.o lib/memcache.o \ lib/util_transfer_file.o ../lib/async_req/async_req.o \ - ../lib/async_req/async_sock.o \ + ../lib/async_req/async_sock.o ../lib/async_req/async_req_ntstatus.o \ $(TDB_LIB_OBJ) \ $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \ lib/interface.o lib/pidfile.o \ diff --git a/source3/include/includes.h b/source3/include/includes.h index 7b0b270f60..c58ebcdbfe 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -647,7 +647,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "ctdbd_conn.h" #include "../lib/util/talloc_stack.h" #include "memcache.h" -#include "../lib/async_req/async_req.h" +#include "../lib/async_req/async_req_ntstatus.h" #include "async_smb.h" #include "../lib/async_req/async_sock.h" #include "services.h" diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 3ddc4342a7..bafcdc5c5c 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1036,7 +1036,7 @@ struct async_req *open_socket_out_send(TALLOC_CTX *mem_ctx, return result; post_status: - if (!async_post_status(result, ev, status)) { + if (!async_post_ntstatus(result, ev, status)) { goto fail; } return result; @@ -1077,12 +1077,12 @@ static void open_socket_out_connected(struct async_req *subreq) subreq = async_connect_send(state, state->ev, state->fd, (struct sockaddr *)&state->ss, state->salen); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } if (!async_req_set_timeout(subreq, state->ev, timeval_set(0, state->wait_nsec))) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } subreq->async.fn = open_socket_out_connected; @@ -1098,7 +1098,7 @@ static void open_socket_out_connected(struct async_req *subreq) #endif /* real error */ - async_req_error(req, map_nt_error_from_unix(sys_errno)); + async_req_nterror(req, map_nt_error_from_unix(sys_errno)); } NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd) @@ -1107,7 +1107,7 @@ NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd) req->private_data, struct open_socket_out_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pfd = state->fd; @@ -1183,7 +1183,7 @@ struct async_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, return result; post_status: - if (!async_post_status(result, ev, status)) { + if (!async_post_ntstatus(result, ev, status)) { goto fail; } return result; @@ -1198,18 +1198,18 @@ static void open_socket_out_defer_waited(struct async_req *subreq) subreq->async.priv, struct async_req); struct open_socket_out_defer_state *state = talloc_get_type_abort( req->private_data, struct open_socket_out_defer_state); - NTSTATUS status; + bool ret; - status = async_wait_recv(subreq); + ret = async_wait_recv(subreq); TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + if (!ret) { + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } subreq = open_socket_out_send(state, state->ev, &state->ss, state->port, state->timeout); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = open_socket_out_defer_connected; @@ -1227,7 +1227,7 @@ static void open_socket_out_defer_connected(struct async_req *subreq) status = open_socket_out_recv(subreq, &state->fd); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -1239,7 +1239,7 @@ NTSTATUS open_socket_out_defer_recv(struct async_req *req, int *pfd) req->private_data, struct open_socket_out_defer_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pfd = state->fd; diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c index 0e6e5d15c4..7bca627690 100644 --- a/source3/lib/wb_reqtrans.c +++ b/source3/lib/wb_reqtrans.c @@ -81,7 +81,7 @@ static void wb_req_read_len(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -89,14 +89,14 @@ static void wb_req_read_len(struct async_req *subreq) DEBUG(0, ("wb_req_read_len: Invalid request size received: " "%d (expected %d)\n", (int)state->wb_req->length, (int)sizeof(struct winbindd_request))); - async_req_error(req, NT_STATUS_INVALID_BUFFER_SIZE); + async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE); return; } subreq = recvall_send( req, state->ev, state->fd, (uint32 *)(state->wb_req)+1, sizeof(struct winbindd_request) - sizeof(uint32), 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -115,7 +115,7 @@ static void wb_req_read_main(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -124,7 +124,7 @@ static void wb_req_read_main(struct async_req *subreq) DEBUG(3, ("Got request with %d bytes extra data on " "unprivileged socket\n", (int)state->wb_req->extra_len)); - async_req_error(req, NT_STATUS_INVALID_BUFFER_SIZE); + async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE); return; } @@ -135,7 +135,7 @@ static void wb_req_read_main(struct async_req *subreq) state->wb_req->extra_data.data = TALLOC_ARRAY( state->wb_req, char, state->wb_req->extra_len + 1); - if (async_req_nomem(state->wb_req->extra_data.data, req)) { + if (async_req_ntnomem(state->wb_req->extra_data.data, req)) { return; } @@ -144,7 +144,7 @@ static void wb_req_read_main(struct async_req *subreq) subreq = recvall_send( req, state->ev, state->fd, state->wb_req->extra_data.data, state->wb_req->extra_len, 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -161,7 +161,7 @@ static void wb_req_read_extra(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -175,7 +175,7 @@ NTSTATUS wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct req_read_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *preq = talloc_move(mem_ctx, &state->wb_req); @@ -232,7 +232,7 @@ static void wb_req_write_main(struct async_req *subreq) status = sendall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -244,7 +244,7 @@ static void wb_req_write_main(struct async_req *subreq) subreq = sendall_send(state, state->ev, state->fd, state->wb_req->extra_data.data, state->wb_req->extra_len, 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -261,7 +261,7 @@ static void wb_req_write_extra(struct async_req *subreq) status = sendall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -270,7 +270,7 @@ static void wb_req_write_extra(struct async_req *subreq) NTSTATUS wb_req_write_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct resp_read_state { @@ -327,7 +327,7 @@ static void wb_resp_read_len(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -336,14 +336,14 @@ static void wb_resp_read_len(struct async_req *subreq) "%d (expected at least%d)\n", (int)state->wb_resp->length, (int)sizeof(struct winbindd_response))); - async_req_error(req, NT_STATUS_INVALID_BUFFER_SIZE); + async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE); return; } subreq = recvall_send( req, state->ev, state->fd, (uint32 *)(state->wb_resp)+1, sizeof(struct winbindd_response) - sizeof(uint32), 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -363,7 +363,7 @@ static void wb_resp_read_main(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -375,7 +375,7 @@ static void wb_resp_read_main(struct async_req *subreq) state->wb_resp->extra_data.data = TALLOC_ARRAY( state->wb_resp, char, extra_len+1); - if (async_req_nomem(state->wb_resp->extra_data.data, req)) { + if (async_req_ntnomem(state->wb_resp->extra_data.data, req)) { return; } ((char *)state->wb_resp->extra_data.data)[extra_len] = 0; @@ -383,7 +383,7 @@ static void wb_resp_read_main(struct async_req *subreq) subreq = recvall_send( req, state->ev, state->fd, state->wb_resp->extra_data.data, extra_len, 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -400,7 +400,7 @@ static void wb_resp_read_extra(struct async_req *subreq) status = recvall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -414,7 +414,7 @@ NTSTATUS wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct resp_read_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *presp = talloc_move(mem_ctx, &state->wb_resp); @@ -471,7 +471,7 @@ static void wb_resp_write_main(struct async_req *subreq) status = sendall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -484,7 +484,7 @@ static void wb_resp_write_main(struct async_req *subreq) state, state->ev, state->fd, state->wb_resp->extra_data.data, state->wb_resp->length - sizeof(struct winbindd_response), 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -501,7 +501,7 @@ static void wb_resp_write_extra(struct async_req *subreq) status = sendall_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -510,5 +510,5 @@ static void wb_resp_write_extra(struct async_req *subreq) NTSTATUS wb_resp_write_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } diff --git a/source3/lib/wbclient.c b/source3/lib/wbclient.c index ea0bcb512e..cf5ce7e734 100644 --- a/source3/lib/wbclient.c +++ b/source3/lib/wbclient.c @@ -232,7 +232,7 @@ static struct async_req *wb_connect_send(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } - if (async_post_status(req, ev, status)) { + if (async_post_ntstatus(req, ev, status)) { return req; } TALLOC_FREE(req); @@ -295,8 +295,8 @@ static struct async_req *wb_int_trans_send(TALLOC_CTX *mem_ctx, } if (winbind_closed_fd(fd)) { - if (!async_post_status(result, ev, - NT_STATUS_PIPE_DISCONNECTED)) { + if (!async_post_ntstatus(result, ev, + NT_STATUS_PIPE_DISCONNECTED)) { goto fail; } return result; @@ -334,13 +334,13 @@ static void wb_int_trans_write_done(struct async_req *subreq) status = wb_req_write_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } subreq = wb_resp_read_send(state, state->ev, state->fd); if (subreq == NULL) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); } subreq->async.fn = wb_int_trans_read_done; subreq->async.priv = req; @@ -357,7 +357,7 @@ static void wb_int_trans_read_done(struct async_req *subreq) status = wb_resp_read_recv(subreq, state, &state->wb_resp); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -372,7 +372,7 @@ static NTSTATUS wb_int_trans_recv(struct async_req *req, req->private_data, struct wb_int_trans_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -454,7 +454,7 @@ static void wb_open_pipe_connect_nonpriv_done(struct async_req *subreq) TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { state->wb_ctx->is_priv = true; - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -463,7 +463,7 @@ static void wb_open_pipe_connect_nonpriv_done(struct async_req *subreq) subreq = wb_int_trans_send(state, state->ev, state->wb_ctx->fd, &state->wb_req); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -483,7 +483,7 @@ static void wb_open_pipe_ping_done(struct async_req *subreq) status = wb_int_trans_recv(subreq, state, &wb_resp); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -496,7 +496,7 @@ static void wb_open_pipe_ping_done(struct async_req *subreq) subreq = wb_int_trans_send(state, state->ev, state->wb_ctx->fd, &state->wb_req); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -516,7 +516,7 @@ static void wb_open_pipe_getpriv_done(struct async_req *subreq) status = wb_int_trans_recv(subreq, state, &wb_resp); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -526,7 +526,7 @@ static void wb_open_pipe_getpriv_done(struct async_req *subreq) subreq = wb_connect_send(state, state->ev, state->wb_ctx, (char *)wb_resp->extra_data.data); TALLOC_FREE(wb_resp); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -545,7 +545,7 @@ static void wb_open_pipe_connect_priv_done(struct async_req *subreq) status = wb_connect_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } state->wb_ctx->is_priv = true; @@ -554,7 +554,7 @@ static void wb_open_pipe_connect_priv_done(struct async_req *subreq) static NTSTATUS wb_open_pipe_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct wb_trans_state { @@ -582,7 +582,7 @@ static void wb_trigger_trans(struct async_req *req) subreq = wb_open_pipe_send(state, state->ev, state->wb_ctx, state->need_priv); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = wb_trans_connect_done; @@ -592,7 +592,7 @@ static void wb_trigger_trans(struct async_req *req) subreq = wb_int_trans_send(state, state->ev, state->wb_ctx->fd, state->wb_req); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = wb_trans_done; @@ -645,13 +645,13 @@ static bool wb_trans_retry(struct async_req *req, * Winbind not around or we can't connect to the pipe. Fail * immediately. */ - async_req_error(req, status); + async_req_nterror(req, status); return true; } state->num_retries -= 1; if (state->num_retries == 0) { - async_req_error(req, status); + async_req_nterror(req, status); return true; } @@ -665,7 +665,7 @@ static bool wb_trans_retry(struct async_req *req, } subreq = async_wait_send(state, state->ev, timeval_set(1, 0)); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return true; } @@ -680,18 +680,18 @@ static void wb_trans_retry_wait_done(struct async_req *subreq) subreq->async.priv, struct async_req); struct wb_trans_state *state = talloc_get_type_abort( req->private_data, struct wb_trans_state); - NTSTATUS status; + bool ret; - status = async_wait_recv(subreq); + ret = async_wait_recv(subreq); TALLOC_FREE(subreq); - if (!NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - async_req_error(req, status); + if (ret) { + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; } subreq = wb_open_pipe_send(state, state->ev, state->wb_ctx, state->need_priv); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = wb_trans_connect_done; @@ -715,7 +715,7 @@ static void wb_trans_connect_done(struct async_req *subreq) subreq = wb_int_trans_send(state, state->ev, state->wb_ctx->fd, state->wb_req); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } @@ -748,7 +748,7 @@ NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct wb_trans_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 18e5a71ee2..e579d1c9f0 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -979,7 +979,7 @@ static void handle_incoming_pdu(struct cli_state *cli) nt_errstr(status))); for (req = cli->outstanding_requests; req; req = req->next) { - async_req_error(req->async[0], status); + async_req_nterror(req->async[0], status); } return; } @@ -1110,7 +1110,7 @@ static void cli_state_handler(struct event_context *event_ctx, num_async = req->num_async; for (i=0; i<num_async; i++) { - async_req_error(req->async[i], status); + async_req_nterror(req->async[i], status); } } TALLOC_FREE(cli->fd_event); diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index ed5adc5694..60b1a6027c 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -215,7 +215,7 @@ NTSTATUS cli_session_setup_guest_recv(struct async_req *req) uint8_t *p; NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -1283,7 +1283,7 @@ struct async_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx, access_denied: result = async_req_new(mem_ctx); - if (async_post_status(result, ev, NT_STATUS_ACCESS_DENIED)) { + if (async_post_ntstatus(result, ev, NT_STATUS_ACCESS_DENIED)) { return result; } TALLOC_FREE(result); @@ -1301,7 +1301,7 @@ NTSTATUS cli_tcon_andx_recv(struct async_req *req) uint8_t *bytes; NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -1483,7 +1483,7 @@ NTSTATUS cli_negprot_recv(struct async_req *req) NTSTATUS status; uint16_t protnum; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index a41aa11f7a..0382ef5fae 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -650,7 +650,7 @@ static void cli_echo_recv_helper(struct async_req *req) status = cli_pull_reply(req, &wct, &vwv, &num_bytes, &bytes); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -659,7 +659,7 @@ static void cli_echo_recv_helper(struct async_req *req) if ((num_bytes != cli_req->data.echo.data.length) || (memcmp(cli_req->data.echo.data.data, bytes, num_bytes) != 0)) { - async_req_error(req, NT_STATUS_INVALID_NETWORK_RESPONSE); + async_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } @@ -727,7 +727,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev, NTSTATUS cli_echo_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } /** diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 91f13a79ac..0703f04c5f 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -836,7 +836,7 @@ NTSTATUS cli_ntcreate_recv(struct async_req *req, uint16_t *pfnum) uint8_t *bytes; NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -1049,7 +1049,7 @@ NTSTATUS cli_open_recv(struct async_req *req, int *fnum) uint8_t *bytes; NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -1127,7 +1127,7 @@ NTSTATUS cli_close_recv(struct async_req *req) uint8_t *bytes; NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 1ba93d827d..26fa614f69 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -148,7 +148,7 @@ NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received, NTSTATUS status; size_t size; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -297,7 +297,7 @@ struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx, state->top_req = 0; if (size == 0) { - if (!async_post_status(result, ev, NT_STATUS_OK)) { + if (!async_post_ntstatus(result, ev, NT_STATUS_OK)) { goto failed; } return result; @@ -367,7 +367,7 @@ static void cli_pull_read_done(struct async_req *read_req) status = cli_read_andx_recv(read_req, &read_state->data.read.received, &read_state->data.read.rcvbuf); if (!NT_STATUS_IS_OK(status)) { - async_req_error(state->req, status); + async_req_nterror(state->req, status); return; } @@ -404,7 +404,7 @@ static void cli_pull_read_done(struct async_req *read_req) top_read->data.read.received, state->priv); if (!NT_STATUS_IS_OK(status)) { - async_req_error(state->req, status); + async_req_nterror(state->req, status); return; } state->pushed += top_read->data.read.received; @@ -432,7 +432,7 @@ static void cli_pull_read_done(struct async_req *read_req) state->start_offset + state->requested, request_thistime); - if (async_req_nomem(new_req, state->req)) { + if (async_req_ntnomem(new_req, state->req)) { return; } @@ -455,7 +455,7 @@ NTSTATUS cli_pull_recv(struct async_req *req, SMB_OFF_T *received) req->private_data, struct cli_pull_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *received = state->pushed; @@ -792,7 +792,7 @@ NTSTATUS cli_write_andx_recv(struct async_req *req, size_t *pwritten) NTSTATUS status; size_t written; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -879,14 +879,14 @@ static void cli_writeall_written(struct async_req *subreq) status = cli_write_andx_recv(subreq, &written); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } state->written += written; if (state->written > state->size) { - async_req_error(req, NT_STATUS_INVALID_NETWORK_RESPONSE); + async_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } @@ -902,7 +902,7 @@ static void cli_writeall_written(struct async_req *subreq) state->buf + state->written, state->offset + state->written, to_write); if (subreq == NULL) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } @@ -912,7 +912,7 @@ static void cli_writeall_written(struct async_req *subreq) static NTSTATUS cli_writeall_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct cli_push_state { @@ -1018,7 +1018,7 @@ struct async_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev, } if (i == 0) { - if (!async_post_status(result, ev, NT_STATUS_OK)) { + if (!async_post_ntstatus(result, ev, NT_STATUS_OK)) { goto failed; } return result; @@ -1047,7 +1047,7 @@ static void cli_push_written(struct async_req *req) } if (i == state->num_reqs) { - async_req_error(state->req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(state->req, NT_STATUS_INTERNAL_ERROR); return; } @@ -1055,7 +1055,7 @@ static void cli_push_written(struct async_req *req) TALLOC_FREE(state->reqs[i]); req = NULL; if (!NT_STATUS_IS_OK(status)) { - async_req_error(state->req, status); + async_req_nterror(state->req, status); return; } @@ -1081,7 +1081,7 @@ static void cli_push_written(struct async_req *req) state->reqs, state->ev, state->cli, state->fnum, state->mode, buf, state->start_offset + state->sent, to_write); if (state->reqs[i] == NULL) { - async_req_error(state->req, NT_STATUS_NO_MEMORY); + async_req_nterror(state->req, NT_STATUS_NO_MEMORY); return; } @@ -1094,7 +1094,7 @@ static void cli_push_written(struct async_req *req) NTSTATUS cli_push_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode, diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 4a0fc5f6e9..69e2be3af7 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -962,7 +962,7 @@ static void cli_trans_ship_rest(struct async_req *req, { state->secondary_request_ctx = talloc_new(state); if (state->secondary_request_ctx == NULL) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } @@ -972,7 +972,7 @@ static void cli_trans_ship_rest(struct async_req *req, cli_req = cli_ship_trans(state->secondary_request_ctx, state); if (cli_req == NULL) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } } @@ -1133,7 +1133,7 @@ static void cli_trans_recv_helper(struct async_req *req) */ if (NT_STATUS_IS_ERR(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1154,7 +1154,7 @@ static void cli_trans_recv_helper(struct async_req *req) state->rsetup = (uint16_t *)TALLOC_MEMDUP( state, setup, sizeof(uint16_t) * num_setup); if (state->rsetup == NULL) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } } @@ -1165,7 +1165,7 @@ static void cli_trans_recv_helper(struct async_req *req) if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("Pulling params failed: %s\n", nt_errstr(status))); - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1175,7 +1175,7 @@ static void cli_trans_recv_helper(struct async_req *req) if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("Pulling data failed: %s\n", nt_errstr(status))); - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1318,7 +1318,7 @@ NTSTATUS cli_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, cli_req->recv_helper.priv, struct cli_trans_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 0aaec05f67..b9fd322485 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -255,7 +255,7 @@ static void rpc_read_done(struct async_req *subreq) status = state->transport->read_recv(subreq, &received); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -269,7 +269,7 @@ static void rpc_read_done(struct async_req *subreq) state->data + state->num_read, state->size - state->num_read, state->transport->priv); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_read_done; @@ -278,7 +278,7 @@ static void rpc_read_done(struct async_req *subreq) static NTSTATUS rpc_read_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct rpc_write_state { @@ -335,7 +335,7 @@ static void rpc_write_done(struct async_req *subreq) status = state->transport->write_recv(subreq, &written); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -350,7 +350,7 @@ static void rpc_write_done(struct async_req *subreq) state->data + state->num_written, state->size - state->num_written, state->transport->priv); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_write_done; @@ -359,7 +359,7 @@ static void rpc_write_done(struct async_req *subreq) static NTSTATUS rpc_write_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } @@ -470,7 +470,7 @@ static struct async_req *get_complete_frag_send(TALLOC_CTX *mem_ctx, status = NT_STATUS_OK; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } TALLOC_FREE(result); @@ -488,18 +488,18 @@ static void get_complete_frag_got_header(struct async_req *subreq) status = rpc_read_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } status = parse_rpc_header(state->cli, state->prhdr, state->pdu); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } if (!rpc_grow_buffer(state->pdu, state->prhdr->frag_len)) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } @@ -512,7 +512,7 @@ static void get_complete_frag_got_header(struct async_req *subreq) state, state->ev, state->cli->transport, (uint8_t *)(prs_data_p(state->pdu) + RPC_HEADER_LEN), state->prhdr->frag_len - RPC_HEADER_LEN); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = get_complete_frag_got_rest; @@ -528,7 +528,7 @@ static void get_complete_frag_got_rest(struct async_req *subreq) status = rpc_read_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -536,7 +536,7 @@ static void get_complete_frag_got_rest(struct async_req *subreq) static NTSTATUS get_complete_frag_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } /**************************************************************************** @@ -1096,7 +1096,7 @@ static struct async_req *cli_api_pipe_send(TALLOC_CTX *mem_ctx, status = NT_STATUS_INVALID_PARAMETER; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } fail: @@ -1116,7 +1116,7 @@ static void cli_api_pipe_trans_done(struct async_req *subreq) &state->rdata_len); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -1133,12 +1133,12 @@ static void cli_api_pipe_write_done(struct async_req *subreq) status = rpc_write_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } state->rdata = TALLOC_ARRAY(state, uint8_t, RPC_HEADER_LEN); - if (async_req_nomem(state->rdata, req)) { + if (async_req_ntnomem(state->rdata, req)) { return; } @@ -1150,7 +1150,7 @@ static void cli_api_pipe_write_done(struct async_req *subreq) subreq = state->transport->read_send(state, state->ev, state->rdata, RPC_HEADER_LEN, state->transport->priv); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = cli_api_pipe_read_done; @@ -1169,7 +1169,7 @@ static void cli_api_pipe_read_done(struct async_req *subreq) status = state->transport->read_recv(subreq, &received); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } state->rdata_len = received; @@ -1183,7 +1183,7 @@ static NTSTATUS cli_api_pipe_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct cli_api_pipe_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -1296,7 +1296,7 @@ static struct async_req *rpc_api_pipe_send(TALLOC_CTX *mem_ctx, return result; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } TALLOC_FREE(result); @@ -1318,7 +1318,7 @@ static void rpc_api_pipe_trans_done(struct async_req *subreq) TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("cli_api_pipe failed: %s\n", nt_errstr(status))); - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1336,7 +1336,7 @@ static void rpc_api_pipe_trans_done(struct async_req *subreq) */ rdata_copy = (char *)memdup(rdata, rdata_len); TALLOC_FREE(rdata); - if (async_req_nomem(rdata_copy, req)) { + if (async_req_ntnomem(rdata_copy, req)) { return; } prs_give_memory(&state->incoming_frag, rdata_copy, rdata_len, true); @@ -1344,7 +1344,7 @@ static void rpc_api_pipe_trans_done(struct async_req *subreq) /* Ensure we have enough data for a pdu. */ subreq = get_complete_frag_send(state, state->ev, state->cli, &state->rhdr, &state->incoming_frag); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_api_pipe_got_pdu; @@ -1366,7 +1366,7 @@ static void rpc_api_pipe_got_pdu(struct async_req *subreq) if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("get_complete_frag failed: %s\n", nt_errstr(status))); - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1381,7 +1381,7 @@ static void rpc_api_pipe_got_pdu(struct async_req *subreq) nt_errstr(status))); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1405,13 +1405,13 @@ static void rpc_api_pipe_got_pdu(struct async_req *subreq) "%s\n", state->incoming_pdu.bigendian_data?"big":"little", state->incoming_frag.bigendian_data?"big":"little")); - async_req_error(req, NT_STATUS_INVALID_PARAMETER); + async_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } /* Now copy the data portion out of the pdu into rbuf. */ if (!prs_force_grow(&state->incoming_pdu, rdata_len)) { - async_req_error(req, NT_STATUS_NO_MEMORY); + async_req_nterror(req, NT_STATUS_NO_MEMORY); return; } @@ -1422,7 +1422,7 @@ static void rpc_api_pipe_got_pdu(struct async_req *subreq) status = cli_pipe_reset_current_pdu(state->cli, &state->rhdr, &state->incoming_frag); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -1436,7 +1436,7 @@ static void rpc_api_pipe_got_pdu(struct async_req *subreq) subreq = get_complete_frag_send(state, state->ev, state->cli, &state->rhdr, &state->incoming_frag); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_api_pipe_got_pdu; @@ -1450,7 +1450,7 @@ static NTSTATUS rpc_api_pipe_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct rpc_api_pipe_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } @@ -2117,7 +2117,7 @@ struct async_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx, return result; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } TALLOC_FREE(result); @@ -2221,13 +2221,13 @@ static void rpc_api_pipe_req_write_done(struct async_req *subreq) status = rpc_write_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } status = prepare_next_frag(state, &is_last_frag); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -2235,7 +2235,7 @@ static void rpc_api_pipe_req_write_done(struct async_req *subreq) subreq = rpc_api_pipe_send(state, state->ev, state->cli, &state->outgoing_frag, RPC_RESPONSE); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_api_pipe_req_done; @@ -2246,7 +2246,7 @@ static void rpc_api_pipe_req_write_done(struct async_req *subreq) state->cli->transport, (uint8_t *)prs_data_p(&state->outgoing_frag), prs_offset(&state->outgoing_frag)); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = rpc_api_pipe_req_write_done; @@ -2265,7 +2265,7 @@ static void rpc_api_pipe_req_done(struct async_req *subreq) status = rpc_api_pipe_recv(subreq, state, &state->reply_pdu); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -2278,7 +2278,7 @@ NTSTATUS rpc_api_pipe_req_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct rpc_api_pipe_req_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { /* * We always have to initialize to reply pdu, even if there is * none. The rpccli_* caller routines expect this. @@ -2585,7 +2585,7 @@ struct async_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx, return result; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } TALLOC_FREE(result); @@ -2609,7 +2609,7 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) DEBUG(3, ("rpc_pipe_bind: %s bind request returned %s\n", rpccli_pipe_txt(debug_ctx(), state->cli), nt_errstr(status))); - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -2617,7 +2617,7 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) if (!smb_io_rpc_hdr("hdr", &hdr, &reply_pdu, 0)) { DEBUG(0, ("rpc_pipe_bind: failed to unmarshall RPC_HDR.\n")); prs_mem_free(&reply_pdu); - async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL); + async_req_nterror(req, NT_STATUS_BUFFER_TOO_SMALL); return; } @@ -2625,14 +2625,14 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) DEBUG(0, ("rpc_pipe_bind: Failed to unmarshall " "RPC_HDR_BA.\n")); prs_mem_free(&reply_pdu); - async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL); + async_req_nterror(req, NT_STATUS_BUFFER_TOO_SMALL); return; } if (!check_bind_response(&hdr_ba, &state->cli->transfer_syntax)) { DEBUG(2, ("rpc_pipe_bind: check_bind_response failed.\n")); prs_mem_free(&reply_pdu); - async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL); + async_req_nterror(req, NT_STATUS_BUFFER_TOO_SMALL); return; } @@ -2658,7 +2658,7 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) &reply_pdu); prs_mem_free(&reply_pdu); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); } break; @@ -2668,7 +2668,7 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) &reply_pdu); prs_mem_free(&reply_pdu); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); } break; @@ -2679,7 +2679,7 @@ static void rpc_pipe_bind_step_one_done(struct async_req *subreq) DEBUG(0,("cli_finish_bind_auth: unknown auth type %u\n", (unsigned int)state->cli->auth->auth_type)); prs_mem_free(&reply_pdu); - async_req_error(req, NT_STATUS_INTERNAL_ERROR); + async_req_nterror(req, NT_STATUS_INTERNAL_ERROR); } } @@ -2756,7 +2756,7 @@ static void rpc_bind_auth3_write_done(struct async_req *subreq) status = rpc_write_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -2871,7 +2871,7 @@ static void rpc_bind_ntlmssp_api_done(struct async_req *subreq) status = rpc_api_pipe_recv(subreq, talloc_tos(), &reply_pdu); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -2879,19 +2879,19 @@ static void rpc_bind_ntlmssp_api_done(struct async_req *subreq) if (!smb_io_rpc_hdr("rpc_hdr ", &hdr, &reply_pdu, 0)) { DEBUG(0, ("rpc_finish_spnego_ntlmssp_bind: Failed to " "unmarshall RPC_HDR.\n")); - async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL); + async_req_nterror(req, NT_STATUS_BUFFER_TOO_SMALL); return; } if (!prs_set_offset( &reply_pdu, hdr.frag_len - hdr.auth_len - RPC_HDR_AUTH_LEN)) { - async_req_error(req, NT_STATUS_INVALID_PARAMETER); + async_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } if (!smb_io_rpc_hdr_auth("hdr_auth", &hdr_auth, &reply_pdu, 0)) { - async_req_error(req, NT_STATUS_INVALID_PARAMETER); + async_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } @@ -2904,7 +2904,7 @@ static void rpc_bind_ntlmssp_api_done(struct async_req *subreq) OID_NTLMSSP, &tmp_blob)) { data_blob_free(&server_spnego_response); data_blob_free(&tmp_blob); - async_req_error(req, NT_STATUS_INVALID_PARAMETER); + async_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } @@ -2918,7 +2918,7 @@ static void rpc_bind_ntlmssp_api_done(struct async_req *subreq) NTSTATUS rpc_pipe_bind_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli, diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c index a11e0e0f22..80ff384046 100644 --- a/source3/rpc_client/rpc_transport_np.c +++ b/source3/rpc_client/rpc_transport_np.c @@ -93,7 +93,7 @@ static void rpc_np_write_done(struct async_req *subreq) status = cli_write_andx_recv(subreq, &state->written); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -105,7 +105,7 @@ static NTSTATUS rpc_np_write_recv(struct async_req *req, ssize_t *pwritten) req->private_data, struct rpc_np_write_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pwritten = state->written; @@ -169,13 +169,13 @@ static void rpc_np_read_done(struct async_req *subreq) } if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(subreq); - async_req_error(req, status); + async_req_nterror(req, status); return; } if (state->received > state->size) { TALLOC_FREE(subreq); - async_req_error(req, NT_STATUS_INVALID_NETWORK_RESPONSE); + async_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } @@ -189,7 +189,7 @@ static NTSTATUS rpc_np_read_recv(struct async_req *req, ssize_t *preceived) req->private_data, struct rpc_np_read_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *preceived = state->received; @@ -251,7 +251,7 @@ static void rpc_np_trans_done(struct async_req *subreq) &state->rdata, &state->rdata_len); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -264,7 +264,7 @@ static NTSTATUS rpc_np_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, req->private_data, struct rpc_np_trans_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *prdata = talloc_move(mem_ctx, &state->rdata); @@ -334,7 +334,7 @@ static void rpc_transport_np_init_pipe_open(struct async_req *subreq) status = cli_ntcreate_recv(subreq, &state->transport_np->fnum); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } @@ -351,7 +351,7 @@ NTSTATUS rpc_transport_np_init_recv(struct async_req *req, req->private_data, struct rpc_transport_np_init_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/rpc_client/rpc_transport_smbd.c b/source3/rpc_client/rpc_transport_smbd.c index 0ff4ebd468..b93e4cf602 100644 --- a/source3/rpc_client/rpc_transport_smbd.c +++ b/source3/rpc_client/rpc_transport_smbd.c @@ -169,12 +169,12 @@ static void get_anon_ipc_negprot_done(struct async_req *subreq) status = cli_negprot_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } subreq = cli_session_setup_guest_send(state, state->ev, state->cli); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = get_anon_ipc_sesssetup_done; @@ -192,13 +192,13 @@ static void get_anon_ipc_sesssetup_done(struct async_req *subreq) status = cli_session_setup_guest_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } subreq = cli_tcon_andx_send(state, state->ev, state->cli, "IPC$", "IPC", NULL, 0); - if (async_req_nomem(subreq, req)) { + if (async_req_ntnomem(subreq, req)) { return; } subreq->async.fn = get_anon_ipc_tcon_done; @@ -214,7 +214,7 @@ static void get_anon_ipc_tcon_done(struct async_req *subreq) status = cli_tcon_andx_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -222,7 +222,7 @@ static void get_anon_ipc_tcon_done(struct async_req *subreq) static NTSTATUS get_anon_ipc_recv(struct async_req *req) { - return async_req_simple_recv(req); + return async_req_simple_recv_ntstatus(req); } struct rpc_cli_smbd_conn_init_state { @@ -356,7 +356,7 @@ struct async_req *rpc_cli_smbd_conn_init_send(TALLOC_CTX *mem_ctx, if (stdout_pipe[1] != -1) { close(stdout_pipe[1]); } - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } TALLOC_FREE(result); @@ -372,7 +372,7 @@ static void rpc_cli_smbd_conn_init_done(struct async_req *subreq) status = get_anon_ipc_recv(subreq); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -386,7 +386,7 @@ NTSTATUS rpc_cli_smbd_conn_init_recv(struct async_req *req, req->private_data, struct rpc_cli_smbd_conn_init_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pconn = talloc_move(mem_ctx, &state->conn); @@ -481,7 +481,7 @@ static void rpc_smbd_write_done(struct async_req *subreq) status = state->sub_transp->write_recv(subreq, &state->written); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -493,7 +493,7 @@ static NTSTATUS rpc_smbd_write_recv(struct async_req *req, ssize_t *pwritten) req->private_data, struct rpc_smbd_write_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pwritten = state->written; @@ -554,7 +554,7 @@ static void rpc_smbd_read_done(struct async_req *subreq) status = state->sub_transp->read_recv(subreq, &state->received); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -566,7 +566,7 @@ static NTSTATUS rpc_smbd_read_recv(struct async_req *req, ssize_t *preceived) req->private_data, struct rpc_smbd_read_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *preceived = state->received; @@ -632,7 +632,7 @@ static void rpc_transport_smbd_init_done(struct async_req *subreq) &state->transport_smbd->sub_transp); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -646,7 +646,7 @@ NTSTATUS rpc_transport_smbd_init_recv(struct async_req *req, req->private_data, struct rpc_transport_smbd_init_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 49049f8d55..fa38176749 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -1183,7 +1183,7 @@ struct async_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, status = NT_STATUS_INVALID_HANDLE; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } fail: @@ -1199,7 +1199,7 @@ static void np_write_done(struct async_req *subreq) status = sendall_recv(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -1211,7 +1211,7 @@ NTSTATUS np_write_recv(struct async_req *req, ssize_t *pnwritten) req->private_data, struct np_write_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *pnwritten = state->nwritten; @@ -1267,7 +1267,7 @@ struct async_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev, status = NT_STATUS_INVALID_HANDLE; post_status: - if (async_post_status(result, ev, status)) { + if (async_post_ntstatus(result, ev, status)) { return result; } fail: @@ -1283,7 +1283,7 @@ static void np_read_done(struct async_req *subreq) status = recvall_recv(subreq); if (!NT_STATUS_IS_OK(status)) { - async_req_error(req, status); + async_req_nterror(req, status); return; } async_req_done(req); @@ -1296,7 +1296,7 @@ NTSTATUS np_read_recv(struct async_req *req, ssize_t *nread, req->private_data, struct np_read_state); NTSTATUS status; - if (async_req_is_error(req, &status)) { + if (async_req_is_nterror(req, &status)) { return status; } *nread = state->nread; |