From 2aa976aeb0d7024e335951870f871f68e4595f31 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Aug 2004 07:51:10 +0000 Subject: r1874: add dcerpc_errstr() function to display a fault code by name, this should be used in the torture tests when we got NT_STATU_NET_WRITE_FAULT metze (This used to be commit 964748389bb7560ba141d71bb9256a8552c7db92) --- source4/librpc/rpc/dcerpc_error.c | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 source4/librpc/rpc/dcerpc_error.c (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c new file mode 100644 index 0000000000..d1456cad72 --- /dev/null +++ b/source4/librpc/rpc/dcerpc_error.c @@ -0,0 +1,59 @@ +/* + Unix SMB/CIFS implementation. + + dcerpc fault functions + + Copyright (C) Stefan Metzmacher 2004 + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +struct dcerpc_fault_table { + const char *errstr; + uint32_t faultcode; +}; + +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_LOGON_FAILURE", DCERPC_FAULT_LOGON_FAILURE }, + + { NULL, 0} +}; + +const char *dcerpc_errstr(uint32_t fault_code) +{ + /* TODO: remove static pstring! */ + static pstring msg; + int idx = 0; + + while (dcerpc_faults[idx].errstr != NULL) { + if (dcerpc_faults[idx].faultcode == fault_code) { + return dcerpc_faults[idx].errstr; + } + idx++; + } + + slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); + + return msg; +} -- cgit From e7f36ff1a5ec909573ef398d215608e7c9aa71fe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 30 Aug 2004 03:10:43 +0000 Subject: r2100: rework the dcerpc client side library so that it is async. We now generate a separate *_send() async function for every RPC call, and there is a single dcerpc_ndr_request_recv() call that processes the receive side of any rpc call. The caller can use dcerpc_event_context() to get a pointer to the event context for the pipe so that events can be waited for asynchronously. The only part that remains synchronous is the initial bind calls. These could also be made async if necessary, although I suspect most applications won't need them to be. (This used to be commit f5d004d8eb8c76c03342cace1976b27266cfa1f0) --- source4/librpc/rpc/dcerpc_error.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c index d1456cad72..c9434060a1 100644 --- a/source4/librpc/rpc/dcerpc_error.c +++ b/source4/librpc/rpc/dcerpc_error.c @@ -40,10 +40,8 @@ static const struct dcerpc_fault_table dcerpc_faults[] = { NULL, 0} }; -const char *dcerpc_errstr(uint32_t fault_code) +const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code) { - /* TODO: remove static pstring! */ - static pstring msg; int idx = 0; while (dcerpc_faults[idx].errstr != NULL) { @@ -53,7 +51,5 @@ const char *dcerpc_errstr(uint32_t fault_code) idx++; } - slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); - - return msg; + return talloc_asprintf(mem_ctx, "DCERPC fault 0x%08x", fault_code); } -- cgit From 6b6bb89c91d412ef7d8c355fdd005de228af62c2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 30 Apr 2005 08:17:13 +0000 Subject: r6526: Rename this RPC fault. Everybody else calls this ACCESS_DENIED, and it certainly doesn't make sense as LOGON_FAILURE. Andrew Bartlett (This used to be commit 4bec3d3f378ed8b988e00441c9bb5718b8548ba6) --- source4/librpc/rpc/dcerpc_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c index c9434060a1..d5a456c221 100644 --- a/source4/librpc/rpc/dcerpc_error.c +++ b/source4/librpc/rpc/dcerpc_error.c @@ -35,7 +35,7 @@ static const struct dcerpc_fault_table dcerpc_faults[] = { "DCERPC_FAULT_INVALID_TAG", DCERPC_FAULT_INVALID_TAG }, { "DCERPC_FAULT_CONTEXT_MISMATCH", DCERPC_FAULT_CONTEXT_MISMATCH }, { "DCERPC_FAULT_OTHER", DCERPC_FAULT_OTHER }, - { "DCERPC_FAULT_LOGON_FAILURE", DCERPC_FAULT_LOGON_FAILURE }, + { "DCERPC_FAULT_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED }, { NULL, 0} }; -- cgit From 35349a58df5b69446607fbd742a05f57f3515319 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 18 Mar 2006 15:42:57 +0000 Subject: r14542: Remove librpc, libndr and libnbt from includes.h (This used to be commit 51b4270513752d2eafbe77f9de598de16ef84a1f) --- source4/librpc/rpc/dcerpc_error.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c index d5a456c221..1b77c2d9d3 100644 --- a/source4/librpc/rpc/dcerpc_error.c +++ b/source4/librpc/rpc/dcerpc_error.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "librpc/rpc/dcerpc.h" struct dcerpc_fault_table { const char *errstr; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/librpc/rpc/dcerpc_error.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c index 1b77c2d9d3..6394f9cf26 100644 --- a/source4/librpc/rpc/dcerpc_error.c +++ b/source4/librpc/rpc/dcerpc_error.c @@ -7,7 +7,7 @@ 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 2 of the License, or + 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, @@ -16,8 +16,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/librpc/rpc/dcerpc_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/librpc/rpc/dcerpc_error.c') diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c index 6394f9cf26..6ea4563ae6 100644 --- a/source4/librpc/rpc/dcerpc_error.c +++ b/source4/librpc/rpc/dcerpc_error.c @@ -40,7 +40,7 @@ static const struct dcerpc_fault_table dcerpc_faults[] = { NULL, 0} }; -const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code) +_PUBLIC_ const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code) { int idx = 0; -- cgit