diff options
author | Gerald Carter <jerry@samba.org> | 2000-07-03 04:24:31 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2000-07-03 04:24:31 +0000 |
commit | a04ea15f723e559db3c60bed03318cc7be851f69 (patch) | |
tree | 3b62d1b062ff1d1ee6130deed03d0e22d50e31a3 /source/libsmb/nterr.c | |
parent | d9041958558fc8e3c7b0491eb0f7e45bee9d19c5 (diff) | |
download | samba-a04ea15f723e559db3c60bed03318cc7be851f69.tar.gz samba-a04ea15f723e559db3c60bed03318cc7be851f69.tar.xz samba-a04ea15f723e559db3c60bed03318cc7be851f69.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
Diffstat (limited to 'source/libsmb/nterr.c')
-rw-r--r-- | source/libsmb/nterr.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source/libsmb/nterr.c b/source/libsmb/nterr.c index 3f19a669414..f9d717477a0 100644 --- a/source/libsmb/nterr.c +++ b/source/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; +} + + |