summaryrefslogtreecommitdiff
path: root/source3/libsmb/nterr.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-11-09 17:30:10 +0000
committerLuke Leighton <lkcl@samba.org>1997-11-09 17:30:10 +0000
commite357d9106895b165bfa3f8331b9f186004c9a6cd (patch)
tree52e18b1e8f0770f89d157c6766745ed201df11a6 /source3/libsmb/nterr.c
parenta81dd62af0321e0c78f81ea79605dade3e563f7a (diff)
downloadsamba-e357d9106895b165bfa3f8331b9f186004c9a6cd.tar.gz
samba-e357d9106895b165bfa3f8331b9f186004c9a6cd.tar.bz2
samba-e357d9106895b165bfa3f8331b9f186004c9a6cd.zip
attempting to mark up 32 bit error codes, needed for NT domains.
separated out smb server-mode password validation into a separate file. added called and calling netbios names to client gen state: referenced section in rfc1002.txt. created workstation trust account checking code in ntclient.c there might be a bug in reply_session_setup_andX. i indented and added { } around single-line if statements: the lm password checking code now doesn't look right (around the GUEST_SESSSETUP bits). *no code semantics have been changed by the indentation process*. (This used to be commit f27966957fa7f16d337a4a58719239d036deab4c)
Diffstat (limited to 'source3/libsmb/nterr.c')
-rw-r--r--source3/libsmb/nterr.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index bda0f882a6..7dd2234e1d 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -1,12 +1,16 @@
+/* NT error codes. please read nterr.h */
+#include "includes.h"
#include "nterr.h"
-static struct
+typedef struct
{
char *nt_errstr;
uint16 nt_errcode;
-} nt_errs[] =
+} nt_err_code_struct;
+
+nt_err_code_struct nt_errs[] =
{
{ "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL },
{ "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED },
@@ -512,3 +516,25 @@ static struct
{ NULL, 0 }
};
+/*****************************************************************************
+ returns an NT error message. not amazingly helpful, but better than a number.
+ *****************************************************************************/
+char *get_nt_error_msg(uint16 nt_code)
+{
+ static pstring msg;
+ int idx = 0;
+
+ strcpy(msg, "Unknown NT error");
+
+ while (nt_errs[idx].nt_errstr != NULL)
+ {
+ if (nt_errs[idx].nt_errcode == nt_code)
+ {
+ strcpy(msg, nt_errs[idx].nt_errstr);
+ return msg;
+ }
+ idx++;
+ }
+ return NULL;
+}
+