summaryrefslogtreecommitdiff
path: root/source3/libsmb/nterr.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-07-03 04:24:31 +0000
committerGerald Carter <jerry@samba.org>2000-07-03 04:24:31 +0000
commit098b7b378c72632d8c3df0b795ac1e4c5dbfb04a (patch)
treed9766a7c9885fd33241d67f947b419bb22984092 /source3/libsmb/nterr.c
parent877c91bfdda53d2e93f4f4148361555d6461101a (diff)
downloadsamba-098b7b378c72632d8c3df0b795ac1e4c5dbfb04a.tar.gz
samba-098b7b378c72632d8c3df0b795ac1e4c5dbfb04a.tar.bz2
samba-098b7b378c72632d8c3df0b795ac1e4c5dbfb04a.zip
first pass at merging rpcclient from TNG to HEAD. You can get a
semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. These files changed only with the addition of some support functions from TNG --jerry (This used to be commit a04ea15f723e559db3c60bed03318cc7be851f69)
Diffstat (limited to 'source3/libsmb/nterr.c')
-rw-r--r--source3/libsmb/nterr.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 3f19a66941..f9d717477a 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -519,22 +519,32 @@ nt_err_code_struct nt_errs[] =
/*****************************************************************************
returns an NT error message. not amazingly helpful, but better than a number.
*****************************************************************************/
-char *get_nt_error_msg(uint32 nt_code)
+BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len)
{
- static pstring msg;
int idx = 0;
- pstrcpy(msg, "Unknown NT error");
+ slprintf(msg, len-1, "NT code %08x", nt_code);
while (nt_errs[idx].nt_errstr != NULL)
{
if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == (nt_code & 0xFFFFFF))
{
- pstrcpy(msg, nt_errs[idx].nt_errstr);
- return msg;
+ safe_strcpy(msg, nt_errs[idx].nt_errstr, len);
+ return True;
}
idx++;
}
- return msg;
+ return False;
}
+/*****************************************************************************
+ returns an NT error message. not amazingly helpful, but better than a number.
+ *****************************************************************************/
+const char *get_nt_error_msg(uint32 nt_code)
+{
+ static pstring msg;
+ get_safe_nt_error_msg(nt_code, msg, sizeof(msg));
+ return msg;
+}
+
+