summaryrefslogtreecommitdiff
path: root/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-20 11:29:46 +0100
committerGünther Deschner <gd@samba.org>2010-03-23 14:37:58 +0100
commit77de23384d65261e5254b42760d48588fb32ef0c (patch)
tree35f20a04beb5d894e868cad746e675c112bf209f /librpc/rpc
parent56180e3d2bd900a9790751b9647e755761e560c5 (diff)
downloadsamba-77de23384d65261e5254b42760d48588fb32ef0c.tar.gz
samba-77de23384d65261e5254b42760d48588fb32ef0c.tar.bz2
samba-77de23384d65261e5254b42760d48588fb32ef0c.zip
librpc/rpc: fix dcerpc_errstr() to handle all nca_s_* status codes and fallback to WERROR codes
metze
Diffstat (limited to 'librpc/rpc')
-rw-r--r--librpc/rpc/dcerpc_error.c62
1 files changed, 52 insertions, 10 deletions
diff --git a/librpc/rpc/dcerpc_error.c b/librpc/rpc/dcerpc_error.c
index dbab783567..7bb4f39b60 100644
--- a/librpc/rpc/dcerpc_error.c
+++ b/librpc/rpc/dcerpc_error.c
@@ -29,20 +29,62 @@ struct dcerpc_fault_table {
static const struct dcerpc_fault_table dcerpc_faults[] =
{
- { "DCERPC_FAULT_OP_RNG_ERROR", DCERPC_FAULT_OP_RNG_ERROR },
- { "DCERPC_FAULT_UNK_IF", DCERPC_FAULT_UNK_IF },
- { "DCERPC_FAULT_NDR", DCERPC_FAULT_NDR },
- { "DCERPC_FAULT_INVALID_TAG", DCERPC_FAULT_INVALID_TAG },
- { "DCERPC_FAULT_CONTEXT_MISMATCH", DCERPC_FAULT_CONTEXT_MISMATCH },
- { "DCERPC_FAULT_OTHER", DCERPC_FAULT_OTHER },
- { "DCERPC_FAULT_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED },
-
- { NULL, 0}
+#define _FAULT_STR(x) { #x , x }
+ _FAULT_STR(DERPC_NCA_S_COMM_FAILURE),
+ _FAULT_STR(DERPC_NCA_S_OP_RNG_ERROR),
+ _FAULT_STR(DERPC_NCA_S_UNKNOWN_IF),
+ _FAULT_STR(DERPC_NCA_S_WRONG_BOOT_TIME),
+ _FAULT_STR(DERPC_NCA_S_YOU_CRASHED),
+ _FAULT_STR(DERPC_NCA_S_PROTO_ERROR),
+ _FAULT_STR(DERPC_NCA_S_OUT_ARGS_TOO_BIG),
+ _FAULT_STR(DERPC_NCA_S_SERVER_TOO_BUSY),
+ _FAULT_STR(DERPC_NCA_S_FAULT_STRING_TOO_LARGE),
+ _FAULT_STR(DERPC_NCA_S_UNSUPPORTED_TYPE),
+ _FAULT_STR(DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO),
+ _FAULT_STR(DERPC_NCA_S_FAULT_ADDR_ERROR),
+ _FAULT_STR(DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO),
+ _FAULT_STR(DERPC_NCA_S_FAULT_FP_UNDERFLOW),
+ _FAULT_STR(DERPC_NCA_S_FAULT_FP_OVERRFLOW),
+ _FAULT_STR(DERPC_NCA_S_FAULT_INVALID_TAG),
+ _FAULT_STR(DERPC_NCA_S_FAULT_INVALID_BOUND),
+ _FAULT_STR(DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH),
+ _FAULT_STR(DERPC_NCA_S_FAULT_UNSPEC_REJECT),
+ _FAULT_STR(DERPC_NCA_S_FAULT_BAD_ACTID),
+ _FAULT_STR(DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED),
+ _FAULT_STR(DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED),
+ _FAULT_STR(DERPC_NCA_S_FAULT_CANCEL),
+ _FAULT_STR(DERPC_NCA_S_FAULT_ILL_INST),
+ _FAULT_STR(DERPC_NCA_S_FAULT_FP_ERROR),
+ _FAULT_STR(DERPC_NCA_S_FAULT_INT_OVERFLOW),
+ _FAULT_STR(DERPC_NCA_S_UNUSED_1C000011),
+ _FAULT_STR(DERPC_NCA_S_FAULT_UNSPEC),
+ _FAULT_STR(DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_EMPTY),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_CLOSED),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_ORDER ),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_DISCIPLINE),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_COMM_ERROR),
+ _FAULT_STR(DERPC_NCA_S_FAULT_PIPE_MEMORY),
+ _FAULT_STR(DERPC_NCA_S_FAULT_CONTEXT_MISMATCH),
+ _FAULT_STR(DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY),
+ _FAULT_STR(DERPC_NCA_S_INVALID_PRES_CONTEXT_ID),
+ _FAULT_STR(DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL),
+ _FAULT_STR(DERPC_NCA_S_UNUSED_1C00001E),
+ _FAULT_STR(DERPC_NCA_S_INVALID_CHECKSUM),
+ _FAULT_STR(DERPC_NCA_S_INVALID_CRC),
+ _FAULT_STR(DERPC_NCA_S_FAULT_USER_DEFINED),
+ _FAULT_STR(DERPC_NCA_S_FAULT_TX_OPEN_FAILED),
+ _FAULT_STR(DERPC_NCA_S_FAULT_CODESET_CONV_ERROR),
+ _FAULT_STR(DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND),
+ _FAULT_STR(DERPC_NCA_S_FAULT_NO_CLIENT_STUB),
+ _FAULT_STR(NULL),
+#undef _FAULT_STR
};
_PUBLIC_ const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code)
{
int idx = 0;
+ WERROR werr = W_ERROR(fault_code);
while (dcerpc_faults[idx].errstr != NULL) {
if (dcerpc_faults[idx].faultcode == fault_code) {
@@ -51,5 +93,5 @@ _PUBLIC_ const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code)
idx++;
}
- return talloc_asprintf(mem_ctx, "DCERPC fault 0x%08x", fault_code);
+ return win_errstr(werr);
}