summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-10-05 21:28:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:12 -0500
commit9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059 (patch)
treecfadc759a9ee08f56495b2443d192702a260ec9e /source3
parent3cc2fb5e33033089e03f9ccc4c388b213b54d10b (diff)
downloadsamba-9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059.tar.gz
samba-9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059.tar.bz2
samba-9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059.zip
r25533: remove a pstring
(This used to be commit 0f2552e20fb66b0b80006a8a7b999ccf6f54c656)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/nterr.c28
-rw-r--r--source3/torture/torture.c6
2 files changed, 5 insertions, 29 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index d88e650c9c..774e50e700 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -647,7 +647,6 @@ nt_err_code_struct nt_err_desc[] =
const char *nt_errstr(NTSTATUS nt_code)
{
- static pstring msg;
int idx = 0;
#ifdef HAVE_LDAP
@@ -656,8 +655,6 @@ const char *nt_errstr(NTSTATUS nt_code)
}
#endif
- slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
-
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
return nt_errs[idx].nt_errstr;
@@ -665,7 +662,8 @@ const char *nt_errstr(NTSTATUS nt_code)
idx++;
}
- return msg;
+ return talloc_asprintf(talloc_tos(), "NT code 0x%08x",
+ NT_STATUS_V(nt_code));
}
/************************************************************************
@@ -689,28 +687,6 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code)
}
/*****************************************************************************
- Returns an NT_STATUS constant as a string for inclusion in autogen C code.
- *****************************************************************************/
-
-const char *get_nt_error_c_code(NTSTATUS nt_code)
-{
- static pstring out;
- int idx = 0;
-
- while (nt_errs[idx].nt_errstr != NULL) {
- if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
- NT_STATUS_V(nt_code)) {
- return nt_errs[idx].nt_errstr;
- }
- idx++;
- }
-
- slprintf(out, sizeof(out), "NT_STATUS(0x%08x)", NT_STATUS_V(nt_code));
-
- return out;
-}
-
-/*****************************************************************************
Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
*****************************************************************************/
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 6d0fc546ab..e48448e5da 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4768,14 +4768,14 @@ static BOOL run_error_map_extract(int dummy) {
if (NT_STATUS_V(nt_status) != error) {
printf("/*\t{ This NT error code was 'sqashed'\n\t from %s to %s \n\t during the session setup }\n*/\n",
- get_nt_error_c_code(NT_STATUS(error)),
- get_nt_error_c_code(nt_status));
+ nt_errstr(NT_STATUS(error)),
+ nt_errstr(nt_status));
}
printf("\t{%s,\t%s,\t%s},\n",
smb_dos_err_class(errclass),
smb_dos_err_name(errclass, errnum),
- get_nt_error_c_code(NT_STATUS(error)));
+ nt_errstr(NT_STATUS(error)));
}
return True;
}