From 6e17934ee614f5f129b69898be7eceb09486a48f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 22 Mar 2006 14:41:07 +0000 Subject: r14643: Merge dcerpc_errstr from Samba 4. Might need to rework prs_dcerpc_status(). Guenther (This used to be commit 38b18f428ba941f4d9a14fa2de45cb0cd793a754) --- source3/libsmb/dcerpc_err.c | 110 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 source3/libsmb/dcerpc_err.c (limited to 'source3/libsmb/dcerpc_err.c') diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c new file mode 100644 index 0000000000..89db4aa699 --- /dev/null +++ b/source3/libsmb/dcerpc_err.c @@ -0,0 +1,110 @@ +/* + * Unix SMB/CIFS implementation. + * 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_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED }, + + { NULL, 0} +}; + +const char *dcerpc_errstr(uint32 fault_code) +{ + static pstring msg; + int idx = 0; + + slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); + + while (dcerpc_faults[idx].errstr != NULL) { + if (dcerpc_faults[idx].faultcode == fault_code) { + return dcerpc_faults[idx].errstr; + } + idx++; + } + + return msg; +} +/* + * Unix SMB/CIFS implementation. + * 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_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED }, + + { NULL, 0} +}; + +const char *dcerpc_errstr(uint32 fault_code) +{ + static pstring msg; + int idx = 0; + + slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); + + while (dcerpc_faults[idx].errstr != NULL) { + if (dcerpc_faults[idx].faultcode == fault_code) { + return dcerpc_faults[idx].errstr; + } + idx++; + } + + return msg; +} -- cgit From fb62a719dcec7f046702bbe279e0886b399115ca Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 22 Mar 2006 14:58:54 +0000 Subject: r14645: No idea how this happened, fixing the build. Guenther (This used to be commit d45b9abb0ec7d943e9fb374d64385d6c540fffe2) --- source3/libsmb/dcerpc_err.c | 55 --------------------------------------------- 1 file changed, 55 deletions(-) (limited to 'source3/libsmb/dcerpc_err.c') diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c index 89db4aa699..7121ba396d 100644 --- a/source3/libsmb/dcerpc_err.c +++ b/source3/libsmb/dcerpc_err.c @@ -53,58 +53,3 @@ const char *dcerpc_errstr(uint32 fault_code) return msg; } -/* - * Unix SMB/CIFS implementation. - * 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_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED }, - - { NULL, 0} -}; - -const char *dcerpc_errstr(uint32 fault_code) -{ - static pstring msg; - int idx = 0; - - slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); - - while (dcerpc_faults[idx].errstr != NULL) { - if (dcerpc_faults[idx].faultcode == fault_code) { - return dcerpc_faults[idx].errstr; - } - idx++; - } - - return msg; -} -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/libsmb/dcerpc_err.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/dcerpc_err.c') diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c index 7121ba396d..03e34ad191 100644 --- a/source3/libsmb/dcerpc_err.c +++ b/source3/libsmb/dcerpc_err.c @@ -4,7 +4,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, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/libsmb/dcerpc_err.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/libsmb/dcerpc_err.c') diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c index 03e34ad191..b1874b943f 100644 --- a/source3/libsmb/dcerpc_err.c +++ b/source3/libsmb/dcerpc_err.c @@ -13,8 +13,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 6069670f1bebc37527c8363a72a653e43fff7c0b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Nov 2007 15:30:01 +0100 Subject: Some pstring removal Hi! Feel free to push :-) Volker From 7fae6b3709a973bd0a5a13d3f5c880c61d5e35de Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Nov 2007 15:28:59 +0100 Subject: [PATCH] Remove some static pstrings (This used to be commit c3a66b4ee97a902c5cf43c3bb145541849a029ed) --- source3/libsmb/dcerpc_err.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/libsmb/dcerpc_err.c') diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c index b1874b943f..900b8d769f 100644 --- a/source3/libsmb/dcerpc_err.c +++ b/source3/libsmb/dcerpc_err.c @@ -38,11 +38,9 @@ static const struct dcerpc_fault_table dcerpc_faults[] = const char *dcerpc_errstr(uint32 fault_code) { - static pstring msg; + char *result; int idx = 0; - slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code); - while (dcerpc_faults[idx].errstr != NULL) { if (dcerpc_faults[idx].faultcode == fault_code) { return dcerpc_faults[idx].errstr; @@ -50,5 +48,8 @@ const char *dcerpc_errstr(uint32 fault_code) idx++; } - return msg; + result = talloc_asprintf(talloc_tos(), "DCERPC fault 0x%08x", + fault_code); + SMB_ASSERT(result != NULL); + return result; } -- cgit