From 9f4b3b103fea1f2b5f54bae79a86b1490ddc21eb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 3 Mar 2011 00:41:11 +0100 Subject: s4-nterr: some minor cosmetic edits to further match s3 nterr. Guenther --- source4/libcli/util/nterr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c index d854d7d142..cb0c081602 100644 --- a/source4/libcli/util/nterr.c +++ b/source4/libcli/util/nterr.c @@ -741,6 +741,8 @@ static const nt_err_code_struct nt_errs[] = { NULL, NT_STATUS(0) } }; +/* These need sorting..... */ + static const nt_err_code_struct nt_err_desc[] = { { N_("Success"), NT_STATUS_OK }, @@ -843,8 +845,9 @@ static const nt_err_code_struct nt_err_desc[] = }; /***************************************************************************** - returns an NT error message. not amazingly helpful, but better than a number. + Returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ + const char *nt_errstr(NTSTATUS nt_code) { static char msg[40]; @@ -871,6 +874,7 @@ const char *nt_errstr(NTSTATUS nt_code) /************************************************************************ Print friendler version fo NT error code ***********************************************************************/ + const char *get_friendly_nt_error_msg(NTSTATUS nt_code) { int idx = 0; @@ -883,12 +887,14 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code) } /* fall back to NT_STATUS_XXX string */ + return nt_errstr(nt_code); } /***************************************************************************** - returns an NT_STATUS constant as a string for inclusion in autogen C code + Returns an NT_STATUS constant as a string for inclusion in autogen C code. *****************************************************************************/ + const char *get_nt_error_c_code(NTSTATUS nt_code) { static char out[40]; @@ -908,8 +914,9 @@ const char *get_nt_error_c_code(NTSTATUS nt_code) } /***************************************************************************** - returns the NT_STATUS constant matching the string supplied (as an NTSTATUS) + Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS) *****************************************************************************/ + NTSTATUS nt_status_string_to_code(const char *nt_status_str) { int idx = 0; -- cgit