From 8875124a61c63d2def8ec193a98732f6fcfaa6a1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Sep 2004 00:55:46 +0000 Subject: r2575: Return correct error codes on old SEARCH call (from Samba4 torture tester). Jeremy. (This used to be commit fc51c97ea86bd1a86830d4ab2c6c7c4ec9fccc88) --- source3/libsmb/nterr.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index b01451ea0f..677c5d84c7 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -537,6 +537,7 @@ static nt_err_code_struct nt_errs[] = { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, + { "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES }, { NULL, NT_STATUS(0) } }; @@ -634,14 +635,15 @@ nt_err_code_struct nt_err_desc[] = { "Insufficient logon information", NT_STATUS_INSUFFICIENT_LOGON_INFO }, { "License quota exceeded", NT_STATUS_LICENSE_QUOTA_EXCEEDED }, + { "No more files", STATUS_NO_MORE_FILES }, { NULL, NT_STATUS(0) } }; - /***************************************************************************** - 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 pstring msg; @@ -669,8 +671,7 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code) int idx = 0; while (nt_err_desc[idx].nt_errstr != NULL) { - if (NT_STATUS_V(nt_err_desc[idx].nt_errcode) == NT_STATUS_V(nt_code)) - { + if (NT_STATUS_V(nt_err_desc[idx].nt_errcode) == NT_STATUS_V(nt_code)) { return nt_err_desc[idx].nt_errstr; } idx++; @@ -682,8 +683,9 @@ const char *get_friendly_nt_error_msg(NTSTATUS 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 pstring out; @@ -703,8 +705,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(char *nt_status_str) { int idx = 0; @@ -718,7 +721,6 @@ NTSTATUS nt_status_string_to_code(char *nt_status_str) return NT_STATUS_UNSUCCESSFUL; } - /** * Squash an NT_STATUS in line with security requirements. * In an attempt to avoid giving the whole game away when users -- cgit