summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-01 05:52:02 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-01 05:52:02 +0000
commit02ad29785b6eea290019163a41bffc27f0eb7855 (patch)
tree96e5f5d997d759b3142e1947af1175c77cad951d
parent03aea8fc9001495d47481d988e5f4823ee4e4827 (diff)
downloadsamba-02ad29785b6eea290019163a41bffc27f0eb7855.tar.gz
samba-02ad29785b6eea290019163a41bffc27f0eb7855.tar.bz2
samba-02ad29785b6eea290019163a41bffc27f0eb7855.zip
Add a function to convert 'NT_STATUS...' strings back into their actual error
code. Andrew Bartlett (This used to be commit f0089b089b319009576bb39a076397bb44aff628)
-rw-r--r--source3/libsmb/nterr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 25286156ee..f4d64653e4 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -579,3 +579,19 @@ char *get_nt_error_c_code(NTSTATUS nt_code)
return out;
}
+
+/*****************************************************************************
+ returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
+ *****************************************************************************/
+NTSTATUS nt_status_string_to_code(char *nt_status_str)
+{
+ int idx = 0;
+
+ while (nt_errs[idx].nt_errstr != NULL) {
+ if (strcmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) {
+ return nt_errs[idx].nt_errcode;
+ }
+ idx++;
+ }
+ return NT_STATUS_UNSUCCESSFUL;
+}