diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-11-09 19:24:51 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:45:02 +0100 |
commit | 529763a9aa192a6785ba878aceeb1683c2510913 (patch) | |
tree | 5fc843ffa644969ecd967d8b4133fc19333c33b5 /source4/rpc_server | |
parent | b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86 (diff) | |
download | samba-529763a9aa192a6785ba878aceeb1683c2510913.tar.gz samba-529763a9aa192a6785ba878aceeb1683c2510913.tar.bz2 samba-529763a9aa192a6785ba878aceeb1683c2510913.zip |
r25920: ndr: change NTSTAUS into enum ndr_err_code (samba4 callers)
lib/messaging/
lib/registry/
lib/ldb-samba/
librpc/rpc/
auth/auth_winbind.c
auth/gensec/
auth/kerberos/
dsdb/repl/
dsdb/samdb/
dsdb/schema/
torture/
cluster/ctdb/
kdc/
ntvfs/ipc/
torture/rap/
ntvfs/
utils/getntacl.c
ntptr/
smb_server/
libcli/wrepl/
wrepl_server/
libcli/cldap/
libcli/dgram/
libcli/ldap/
libcli/raw/
libcli/nbt/
libnet/
winbind/
rpc_server/
metze
(This used to be commit 6223c7fddc972687eb577e04fc1c8e0604c35435)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 7 | ||||
-rw-r--r-- | source4/rpc_server/dcesrv_auth.c | 48 | ||||
-rw-r--r-- | source4/rpc_server/remote/dcesrv_remote.c | 12 | ||||
-rw-r--r-- | source4/rpc_server/winreg/rpc_winreg.c | 8 |
4 files changed, 40 insertions, 35 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 4388c86f22..e146509b67 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1027,6 +1027,7 @@ static int dcesrv_call_dequeue(struct dcesrv_call_state *call) NTSTATUS dcesrv_input_process(struct dcesrv_connection *dce_conn) { struct ndr_pull *ndr; + enum ndr_err_code ndr_err; NTSTATUS status; struct dcesrv_call_state *call; DATA_BLOB blob; @@ -1059,11 +1060,11 @@ NTSTATUS dcesrv_input_process(struct dcesrv_connection *dce_conn) ndr->flags |= LIBNDR_FLAG_BIGENDIAN; } - status = ndr_pull_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, &call->pkt); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, &call->pkt); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(dce_conn->partial_input.data); talloc_free(call); - return status; + return ndr_map_error2ntstatus(ndr_err); } /* we have to check the signing here, before combining the diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 911cfe4799..0ce55dd069 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -39,6 +39,7 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call) struct dcesrv_connection *dce_conn = call->conn; struct dcesrv_auth *auth = &dce_conn->auth_state; NTSTATUS status; + enum ndr_err_code ndr_err; if (pkt->u.bind.auth_info.length == 0) { dce_conn->auth_state.auth_info = NULL; @@ -50,11 +51,11 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call) return false; } - status = ndr_pull_struct_blob(&pkt->u.bind.auth_info, - call, - dce_conn->auth_state.auth_info, - (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_struct_blob(&pkt->u.bind.auth_info, + call, + dce_conn->auth_state.auth_info, + (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } @@ -143,6 +144,7 @@ bool dcesrv_auth_auth3(struct dcesrv_call_state *call) struct ncacn_packet *pkt = &call->pkt; struct dcesrv_connection *dce_conn = call->conn; NTSTATUS status; + enum ndr_err_code ndr_err; /* We can't work without an existing gensec state, and an new blob to feed it */ if (!dce_conn->auth_state.auth_info || @@ -151,11 +153,11 @@ bool dcesrv_auth_auth3(struct dcesrv_call_state *call) return false; } - status = ndr_pull_struct_blob(&pkt->u.auth3.auth_info, - call, - dce_conn->auth_state.auth_info, - (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_struct_blob(&pkt->u.auth3.auth_info, + call, + dce_conn->auth_state.auth_info, + (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } @@ -192,7 +194,7 @@ bool dcesrv_auth_alter(struct dcesrv_call_state *call) { struct ncacn_packet *pkt = &call->pkt; struct dcesrv_connection *dce_conn = call->conn; - NTSTATUS status; + enum ndr_err_code ndr_err; /* on a pure interface change there is no auth blob */ if (pkt->u.alter.auth_info.length == 0) { @@ -209,11 +211,11 @@ bool dcesrv_auth_alter(struct dcesrv_call_state *call) return false; } - status = ndr_pull_struct_blob(&pkt->u.alter.auth_info, - call, - dce_conn->auth_state.auth_info, - (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_struct_blob(&pkt->u.alter.auth_info, + call, + dce_conn->auth_state.auth_info, + (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } @@ -304,6 +306,7 @@ bool dcesrv_auth_request(struct dcesrv_call_state *call, DATA_BLOB *full_packet) struct dcerpc_auth auth; struct ndr_pull *ndr; NTSTATUS status; + enum ndr_err_code ndr_err; if (!dce_conn->auth_state.auth_info || !dce_conn->auth_state.gensec_security) { @@ -332,8 +335,8 @@ bool dcesrv_auth_request(struct dcesrv_call_state *call, DATA_BLOB *full_packet) ndr->flags |= LIBNDR_FLAG_BIGENDIAN; } - status = ndr_pull_dcerpc_auth(ndr, NDR_SCALARS|NDR_BUFFERS, &auth); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_dcerpc_auth(ndr, NDR_SCALARS|NDR_BUFFERS, &auth); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(ndr); return false; } @@ -392,6 +395,7 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, { struct dcesrv_connection *dce_conn = call->conn; NTSTATUS status; + enum ndr_err_code ndr_err; struct ndr_push *ndr; uint32_t payload_length; DATA_BLOB creds2; @@ -411,8 +415,8 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, ndr->flags |= LIBNDR_FLAG_BIGENDIAN; } - status = ndr_push_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_push_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } @@ -441,9 +445,9 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, } /* add the auth verifier */ - status = ndr_push_dcerpc_auth(ndr, NDR_SCALARS|NDR_BUFFERS, + ndr_err = ndr_push_dcerpc_auth(ndr, NDR_SCALARS|NDR_BUFFERS, dce_conn->auth_state.auth_info); - if (!NT_STATUS_IS_OK(status)) { + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index f009323ae2..f91334510c 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -124,7 +124,7 @@ static void remote_op_unbind(struct dcesrv_connection_context *context, const st static NTSTATUS remote_op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r) { - NTSTATUS status; + enum ndr_err_code ndr_err; const struct ndr_interface_table *table = (const struct ndr_interface_table *)dce_call->context->iface->private; uint16_t opnum = dce_call->pkt.u.request.opnum; @@ -141,8 +141,8 @@ static NTSTATUS remote_op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CT } /* unravel the NDR for the packet */ - status = table->calls[opnum].ndr_pull(pull, NDR_IN, *r); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = table->calls[opnum].ndr_pull(pull, NDR_IN, *r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { dcerpc_log_packet(table, opnum, NDR_IN, &dce_call->pkt.u.request.stub_and_verifier); dce_call->fault_code = DCERPC_FAULT_NDR; @@ -188,13 +188,13 @@ static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CT static NTSTATUS remote_op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r) { - NTSTATUS status; + enum ndr_err_code ndr_err; const struct ndr_interface_table *table = dce_call->context->iface->private; uint16_t opnum = dce_call->pkt.u.request.opnum; /* unravel the NDR for the packet */ - status = table->calls[opnum].ndr_push(push, NDR_OUT, r); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = table->calls[opnum].ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { dce_call->fault_code = DCERPC_FAULT_NDR; return NT_STATUS_NET_WRITE_FAULT; } diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index 3aea8e62c1..14da907dfa 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -122,15 +122,15 @@ static WERROR dcesrv_winreg_CreateKey(struct dcesrv_call_state *dce_call, /* the security descriptor is optional */ if (r->in.secdesc != NULL) { DATA_BLOB sdblob; - NTSTATUS status; + enum ndr_err_code ndr_err; sdblob.data = r->in.secdesc->sd.data; sdblob.length = r->in.secdesc->sd.len; if (sdblob.data == NULL) { return WERR_INVALID_PARAM; } - status = ndr_pull_struct_blob_all(&sdblob, mem_ctx, &sd, - (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = ndr_pull_struct_blob_all(&sdblob, mem_ctx, &sd, + (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_INVALID_PARAM; } } |