summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-02-01 16:32:02 +0100
committerVolker Lendecke <vl@samba.org>2009-02-01 19:05:39 +0100
commitc14b7e648bcfc4865da4b290e46977fff81d4500 (patch)
tree0986bdd1520bf5df0d17d05f35873154756331cb /source3
parent0931bb8937eaec55844dee0cdeefafa162053c53 (diff)
downloadsamba-c14b7e648bcfc4865da4b290e46977fff81d4500.tar.gz
samba-c14b7e648bcfc4865da4b290e46977fff81d4500.tar.bz2
samba-c14b7e648bcfc4865da4b290e46977fff81d4500.zip
Split up async_req into a generic and a NTSTATUS specific part
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in2
-rw-r--r--source3/include/includes.h2
-rw-r--r--source3/lib/util_sock.c26
-rw-r--r--source3/lib/wb_reqtrans.c50
-rw-r--r--source3/lib/wbclient.c54
-rw-r--r--source3/libsmb/async_smb.c4
-rw-r--r--source3/libsmb/cliconnect.c8
-rw-r--r--source3/libsmb/clientgen.c6
-rw-r--r--source3/libsmb/clifile.c6
-rw-r--r--source3/libsmb/clireadwrite.c32
-rw-r--r--source3/libsmb/clitrans.c14
-rw-r--r--source3/rpc_client/cli_pipe.c106
-rw-r--r--source3/rpc_client/rpc_transport_np.c18
-rw-r--r--source3/rpc_client/rpc_transport_smbd.c30
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c12
15 files changed, 185 insertions, 185 deletions
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;