summaryrefslogtreecommitdiff
path: root/source3/libsmb/nterr.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-11-25 02:35:37 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-11-25 02:35:37 +0000
commita71f3f66a1b47a70e402c4d82736f376449b923c (patch)
treef1a553543427f3bddda2f8f12babf00e10676c4a /source3/libsmb/nterr.c
parent97346ea795f43a9d9487d9c1a63af4016a72e753 (diff)
downloadsamba-a71f3f66a1b47a70e402c4d82736f376449b923c.tar.gz
samba-a71f3f66a1b47a70e402c4d82736f376449b923c.tar.bz2
samba-a71f3f66a1b47a70e402c4d82736f376449b923c.zip
Add a new torture test to extract a NT->DOS error map from an NT member of a
samba domain. The PDC must be running a special authenticaion module that spits out NT errors based on username. Andrew Bartlett (This used to be commit adc7a6048c13342b79b6228beafb5142c50f318d)
Diffstat (limited to 'source3/libsmb/nterr.c')
-rw-r--r--source3/libsmb/nterr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 238908d6cd..25286156ee 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -558,3 +558,24 @@ char *get_nt_error_msg(NTSTATUS nt_code)
return msg;
}
+
+/*****************************************************************************
+ returns an NT_STATUS constant as a string for inclusion in autogen C code
+ *****************************************************************************/
+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;
+}