From a12f04753348e6d52df1f9a2359794deacfc9007 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 24 Oct 1997 13:15:34 +0000 Subject: nterr.c : added a structure that wraps nt errors as strings and enums, so we can do a smb_nt_error() function. Makefile ntclient.c : added ntclient.c, broken out nt domain stuff into a separate file. getting fed up of compile-times and size of client.c. fixed the do_lsa_req_chal() function. made it read the response, and return the challenge credentials received from the server. next stop: do_lsa_auth_2(). client.c : removed nt domain logon functions into a separate file. pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c : i'd broken the offsets of the RPC_HDR while trying to sort out the nt client code. fixed it again. added some robustness stuff. util.c : the unistrn2() function was null-terminating the string at one character too many. (This used to be commit 39cec7f698c4461aee05cfbb213879fbd486117d) --- source3/libsmb/nterr.c | 514 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 514 insertions(+) create mode 100644 source3/libsmb/nterr.c (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c new file mode 100644 index 0000000000..bda0f882a6 --- /dev/null +++ b/source3/libsmb/nterr.c @@ -0,0 +1,514 @@ + +#include "nterr.h" + +static struct +{ + char *nt_errstr; + uint16 nt_errcode; + +} nt_errs[] = +{ + { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, + { "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED }, + { "NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS }, + { "NT_STATUS_INFO_LENGTH_MISMATCH", NT_STATUS_INFO_LENGTH_MISMATCH }, + { "NT_STATUS_ACCESS_VIOLATION", NT_STATUS_ACCESS_VIOLATION }, + { "NT_STATUS_IN_PAGE_ERROR", NT_STATUS_IN_PAGE_ERROR }, + { "NT_STATUS_PAGEFILE_QUOTA", NT_STATUS_PAGEFILE_QUOTA }, + { "NT_STATUS_INVALID_HANDLE", NT_STATUS_INVALID_HANDLE }, + { "NT_STATUS_BAD_INITIAL_STACK", NT_STATUS_BAD_INITIAL_STACK }, + { "NT_STATUS_BAD_INITIAL_PC", NT_STATUS_BAD_INITIAL_PC }, + { "NT_STATUS_INVALID_CID", NT_STATUS_INVALID_CID }, + { "NT_STATUS_TIMER_NOT_CANCELED", NT_STATUS_TIMER_NOT_CANCELED }, + { "NT_STATUS_INVALID_PARAMETER", NT_STATUS_INVALID_PARAMETER }, + { "NT_STATUS_NO_SUCH_DEVICE", NT_STATUS_NO_SUCH_DEVICE }, + { "NT_STATUS_NO_SUCH_FILE", NT_STATUS_NO_SUCH_FILE }, + { "NT_STATUS_INVALID_DEVICE_REQUEST", NT_STATUS_INVALID_DEVICE_REQUEST }, + { "NT_STATUS_END_OF_FILE", NT_STATUS_END_OF_FILE }, + { "NT_STATUS_WRONG_VOLUME", NT_STATUS_WRONG_VOLUME }, + { "NT_STATUS_NO_MEDIA_IN_DEVICE", NT_STATUS_NO_MEDIA_IN_DEVICE }, + { "NT_STATUS_UNRECOGNIZED_MEDIA", NT_STATUS_UNRECOGNIZED_MEDIA }, + { "NT_STATUS_NONEXISTENT_SECTOR", NT_STATUS_NONEXISTENT_SECTOR }, + { "NT_STATUS_MORE_PROCESSING_REQUIRED", NT_STATUS_MORE_PROCESSING_REQUIRED }, + { "NT_STATUS_NO_MEMORY", NT_STATUS_NO_MEMORY }, + { "NT_STATUS_CONFLICTING_ADDRESSES", NT_STATUS_CONFLICTING_ADDRESSES }, + { "NT_STATUS_NOT_MAPPED_VIEW", NT_STATUS_NOT_MAPPED_VIEW }, + { "NT_STATUS_UNABLE_TO_FREE_VM", NT_STATUS_UNABLE_TO_FREE_VM }, + { "NT_STATUS_UNABLE_TO_DELETE_SECTION", NT_STATUS_UNABLE_TO_DELETE_SECTION }, + { "NT_STATUS_INVALID_SYSTEM_SERVICE", NT_STATUS_INVALID_SYSTEM_SERVICE }, + { "NT_STATUS_ILLEGAL_INSTRUCTION", NT_STATUS_ILLEGAL_INSTRUCTION }, + { "NT_STATUS_INVALID_LOCK_SEQUENCE", NT_STATUS_INVALID_LOCK_SEQUENCE }, + { "NT_STATUS_INVALID_VIEW_SIZE", NT_STATUS_INVALID_VIEW_SIZE }, + { "NT_STATUS_INVALID_FILE_FOR_SECTION", NT_STATUS_INVALID_FILE_FOR_SECTION }, + { "NT_STATUS_ALREADY_COMMITTED", NT_STATUS_ALREADY_COMMITTED }, + { "NT_STATUS_ACCESS_DENIED", NT_STATUS_ACCESS_DENIED }, + { "NT_STATUS_BUFFER_TOO_SMALL", NT_STATUS_BUFFER_TOO_SMALL }, + { "NT_STATUS_OBJECT_TYPE_MISMATCH", NT_STATUS_OBJECT_TYPE_MISMATCH }, + { "NT_STATUS_NONCONTINUABLE_EXCEPTION", NT_STATUS_NONCONTINUABLE_EXCEPTION }, + { "NT_STATUS_INVALID_DISPOSITION", NT_STATUS_INVALID_DISPOSITION }, + { "NT_STATUS_UNWIND", NT_STATUS_UNWIND }, + { "NT_STATUS_BAD_STACK", NT_STATUS_BAD_STACK }, + { "NT_STATUS_INVALID_UNWIND_TARGET", NT_STATUS_INVALID_UNWIND_TARGET }, + { "NT_STATUS_NOT_LOCKED", NT_STATUS_NOT_LOCKED }, + { "NT_STATUS_PARITY_ERROR", NT_STATUS_PARITY_ERROR }, + { "NT_STATUS_UNABLE_TO_DECOMMIT_VM", NT_STATUS_UNABLE_TO_DECOMMIT_VM }, + { "NT_STATUS_NOT_COMMITTED", NT_STATUS_NOT_COMMITTED }, + { "NT_STATUS_INVALID_PORT_ATTRIBUTES", NT_STATUS_INVALID_PORT_ATTRIBUTES }, + { "NT_STATUS_PORT_MESSAGE_TOO_LONG", NT_STATUS_PORT_MESSAGE_TOO_LONG }, + { "NT_STATUS_INVALID_PARAMETER_MIX", NT_STATUS_INVALID_PARAMETER_MIX }, + { "NT_STATUS_INVALID_QUOTA_LOWER", NT_STATUS_INVALID_QUOTA_LOWER }, + { "NT_STATUS_DISK_CORRUPT_ERROR", NT_STATUS_DISK_CORRUPT_ERROR }, + { "NT_STATUS_OBJECT_NAME_INVALID", NT_STATUS_OBJECT_NAME_INVALID }, + { "NT_STATUS_OBJECT_NAME_NOT_FOUND", NT_STATUS_OBJECT_NAME_NOT_FOUND }, + { "NT_STATUS_OBJECT_NAME_COLLISION", NT_STATUS_OBJECT_NAME_COLLISION }, + { "NT_STATUS_HANDLE_NOT_WAITABLE", NT_STATUS_HANDLE_NOT_WAITABLE }, + { "NT_STATUS_PORT_DISCONNECTED", NT_STATUS_PORT_DISCONNECTED }, + { "NT_STATUS_DEVICE_ALREADY_ATTACHED", NT_STATUS_DEVICE_ALREADY_ATTACHED }, + { "NT_STATUS_OBJECT_PATH_INVALID", NT_STATUS_OBJECT_PATH_INVALID }, + { "NT_STATUS_OBJECT_PATH_NOT_FOUND", NT_STATUS_OBJECT_PATH_NOT_FOUND }, + { "NT_STATUS_OBJECT_PATH_SYNTAX_BAD", NT_STATUS_OBJECT_PATH_SYNTAX_BAD }, + { "NT_STATUS_DATA_OVERRUN", NT_STATUS_DATA_OVERRUN }, + { "NT_STATUS_DATA_LATE_ERROR", NT_STATUS_DATA_LATE_ERROR }, + { "NT_STATUS_DATA_ERROR", NT_STATUS_DATA_ERROR }, + { "NT_STATUS_CRC_ERROR", NT_STATUS_CRC_ERROR }, + { "NT_STATUS_SECTION_TOO_BIG", NT_STATUS_SECTION_TOO_BIG }, + { "NT_STATUS_PORT_CONNECTION_REFUSED", NT_STATUS_PORT_CONNECTION_REFUSED }, + { "NT_STATUS_INVALID_PORT_HANDLE", NT_STATUS_INVALID_PORT_HANDLE }, + { "NT_STATUS_SHARING_VIOLATION", NT_STATUS_SHARING_VIOLATION }, + { "NT_STATUS_QUOTA_EXCEEDED", NT_STATUS_QUOTA_EXCEEDED }, + { "NT_STATUS_INVALID_PAGE_PROTECTION", NT_STATUS_INVALID_PAGE_PROTECTION }, + { "NT_STATUS_MUTANT_NOT_OWNED", NT_STATUS_MUTANT_NOT_OWNED }, + { "NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED", NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED }, + { "NT_STATUS_PORT_ALREADY_SET", NT_STATUS_PORT_ALREADY_SET }, + { "NT_STATUS_SECTION_NOT_IMAGE", NT_STATUS_SECTION_NOT_IMAGE }, + { "NT_STATUS_SUSPEND_COUNT_EXCEEDED", NT_STATUS_SUSPEND_COUNT_EXCEEDED }, + { "NT_STATUS_THREAD_IS_TERMINATING", NT_STATUS_THREAD_IS_TERMINATING }, + { "NT_STATUS_BAD_WORKING_SET_LIMIT", NT_STATUS_BAD_WORKING_SET_LIMIT }, + { "NT_STATUS_INCOMPATIBLE_FILE_MAP", NT_STATUS_INCOMPATIBLE_FILE_MAP }, + { "NT_STATUS_SECTION_PROTECTION", NT_STATUS_SECTION_PROTECTION }, + { "NT_STATUS_EAS_NOT_SUPPORTED", NT_STATUS_EAS_NOT_SUPPORTED }, + { "NT_STATUS_EA_TOO_LARGE", NT_STATUS_EA_TOO_LARGE }, + { "NT_STATUS_NONEXISTENT_EA_ENTRY", NT_STATUS_NONEXISTENT_EA_ENTRY }, + { "NT_STATUS_NO_EAS_ON_FILE", NT_STATUS_NO_EAS_ON_FILE }, + { "NT_STATUS_EA_CORRUPT_ERROR", NT_STATUS_EA_CORRUPT_ERROR }, + { "NT_STATUS_FILE_LOCK_CONFLICT", NT_STATUS_FILE_LOCK_CONFLICT }, + { "NT_STATUS_LOCK_NOT_GRANTED", NT_STATUS_LOCK_NOT_GRANTED }, + { "NT_STATUS_DELETE_PENDING", NT_STATUS_DELETE_PENDING }, + { "NT_STATUS_CTL_FILE_NOT_SUPPORTED", NT_STATUS_CTL_FILE_NOT_SUPPORTED }, + { "NT_STATUS_UNKNOWN_REVISION", NT_STATUS_UNKNOWN_REVISION }, + { "NT_STATUS_REVISION_MISMATCH", NT_STATUS_REVISION_MISMATCH }, + { "NT_STATUS_INVALID_OWNER", NT_STATUS_INVALID_OWNER }, + { "NT_STATUS_INVALID_PRIMARY_GROUP", NT_STATUS_INVALID_PRIMARY_GROUP }, + { "NT_STATUS_NO_IMPERSONATION_TOKEN", NT_STATUS_NO_IMPERSONATION_TOKEN }, + { "NT_STATUS_CANT_DISABLE_MANDATORY", NT_STATUS_CANT_DISABLE_MANDATORY }, + { "NT_STATUS_NO_LOGON_SERVERS", NT_STATUS_NO_LOGON_SERVERS }, + { "NT_STATUS_NO_SUCH_LOGON_SESSION", NT_STATUS_NO_SUCH_LOGON_SESSION }, + { "NT_STATUS_NO_SUCH_PRIVILEGE", NT_STATUS_NO_SUCH_PRIVILEGE }, + { "NT_STATUS_PRIVILEGE_NOT_HELD", NT_STATUS_PRIVILEGE_NOT_HELD }, + { "NT_STATUS_INVALID_ACCOUNT_NAME", NT_STATUS_INVALID_ACCOUNT_NAME }, + { "NT_STATUS_USER_EXISTS", NT_STATUS_USER_EXISTS }, + { "NT_STATUS_NO_SUCH_USER", NT_STATUS_NO_SUCH_USER }, + { "NT_STATUS_GROUP_EXISTS", NT_STATUS_GROUP_EXISTS }, + { "NT_STATUS_NO_SUCH_GROUP", NT_STATUS_NO_SUCH_GROUP }, + { "NT_STATUS_MEMBER_IN_GROUP", NT_STATUS_MEMBER_IN_GROUP }, + { "NT_STATUS_MEMBER_NOT_IN_GROUP", NT_STATUS_MEMBER_NOT_IN_GROUP }, + { "NT_STATUS_LAST_ADMIN", NT_STATUS_LAST_ADMIN }, + { "NT_STATUS_WRONG_PASSWORD", NT_STATUS_WRONG_PASSWORD }, + { "NT_STATUS_ILL_FORMED_PASSWORD", NT_STATUS_ILL_FORMED_PASSWORD }, + { "NT_STATUS_PASSWORD_RESTRICTION", NT_STATUS_PASSWORD_RESTRICTION }, + { "NT_STATUS_LOGON_FAILURE", NT_STATUS_LOGON_FAILURE }, + { "NT_STATUS_ACCOUNT_RESTRICTION", NT_STATUS_ACCOUNT_RESTRICTION }, + { "NT_STATUS_INVALID_LOGON_HOURS", NT_STATUS_INVALID_LOGON_HOURS }, + { "NT_STATUS_INVALID_WORKSTATION", NT_STATUS_INVALID_WORKSTATION }, + { "NT_STATUS_PASSWORD_EXPIRED", NT_STATUS_PASSWORD_EXPIRED }, + { "NT_STATUS_ACCOUNT_DISABLED", NT_STATUS_ACCOUNT_DISABLED }, + { "NT_STATUS_NONE_MAPPED", NT_STATUS_NONE_MAPPED }, + { "NT_STATUS_TOO_MANY_LUIDS_REQUESTED", NT_STATUS_TOO_MANY_LUIDS_REQUESTED }, + { "NT_STATUS_LUIDS_EXHAUSTED", NT_STATUS_LUIDS_EXHAUSTED }, + { "NT_STATUS_INVALID_SUB_AUTHORITY", NT_STATUS_INVALID_SUB_AUTHORITY }, + { "NT_STATUS_INVALID_ACL", NT_STATUS_INVALID_ACL }, + { "NT_STATUS_INVALID_SID", NT_STATUS_INVALID_SID }, + { "NT_STATUS_INVALID_SECURITY_DESCR", NT_STATUS_INVALID_SECURITY_DESCR }, + { "NT_STATUS_PROCEDURE_NOT_FOUND", NT_STATUS_PROCEDURE_NOT_FOUND }, + { "NT_STATUS_INVALID_IMAGE_FORMAT", NT_STATUS_INVALID_IMAGE_FORMAT }, + { "NT_STATUS_NO_TOKEN", NT_STATUS_NO_TOKEN }, + { "NT_STATUS_BAD_INHERITANCE_ACL", NT_STATUS_BAD_INHERITANCE_ACL }, + { "NT_STATUS_RANGE_NOT_LOCKED", NT_STATUS_RANGE_NOT_LOCKED }, + { "NT_STATUS_DISK_FULL", NT_STATUS_DISK_FULL }, + { "NT_STATUS_SERVER_DISABLED", NT_STATUS_SERVER_DISABLED }, + { "NT_STATUS_SERVER_NOT_DISABLED", NT_STATUS_SERVER_NOT_DISABLED }, + { "NT_STATUS_TOO_MANY_GUIDS_REQUESTED", NT_STATUS_TOO_MANY_GUIDS_REQUESTED }, + { "NT_STATUS_GUIDS_EXHAUSTED", NT_STATUS_GUIDS_EXHAUSTED }, + { "NT_STATUS_INVALID_ID_AUTHORITY", NT_STATUS_INVALID_ID_AUTHORITY }, + { "NT_STATUS_AGENTS_EXHAUSTED", NT_STATUS_AGENTS_EXHAUSTED }, + { "NT_STATUS_INVALID_VOLUME_LABEL", NT_STATUS_INVALID_VOLUME_LABEL }, + { "NT_STATUS_SECTION_NOT_EXTENDED", NT_STATUS_SECTION_NOT_EXTENDED }, + { "NT_STATUS_NOT_MAPPED_DATA", NT_STATUS_NOT_MAPPED_DATA }, + { "NT_STATUS_RESOURCE_DATA_NOT_FOUND", NT_STATUS_RESOURCE_DATA_NOT_FOUND }, + { "NT_STATUS_RESOURCE_TYPE_NOT_FOUND", NT_STATUS_RESOURCE_TYPE_NOT_FOUND }, + { "NT_STATUS_RESOURCE_NAME_NOT_FOUND", NT_STATUS_RESOURCE_NAME_NOT_FOUND }, + { "NT_STATUS_ARRAY_BOUNDS_EXCEEDED", NT_STATUS_ARRAY_BOUNDS_EXCEEDED }, + { "NT_STATUS_FLOAT_DENORMAL_OPERAND", NT_STATUS_FLOAT_DENORMAL_OPERAND }, + { "NT_STATUS_FLOAT_DIVIDE_BY_ZERO", NT_STATUS_FLOAT_DIVIDE_BY_ZERO }, + { "NT_STATUS_FLOAT_INEXACT_RESULT", NT_STATUS_FLOAT_INEXACT_RESULT }, + { "NT_STATUS_FLOAT_INVALID_OPERATION", NT_STATUS_FLOAT_INVALID_OPERATION }, + { "NT_STATUS_FLOAT_OVERFLOW", NT_STATUS_FLOAT_OVERFLOW }, + { "NT_STATUS_FLOAT_STACK_CHECK", NT_STATUS_FLOAT_STACK_CHECK }, + { "NT_STATUS_FLOAT_UNDERFLOW", NT_STATUS_FLOAT_UNDERFLOW }, + { "NT_STATUS_INTEGER_DIVIDE_BY_ZERO", NT_STATUS_INTEGER_DIVIDE_BY_ZERO }, + { "NT_STATUS_INTEGER_OVERFLOW", NT_STATUS_INTEGER_OVERFLOW }, + { "NT_STATUS_PRIVILEGED_INSTRUCTION", NT_STATUS_PRIVILEGED_INSTRUCTION }, + { "NT_STATUS_TOO_MANY_PAGING_FILES", NT_STATUS_TOO_MANY_PAGING_FILES }, + { "NT_STATUS_FILE_INVALID", NT_STATUS_FILE_INVALID }, + { "NT_STATUS_ALLOTTED_SPACE_EXCEEDED", NT_STATUS_ALLOTTED_SPACE_EXCEEDED }, + { "NT_STATUS_INSUFFICIENT_RESOURCES", NT_STATUS_INSUFFICIENT_RESOURCES }, + { "NT_STATUS_DFS_EXIT_PATH_FOUND", NT_STATUS_DFS_EXIT_PATH_FOUND }, + { "NT_STATUS_DEVICE_DATA_ERROR", NT_STATUS_DEVICE_DATA_ERROR }, + { "NT_STATUS_DEVICE_NOT_CONNECTED", NT_STATUS_DEVICE_NOT_CONNECTED }, + { "NT_STATUS_DEVICE_POWER_FAILURE", NT_STATUS_DEVICE_POWER_FAILURE }, + { "NT_STATUS_FREE_VM_NOT_AT_BASE", NT_STATUS_FREE_VM_NOT_AT_BASE }, + { "NT_STATUS_MEMORY_NOT_ALLOCATED", NT_STATUS_MEMORY_NOT_ALLOCATED }, + { "NT_STATUS_WORKING_SET_QUOTA", NT_STATUS_WORKING_SET_QUOTA }, + { "NT_STATUS_MEDIA_WRITE_PROTECTED", NT_STATUS_MEDIA_WRITE_PROTECTED }, + { "NT_STATUS_DEVICE_NOT_READY", NT_STATUS_DEVICE_NOT_READY }, + { "NT_STATUS_INVALID_GROUP_ATTRIBUTES", NT_STATUS_INVALID_GROUP_ATTRIBUTES }, + { "NT_STATUS_BAD_IMPERSONATION_LEVEL", NT_STATUS_BAD_IMPERSONATION_LEVEL }, + { "NT_STATUS_CANT_OPEN_ANONYMOUS", NT_STATUS_CANT_OPEN_ANONYMOUS }, + { "NT_STATUS_BAD_VALIDATION_CLASS", NT_STATUS_BAD_VALIDATION_CLASS }, + { "NT_STATUS_BAD_TOKEN_TYPE", NT_STATUS_BAD_TOKEN_TYPE }, + { "NT_STATUS_BAD_MASTER_BOOT_RECORD", NT_STATUS_BAD_MASTER_BOOT_RECORD }, + { "NT_STATUS_INSTRUCTION_MISALIGNMENT", NT_STATUS_INSTRUCTION_MISALIGNMENT }, + { "NT_STATUS_INSTANCE_NOT_AVAILABLE", NT_STATUS_INSTANCE_NOT_AVAILABLE }, + { "NT_STATUS_PIPE_NOT_AVAILABLE", NT_STATUS_PIPE_NOT_AVAILABLE }, + { "NT_STATUS_INVALID_PIPE_STATE", NT_STATUS_INVALID_PIPE_STATE }, + { "NT_STATUS_PIPE_BUSY", NT_STATUS_PIPE_BUSY }, + { "NT_STATUS_ILLEGAL_FUNCTION", NT_STATUS_ILLEGAL_FUNCTION }, + { "NT_STATUS_PIPE_DISCONNECTED", NT_STATUS_PIPE_DISCONNECTED }, + { "NT_STATUS_PIPE_CLOSING", NT_STATUS_PIPE_CLOSING }, + { "NT_STATUS_PIPE_CONNECTED", NT_STATUS_PIPE_CONNECTED }, + { "NT_STATUS_PIPE_LISTENING", NT_STATUS_PIPE_LISTENING }, + { "NT_STATUS_INVALID_READ_MODE", NT_STATUS_INVALID_READ_MODE }, + { "NT_STATUS_IO_TIMEOUT", NT_STATUS_IO_TIMEOUT }, + { "NT_STATUS_FILE_FORCED_CLOSED", NT_STATUS_FILE_FORCED_CLOSED }, + { "NT_STATUS_PROFILING_NOT_STARTED", NT_STATUS_PROFILING_NOT_STARTED }, + { "NT_STATUS_PROFILING_NOT_STOPPED", NT_STATUS_PROFILING_NOT_STOPPED }, + { "NT_STATUS_COULD_NOT_INTERPRET", NT_STATUS_COULD_NOT_INTERPRET }, + { "NT_STATUS_FILE_IS_A_DIRECTORY", NT_STATUS_FILE_IS_A_DIRECTORY }, + { "NT_STATUS_NOT_SUPPORTED", NT_STATUS_NOT_SUPPORTED }, + { "NT_STATUS_REMOTE_NOT_LISTENING", NT_STATUS_REMOTE_NOT_LISTENING }, + { "NT_STATUS_DUPLICATE_NAME", NT_STATUS_DUPLICATE_NAME }, + { "NT_STATUS_BAD_NETWORK_PATH", NT_STATUS_BAD_NETWORK_PATH }, + { "NT_STATUS_NETWORK_BUSY", NT_STATUS_NETWORK_BUSY }, + { "NT_STATUS_DEVICE_DOES_NOT_EXIST", NT_STATUS_DEVICE_DOES_NOT_EXIST }, + { "NT_STATUS_TOO_MANY_COMMANDS", NT_STATUS_TOO_MANY_COMMANDS }, + { "NT_STATUS_ADAPTER_HARDWARE_ERROR", NT_STATUS_ADAPTER_HARDWARE_ERROR }, + { "NT_STATUS_INVALID_NETWORK_RESPONSE", NT_STATUS_INVALID_NETWORK_RESPONSE }, + { "NT_STATUS_UNEXPECTED_NETWORK_ERROR", NT_STATUS_UNEXPECTED_NETWORK_ERROR }, + { "NT_STATUS_BAD_REMOTE_ADAPTER", NT_STATUS_BAD_REMOTE_ADAPTER }, + { "NT_STATUS_PRINT_QUEUE_FULL", NT_STATUS_PRINT_QUEUE_FULL }, + { "NT_STATUS_NO_SPOOL_SPACE", NT_STATUS_NO_SPOOL_SPACE }, + { "NT_STATUS_PRINT_CANCELLED", NT_STATUS_PRINT_CANCELLED }, + { "NT_STATUS_NETWORK_NAME_DELETED", NT_STATUS_NETWORK_NAME_DELETED }, + { "NT_STATUS_NETWORK_ACCESS_DENIED", NT_STATUS_NETWORK_ACCESS_DENIED }, + { "NT_STATUS_BAD_DEVICE_TYPE", NT_STATUS_BAD_DEVICE_TYPE }, + { "NT_STATUS_BAD_NETWORK_NAME", NT_STATUS_BAD_NETWORK_NAME }, + { "NT_STATUS_TOO_MANY_NAMES", NT_STATUS_TOO_MANY_NAMES }, + { "NT_STATUS_TOO_MANY_SESSIONS", NT_STATUS_TOO_MANY_SESSIONS }, + { "NT_STATUS_SHARING_PAUSED", NT_STATUS_SHARING_PAUSED }, + { "NT_STATUS_REQUEST_NOT_ACCEPTED", NT_STATUS_REQUEST_NOT_ACCEPTED }, + { "NT_STATUS_REDIRECTOR_PAUSED", NT_STATUS_REDIRECTOR_PAUSED }, + { "NT_STATUS_NET_WRITE_FAULT", NT_STATUS_NET_WRITE_FAULT }, + { "NT_STATUS_PROFILING_AT_LIMIT", NT_STATUS_PROFILING_AT_LIMIT }, + { "NT_STATUS_NOT_SAME_DEVICE", NT_STATUS_NOT_SAME_DEVICE }, + { "NT_STATUS_FILE_RENAMED", NT_STATUS_FILE_RENAMED }, + { "NT_STATUS_VIRTUAL_CIRCUIT_CLOSED", NT_STATUS_VIRTUAL_CIRCUIT_CLOSED }, + { "NT_STATUS_NO_SECURITY_ON_OBJECT", NT_STATUS_NO_SECURITY_ON_OBJECT }, + { "NT_STATUS_CANT_WAIT", NT_STATUS_CANT_WAIT }, + { "NT_STATUS_PIPE_EMPTY", NT_STATUS_PIPE_EMPTY }, + { "NT_STATUS_CANT_ACCESS_DOMAIN_INFO", NT_STATUS_CANT_ACCESS_DOMAIN_INFO }, + { "NT_STATUS_CANT_TERMINATE_SELF", NT_STATUS_CANT_TERMINATE_SELF }, + { "NT_STATUS_INVALID_SERVER_STATE", NT_STATUS_INVALID_SERVER_STATE }, + { "NT_STATUS_INVALID_DOMAIN_STATE", NT_STATUS_INVALID_DOMAIN_STATE }, + { "NT_STATUS_INVALID_DOMAIN_ROLE", NT_STATUS_INVALID_DOMAIN_ROLE }, + { "NT_STATUS_NO_SUCH_DOMAIN", NT_STATUS_NO_SUCH_DOMAIN }, + { "NT_STATUS_DOMAIN_EXISTS", NT_STATUS_DOMAIN_EXISTS }, + { "NT_STATUS_DOMAIN_LIMIT_EXCEEDED", NT_STATUS_DOMAIN_LIMIT_EXCEEDED }, + { "NT_STATUS_OPLOCK_NOT_GRANTED", NT_STATUS_OPLOCK_NOT_GRANTED }, + { "NT_STATUS_INVALID_OPLOCK_PROTOCOL", NT_STATUS_INVALID_OPLOCK_PROTOCOL }, + { "NT_STATUS_INTERNAL_DB_CORRUPTION", NT_STATUS_INTERNAL_DB_CORRUPTION }, + { "NT_STATUS_INTERNAL_ERROR", NT_STATUS_INTERNAL_ERROR }, + { "NT_STATUS_GENERIC_NOT_MAPPED", NT_STATUS_GENERIC_NOT_MAPPED }, + { "NT_STATUS_BAD_DESCRIPTOR_FORMAT", NT_STATUS_BAD_DESCRIPTOR_FORMAT }, + { "NT_STATUS_INVALID_USER_BUFFER", NT_STATUS_INVALID_USER_BUFFER }, + { "NT_STATUS_UNEXPECTED_IO_ERROR", NT_STATUS_UNEXPECTED_IO_ERROR }, + { "NT_STATUS_UNEXPECTED_MM_CREATE_ERR", NT_STATUS_UNEXPECTED_MM_CREATE_ERR }, + { "NT_STATUS_UNEXPECTED_MM_MAP_ERROR", NT_STATUS_UNEXPECTED_MM_MAP_ERROR }, + { "NT_STATUS_UNEXPECTED_MM_EXTEND_ERR", NT_STATUS_UNEXPECTED_MM_EXTEND_ERR }, + { "NT_STATUS_NOT_LOGON_PROCESS", NT_STATUS_NOT_LOGON_PROCESS }, + { "NT_STATUS_LOGON_SESSION_EXISTS", NT_STATUS_LOGON_SESSION_EXISTS }, + { "NT_STATUS_INVALID_PARAMETER_1", NT_STATUS_INVALID_PARAMETER_1 }, + { "NT_STATUS_INVALID_PARAMETER_2", NT_STATUS_INVALID_PARAMETER_2 }, + { "NT_STATUS_INVALID_PARAMETER_3", NT_STATUS_INVALID_PARAMETER_3 }, + { "NT_STATUS_INVALID_PARAMETER_4", NT_STATUS_INVALID_PARAMETER_4 }, + { "NT_STATUS_INVALID_PARAMETER_5", NT_STATUS_INVALID_PARAMETER_5 }, + { "NT_STATUS_INVALID_PARAMETER_6", NT_STATUS_INVALID_PARAMETER_6 }, + { "NT_STATUS_INVALID_PARAMETER_7", NT_STATUS_INVALID_PARAMETER_7 }, + { "NT_STATUS_INVALID_PARAMETER_8", NT_STATUS_INVALID_PARAMETER_8 }, + { "NT_STATUS_INVALID_PARAMETER_9", NT_STATUS_INVALID_PARAMETER_9 }, + { "NT_STATUS_INVALID_PARAMETER_10", NT_STATUS_INVALID_PARAMETER_10 }, + { "NT_STATUS_INVALID_PARAMETER_11", NT_STATUS_INVALID_PARAMETER_11 }, + { "NT_STATUS_INVALID_PARAMETER_12", NT_STATUS_INVALID_PARAMETER_12 }, + { "NT_STATUS_REDIRECTOR_NOT_STARTED", NT_STATUS_REDIRECTOR_NOT_STARTED }, + { "NT_STATUS_REDIRECTOR_STARTED", NT_STATUS_REDIRECTOR_STARTED }, + { "NT_STATUS_STACK_OVERFLOW", NT_STATUS_STACK_OVERFLOW }, + { "NT_STATUS_NO_SUCH_PACKAGE", NT_STATUS_NO_SUCH_PACKAGE }, + { "NT_STATUS_BAD_FUNCTION_TABLE", NT_STATUS_BAD_FUNCTION_TABLE }, + { "NT_STATUS_DIRECTORY_NOT_EMPTY", NT_STATUS_DIRECTORY_NOT_EMPTY }, + { "NT_STATUS_FILE_CORRUPT_ERROR", NT_STATUS_FILE_CORRUPT_ERROR }, + { "NT_STATUS_NOT_A_DIRECTORY", NT_STATUS_NOT_A_DIRECTORY }, + { "NT_STATUS_BAD_LOGON_SESSION_STATE", NT_STATUS_BAD_LOGON_SESSION_STATE }, + { "NT_STATUS_LOGON_SESSION_COLLISION", NT_STATUS_LOGON_SESSION_COLLISION }, + { "NT_STATUS_NAME_TOO_LONG", NT_STATUS_NAME_TOO_LONG }, + { "NT_STATUS_FILES_OPEN", NT_STATUS_FILES_OPEN }, + { "NT_STATUS_CONNECTION_IN_USE", NT_STATUS_CONNECTION_IN_USE }, + { "NT_STATUS_MESSAGE_NOT_FOUND", NT_STATUS_MESSAGE_NOT_FOUND }, + { "NT_STATUS_PROCESS_IS_TERMINATING", NT_STATUS_PROCESS_IS_TERMINATING }, + { "NT_STATUS_INVALID_LOGON_TYPE", NT_STATUS_INVALID_LOGON_TYPE }, + { "NT_STATUS_NO_GUID_TRANSLATION", NT_STATUS_NO_GUID_TRANSLATION }, + { "NT_STATUS_CANNOT_IMPERSONATE", NT_STATUS_CANNOT_IMPERSONATE }, + { "NT_STATUS_IMAGE_ALREADY_LOADED", NT_STATUS_IMAGE_ALREADY_LOADED }, + { "NT_STATUS_ABIOS_NOT_PRESENT", NT_STATUS_ABIOS_NOT_PRESENT }, + { "NT_STATUS_ABIOS_LID_NOT_EXIST", NT_STATUS_ABIOS_LID_NOT_EXIST }, + { "NT_STATUS_ABIOS_LID_ALREADY_OWNED", NT_STATUS_ABIOS_LID_ALREADY_OWNED }, + { "NT_STATUS_ABIOS_NOT_LID_OWNER", NT_STATUS_ABIOS_NOT_LID_OWNER }, + { "NT_STATUS_ABIOS_INVALID_COMMAND", NT_STATUS_ABIOS_INVALID_COMMAND }, + { "NT_STATUS_ABIOS_INVALID_LID", NT_STATUS_ABIOS_INVALID_LID }, + { "NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE", NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE }, + { "NT_STATUS_ABIOS_INVALID_SELECTOR", NT_STATUS_ABIOS_INVALID_SELECTOR }, + { "NT_STATUS_NO_LDT", NT_STATUS_NO_LDT }, + { "NT_STATUS_INVALID_LDT_SIZE", NT_STATUS_INVALID_LDT_SIZE }, + { "NT_STATUS_INVALID_LDT_OFFSET", NT_STATUS_INVALID_LDT_OFFSET }, + { "NT_STATUS_INVALID_LDT_DESCRIPTOR", NT_STATUS_INVALID_LDT_DESCRIPTOR }, + { "NT_STATUS_INVALID_IMAGE_NE_FORMAT", NT_STATUS_INVALID_IMAGE_NE_FORMAT }, + { "NT_STATUS_RXACT_INVALID_STATE", NT_STATUS_RXACT_INVALID_STATE }, + { "NT_STATUS_RXACT_COMMIT_FAILURE", NT_STATUS_RXACT_COMMIT_FAILURE }, + { "NT_STATUS_MAPPED_FILE_SIZE_ZERO", NT_STATUS_MAPPED_FILE_SIZE_ZERO }, + { "NT_STATUS_TOO_MANY_OPENED_FILES", NT_STATUS_TOO_MANY_OPENED_FILES }, + { "NT_STATUS_CANCELLED", NT_STATUS_CANCELLED }, + { "NT_STATUS_CANNOT_DELETE", NT_STATUS_CANNOT_DELETE }, + { "NT_STATUS_INVALID_COMPUTER_NAME", NT_STATUS_INVALID_COMPUTER_NAME }, + { "NT_STATUS_FILE_DELETED", NT_STATUS_FILE_DELETED }, + { "NT_STATUS_SPECIAL_ACCOUNT", NT_STATUS_SPECIAL_ACCOUNT }, + { "NT_STATUS_SPECIAL_GROUP", NT_STATUS_SPECIAL_GROUP }, + { "NT_STATUS_SPECIAL_USER", NT_STATUS_SPECIAL_USER }, + { "NT_STATUS_MEMBERS_PRIMARY_GROUP", NT_STATUS_MEMBERS_PRIMARY_GROUP }, + { "NT_STATUS_FILE_CLOSED", NT_STATUS_FILE_CLOSED }, + { "NT_STATUS_TOO_MANY_THREADS", NT_STATUS_TOO_MANY_THREADS }, + { "NT_STATUS_THREAD_NOT_IN_PROCESS", NT_STATUS_THREAD_NOT_IN_PROCESS }, + { "NT_STATUS_TOKEN_ALREADY_IN_USE", NT_STATUS_TOKEN_ALREADY_IN_USE }, + { "NT_STATUS_PAGEFILE_QUOTA_EXCEEDED", NT_STATUS_PAGEFILE_QUOTA_EXCEEDED }, + { "NT_STATUS_COMMITMENT_LIMIT", NT_STATUS_COMMITMENT_LIMIT }, + { "NT_STATUS_INVALID_IMAGE_LE_FORMAT", NT_STATUS_INVALID_IMAGE_LE_FORMAT }, + { "NT_STATUS_INVALID_IMAGE_NOT_MZ", NT_STATUS_INVALID_IMAGE_NOT_MZ }, + { "NT_STATUS_INVALID_IMAGE_PROTECT", NT_STATUS_INVALID_IMAGE_PROTECT }, + { "NT_STATUS_INVALID_IMAGE_WIN_16", NT_STATUS_INVALID_IMAGE_WIN_16 }, + { "NT_STATUS_LOGON_SERVER_CONFLICT", NT_STATUS_LOGON_SERVER_CONFLICT }, + { "NT_STATUS_TIME_DIFFERENCE_AT_DC", NT_STATUS_TIME_DIFFERENCE_AT_DC }, + { "NT_STATUS_SYNCHRONIZATION_REQUIRED", NT_STATUS_SYNCHRONIZATION_REQUIRED }, + { "NT_STATUS_DLL_NOT_FOUND", NT_STATUS_DLL_NOT_FOUND }, + { "NT_STATUS_OPEN_FAILED", NT_STATUS_OPEN_FAILED }, + { "NT_STATUS_IO_PRIVILEGE_FAILED", NT_STATUS_IO_PRIVILEGE_FAILED }, + { "NT_STATUS_ORDINAL_NOT_FOUND", NT_STATUS_ORDINAL_NOT_FOUND }, + { "NT_STATUS_ENTRYPOINT_NOT_FOUND", NT_STATUS_ENTRYPOINT_NOT_FOUND }, + { "NT_STATUS_CONTROL_C_EXIT", NT_STATUS_CONTROL_C_EXIT }, + { "NT_STATUS_LOCAL_DISCONNECT", NT_STATUS_LOCAL_DISCONNECT }, + { "NT_STATUS_REMOTE_DISCONNECT", NT_STATUS_REMOTE_DISCONNECT }, + { "NT_STATUS_REMOTE_RESOURCES", NT_STATUS_REMOTE_RESOURCES }, + { "NT_STATUS_LINK_FAILED", NT_STATUS_LINK_FAILED }, + { "NT_STATUS_LINK_TIMEOUT", NT_STATUS_LINK_TIMEOUT }, + { "NT_STATUS_INVALID_CONNECTION", NT_STATUS_INVALID_CONNECTION }, + { "NT_STATUS_INVALID_ADDRESS", NT_STATUS_INVALID_ADDRESS }, + { "NT_STATUS_DLL_INIT_FAILED", NT_STATUS_DLL_INIT_FAILED }, + { "NT_STATUS_MISSING_SYSTEMFILE", NT_STATUS_MISSING_SYSTEMFILE }, + { "NT_STATUS_UNHANDLED_EXCEPTION", NT_STATUS_UNHANDLED_EXCEPTION }, + { "NT_STATUS_APP_INIT_FAILURE", NT_STATUS_APP_INIT_FAILURE }, + { "NT_STATUS_PAGEFILE_CREATE_FAILED", NT_STATUS_PAGEFILE_CREATE_FAILED }, + { "NT_STATUS_NO_PAGEFILE", NT_STATUS_NO_PAGEFILE }, + { "NT_STATUS_INVALID_LEVEL", NT_STATUS_INVALID_LEVEL }, + { "NT_STATUS_WRONG_PASSWORD_CORE", NT_STATUS_WRONG_PASSWORD_CORE }, + { "NT_STATUS_ILLEGAL_FLOAT_CONTEXT", NT_STATUS_ILLEGAL_FLOAT_CONTEXT }, + { "NT_STATUS_PIPE_BROKEN", NT_STATUS_PIPE_BROKEN }, + { "NT_STATUS_REGISTRY_CORRUPT", NT_STATUS_REGISTRY_CORRUPT }, + { "NT_STATUS_REGISTRY_IO_FAILED", NT_STATUS_REGISTRY_IO_FAILED }, + { "NT_STATUS_NO_EVENT_PAIR", NT_STATUS_NO_EVENT_PAIR }, + { "NT_STATUS_UNRECOGNIZED_VOLUME", NT_STATUS_UNRECOGNIZED_VOLUME }, + { "NT_STATUS_SERIAL_NO_DEVICE_INITED", NT_STATUS_SERIAL_NO_DEVICE_INITED }, + { "NT_STATUS_NO_SUCH_ALIAS", NT_STATUS_NO_SUCH_ALIAS }, + { "NT_STATUS_MEMBER_NOT_IN_ALIAS", NT_STATUS_MEMBER_NOT_IN_ALIAS }, + { "NT_STATUS_MEMBER_IN_ALIAS", NT_STATUS_MEMBER_IN_ALIAS }, + { "NT_STATUS_ALIAS_EXISTS", NT_STATUS_ALIAS_EXISTS }, + { "NT_STATUS_LOGON_NOT_GRANTED", NT_STATUS_LOGON_NOT_GRANTED }, + { "NT_STATUS_TOO_MANY_SECRETS", NT_STATUS_TOO_MANY_SECRETS }, + { "NT_STATUS_SECRET_TOO_LONG", NT_STATUS_SECRET_TOO_LONG }, + { "NT_STATUS_INTERNAL_DB_ERROR", NT_STATUS_INTERNAL_DB_ERROR }, + { "NT_STATUS_FULLSCREEN_MODE", NT_STATUS_FULLSCREEN_MODE }, + { "NT_STATUS_TOO_MANY_CONTEXT_IDS", NT_STATUS_TOO_MANY_CONTEXT_IDS }, + { "NT_STATUS_LOGON_TYPE_NOT_GRANTED", NT_STATUS_LOGON_TYPE_NOT_GRANTED }, + { "NT_STATUS_NOT_REGISTRY_FILE", NT_STATUS_NOT_REGISTRY_FILE }, + { "NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED", NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED }, + { "NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR", NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR }, + { "NT_STATUS_FT_MISSING_MEMBER", NT_STATUS_FT_MISSING_MEMBER }, + { "NT_STATUS_ILL_FORMED_SERVICE_ENTRY", NT_STATUS_ILL_FORMED_SERVICE_ENTRY }, + { "NT_STATUS_ILLEGAL_CHARACTER", NT_STATUS_ILLEGAL_CHARACTER }, + { "NT_STATUS_UNMAPPABLE_CHARACTER", NT_STATUS_UNMAPPABLE_CHARACTER }, + { "NT_STATUS_UNDEFINED_CHARACTER", NT_STATUS_UNDEFINED_CHARACTER }, + { "NT_STATUS_FLOPPY_VOLUME", NT_STATUS_FLOPPY_VOLUME }, + { "NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND", NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND }, + { "NT_STATUS_FLOPPY_WRONG_CYLINDER", NT_STATUS_FLOPPY_WRONG_CYLINDER }, + { "NT_STATUS_FLOPPY_UNKNOWN_ERROR", NT_STATUS_FLOPPY_UNKNOWN_ERROR }, + { "NT_STATUS_FLOPPY_BAD_REGISTERS", NT_STATUS_FLOPPY_BAD_REGISTERS }, + { "NT_STATUS_DISK_RECALIBRATE_FAILED", NT_STATUS_DISK_RECALIBRATE_FAILED }, + { "NT_STATUS_DISK_OPERATION_FAILED", NT_STATUS_DISK_OPERATION_FAILED }, + { "NT_STATUS_DISK_RESET_FAILED", NT_STATUS_DISK_RESET_FAILED }, + { "NT_STATUS_SHARED_IRQ_BUSY", NT_STATUS_SHARED_IRQ_BUSY }, + { "NT_STATUS_FT_ORPHANING", NT_STATUS_FT_ORPHANING }, + { "NT_STATUS_PARTITION_FAILURE", NT_STATUS_PARTITION_FAILURE }, + { "NT_STATUS_INVALID_BLOCK_LENGTH", NT_STATUS_INVALID_BLOCK_LENGTH }, + { "NT_STATUS_DEVICE_NOT_PARTITIONED", NT_STATUS_DEVICE_NOT_PARTITIONED }, + { "NT_STATUS_UNABLE_TO_LOCK_MEDIA", NT_STATUS_UNABLE_TO_LOCK_MEDIA }, + { "NT_STATUS_UNABLE_TO_UNLOAD_MEDIA", NT_STATUS_UNABLE_TO_UNLOAD_MEDIA }, + { "NT_STATUS_EOM_OVERFLOW", NT_STATUS_EOM_OVERFLOW }, + { "NT_STATUS_NO_MEDIA", NT_STATUS_NO_MEDIA }, + { "NT_STATUS_NO_SUCH_MEMBER", NT_STATUS_NO_SUCH_MEMBER }, + { "NT_STATUS_INVALID_MEMBER", NT_STATUS_INVALID_MEMBER }, + { "NT_STATUS_KEY_DELETED", NT_STATUS_KEY_DELETED }, + { "NT_STATUS_NO_LOG_SPACE", NT_STATUS_NO_LOG_SPACE }, + { "NT_STATUS_TOO_MANY_SIDS", NT_STATUS_TOO_MANY_SIDS }, + { "NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED", NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED }, + { "NT_STATUS_KEY_HAS_CHILDREN", NT_STATUS_KEY_HAS_CHILDREN }, + { "NT_STATUS_CHILD_MUST_BE_VOLATILE", NT_STATUS_CHILD_MUST_BE_VOLATILE }, + { "NT_STATUS_DEVICE_CONFIGURATION_ERROR", NT_STATUS_DEVICE_CONFIGURATION_ERROR }, + { "NT_STATUS_DRIVER_INTERNAL_ERROR", NT_STATUS_DRIVER_INTERNAL_ERROR }, + { "NT_STATUS_INVALID_DEVICE_STATE", NT_STATUS_INVALID_DEVICE_STATE }, + { "NT_STATUS_IO_DEVICE_ERROR", NT_STATUS_IO_DEVICE_ERROR }, + { "NT_STATUS_DEVICE_PROTOCOL_ERROR", NT_STATUS_DEVICE_PROTOCOL_ERROR }, + { "NT_STATUS_BACKUP_CONTROLLER", NT_STATUS_BACKUP_CONTROLLER }, + { "NT_STATUS_LOG_FILE_FULL", NT_STATUS_LOG_FILE_FULL }, + { "NT_STATUS_TOO_LATE", NT_STATUS_TOO_LATE }, + { "NT_STATUS_NO_TRUST_LSA_SECRET", NT_STATUS_NO_TRUST_LSA_SECRET }, + { "NT_STATUS_NO_TRUST_SAM_ACCOUNT", NT_STATUS_NO_TRUST_SAM_ACCOUNT }, + { "NT_STATUS_TRUSTED_DOMAIN_FAILURE", NT_STATUS_TRUSTED_DOMAIN_FAILURE }, + { "NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE", NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE }, + { "NT_STATUS_EVENTLOG_FILE_CORRUPT", NT_STATUS_EVENTLOG_FILE_CORRUPT }, + { "NT_STATUS_EVENTLOG_CANT_START", NT_STATUS_EVENTLOG_CANT_START }, + { "NT_STATUS_TRUST_FAILURE", NT_STATUS_TRUST_FAILURE }, + { "NT_STATUS_MUTANT_LIMIT_EXCEEDED", NT_STATUS_MUTANT_LIMIT_EXCEEDED }, + { "NT_STATUS_NETLOGON_NOT_STARTED", NT_STATUS_NETLOGON_NOT_STARTED }, + { "NT_STATUS_ACCOUNT_EXPIRED", NT_STATUS_ACCOUNT_EXPIRED }, + { "NT_STATUS_POSSIBLE_DEADLOCK", NT_STATUS_POSSIBLE_DEADLOCK }, + { "NT_STATUS_NETWORK_CREDENTIAL_CONFLICT", NT_STATUS_NETWORK_CREDENTIAL_CONFLICT }, + { "NT_STATUS_REMOTE_SESSION_LIMIT", NT_STATUS_REMOTE_SESSION_LIMIT }, + { "NT_STATUS_EVENTLOG_FILE_CHANGED", NT_STATUS_EVENTLOG_FILE_CHANGED }, + { "NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT", NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT }, + { "NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT", NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT }, + { "NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT", NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT }, + { "NT_STATUS_DOMAIN_TRUST_INCONSISTENT", NT_STATUS_DOMAIN_TRUST_INCONSISTENT }, + { "NT_STATUS_FS_DRIVER_REQUIRED", NT_STATUS_FS_DRIVER_REQUIRED }, + { "NT_STATUS_NO_USER_SESSION_KEY", NT_STATUS_NO_USER_SESSION_KEY }, + { "NT_STATUS_USER_SESSION_DELETED", NT_STATUS_USER_SESSION_DELETED }, + { "NT_STATUS_RESOURCE_LANG_NOT_FOUND", NT_STATUS_RESOURCE_LANG_NOT_FOUND }, + { "NT_STATUS_INSUFF_SERVER_RESOURCES", NT_STATUS_INSUFF_SERVER_RESOURCES }, + { "NT_STATUS_INVALID_BUFFER_SIZE", NT_STATUS_INVALID_BUFFER_SIZE }, + { "NT_STATUS_INVALID_ADDRESS_COMPONENT", NT_STATUS_INVALID_ADDRESS_COMPONENT }, + { "NT_STATUS_INVALID_ADDRESS_WILDCARD", NT_STATUS_INVALID_ADDRESS_WILDCARD }, + { "NT_STATUS_TOO_MANY_ADDRESSES", NT_STATUS_TOO_MANY_ADDRESSES }, + { "NT_STATUS_ADDRESS_ALREADY_EXISTS", NT_STATUS_ADDRESS_ALREADY_EXISTS }, + { "NT_STATUS_ADDRESS_CLOSED", NT_STATUS_ADDRESS_CLOSED }, + { "NT_STATUS_CONNECTION_DISCONNECTED", NT_STATUS_CONNECTION_DISCONNECTED }, + { "NT_STATUS_CONNECTION_RESET", NT_STATUS_CONNECTION_RESET }, + { "NT_STATUS_TOO_MANY_NODES", NT_STATUS_TOO_MANY_NODES }, + { "NT_STATUS_TRANSACTION_ABORTED", NT_STATUS_TRANSACTION_ABORTED }, + { "NT_STATUS_TRANSACTION_TIMED_OUT", NT_STATUS_TRANSACTION_TIMED_OUT }, + { "NT_STATUS_TRANSACTION_NO_RELEASE", NT_STATUS_TRANSACTION_NO_RELEASE }, + { "NT_STATUS_TRANSACTION_NO_MATCH", NT_STATUS_TRANSACTION_NO_MATCH }, + { "NT_STATUS_TRANSACTION_RESPONDED", NT_STATUS_TRANSACTION_RESPONDED }, + { "NT_STATUS_TRANSACTION_INVALID_ID", NT_STATUS_TRANSACTION_INVALID_ID }, + { "NT_STATUS_TRANSACTION_INVALID_TYPE", NT_STATUS_TRANSACTION_INVALID_TYPE }, + { "NT_STATUS_NOT_SERVER_SESSION", NT_STATUS_NOT_SERVER_SESSION }, + { "NT_STATUS_NOT_CLIENT_SESSION", NT_STATUS_NOT_CLIENT_SESSION }, + { "NT_STATUS_CANNOT_LOAD_REGISTRY_FILE", NT_STATUS_CANNOT_LOAD_REGISTRY_FILE }, + { "NT_STATUS_DEBUG_ATTACH_FAILED", NT_STATUS_DEBUG_ATTACH_FAILED }, + { "NT_STATUS_SYSTEM_PROCESS_TERMINATED", NT_STATUS_SYSTEM_PROCESS_TERMINATED }, + { "NT_STATUS_DATA_NOT_ACCEPTED", NT_STATUS_DATA_NOT_ACCEPTED }, + { "NT_STATUS_NO_BROWSER_SERVERS_FOUND", NT_STATUS_NO_BROWSER_SERVERS_FOUND }, + { "NT_STATUS_VDM_HARD_ERROR", NT_STATUS_VDM_HARD_ERROR }, + { "NT_STATUS_DRIVER_CANCEL_TIMEOUT", NT_STATUS_DRIVER_CANCEL_TIMEOUT }, + { "NT_STATUS_REPLY_MESSAGE_MISMATCH", NT_STATUS_REPLY_MESSAGE_MISMATCH }, + { "NT_STATUS_MAPPED_ALIGNMENT", NT_STATUS_MAPPED_ALIGNMENT }, + { "NT_STATUS_IMAGE_CHECKSUM_MISMATCH", NT_STATUS_IMAGE_CHECKSUM_MISMATCH }, + { "NT_STATUS_LOST_WRITEBEHIND_DATA", NT_STATUS_LOST_WRITEBEHIND_DATA }, + { "NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID", NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID }, + { "NT_STATUS_PASSWORD_MUST_CHANGE", NT_STATUS_PASSWORD_MUST_CHANGE }, + { "NT_STATUS_NOT_FOUND", NT_STATUS_NOT_FOUND }, + { "NT_STATUS_NOT_TINY_STREAM", NT_STATUS_NOT_TINY_STREAM }, + { "NT_STATUS_RECOVERY_FAILURE", NT_STATUS_RECOVERY_FAILURE }, + { "NT_STATUS_STACK_OVERFLOW_READ", NT_STATUS_STACK_OVERFLOW_READ }, + { "NT_STATUS_FAIL_CHECK", NT_STATUS_FAIL_CHECK }, + { "NT_STATUS_DUPLICATE_OBJECTID", NT_STATUS_DUPLICATE_OBJECTID }, + { "NT_STATUS_OBJECTID_EXISTS", NT_STATUS_OBJECTID_EXISTS }, + { "NT_STATUS_CONVERT_TO_LARGE", NT_STATUS_CONVERT_TO_LARGE }, + { "NT_STATUS_RETRY", NT_STATUS_RETRY }, + { "NT_STATUS_FOUND_OUT_OF_SCOPE", NT_STATUS_FOUND_OUT_OF_SCOPE }, + { "NT_STATUS_ALLOCATE_BUCKET", NT_STATUS_ALLOCATE_BUCKET }, + { "NT_STATUS_PROPSET_NOT_FOUND", NT_STATUS_PROPSET_NOT_FOUND }, + { "NT_STATUS_MARSHALL_OVERFLOW", NT_STATUS_MARSHALL_OVERFLOW }, + { "NT_STATUS_INVALID_VARIANT", NT_STATUS_INVALID_VARIANT }, + { "NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, + { "NT_STATUS_ACCOUNT_LOCKED_OUT", NT_STATUS_ACCOUNT_LOCKED_OUT }, + { "NT_STATUS_HANDLE_NOT_CLOSABLE", NT_STATUS_HANDLE_NOT_CLOSABLE }, + { "NT_STATUS_CONNECTION_REFUSED", NT_STATUS_CONNECTION_REFUSED }, + { "NT_STATUS_GRACEFUL_DISCONNECT", NT_STATUS_GRACEFUL_DISCONNECT }, + { "NT_STATUS_ADDRESS_ALREADY_ASSOCIATED", NT_STATUS_ADDRESS_ALREADY_ASSOCIATED }, + { "NT_STATUS_ADDRESS_NOT_ASSOCIATED", NT_STATUS_ADDRESS_NOT_ASSOCIATED }, + { "NT_STATUS_CONNECTION_INVALID", NT_STATUS_CONNECTION_INVALID }, + { "NT_STATUS_CONNECTION_ACTIVE", NT_STATUS_CONNECTION_ACTIVE }, + { "NT_STATUS_NETWORK_UNREACHABLE", NT_STATUS_NETWORK_UNREACHABLE }, + { "NT_STATUS_HOST_UNREACHABLE", NT_STATUS_HOST_UNREACHABLE }, + { "NT_STATUS_PROTOCOL_UNREACHABLE", NT_STATUS_PROTOCOL_UNREACHABLE }, + { "NT_STATUS_PORT_UNREACHABLE", NT_STATUS_PORT_UNREACHABLE }, + { "NT_STATUS_REQUEST_ABORTED", NT_STATUS_REQUEST_ABORTED }, + { "NT_STATUS_CONNECTION_ABORTED", NT_STATUS_CONNECTION_ABORTED }, + { "NT_STATUS_BAD_COMPRESSION_BUFFER", NT_STATUS_BAD_COMPRESSION_BUFFER }, + { "NT_STATUS_USER_MAPPED_FILE", NT_STATUS_USER_MAPPED_FILE }, + { "NT_STATUS_AUDIT_FAILED", NT_STATUS_AUDIT_FAILED }, + { "NT_STATUS_TIMER_RESOLUTION_NOT_SET", NT_STATUS_TIMER_RESOLUTION_NOT_SET }, + { "NT_STATUS_CONNECTION_COUNT_LIMIT", NT_STATUS_CONNECTION_COUNT_LIMIT }, + { "NT_STATUS_LOGIN_TIME_RESTRICTION", NT_STATUS_LOGIN_TIME_RESTRICTION }, + { "NT_STATUS_LOGIN_WKSTA_RESTRICTION", NT_STATUS_LOGIN_WKSTA_RESTRICTION }, + { "NT_STATUS_IMAGE_MP_UP_MISMATCH", NT_STATUS_IMAGE_MP_UP_MISMATCH }, + { "NT_STATUS_INSUFFICIENT_LOGON_INFO", NT_STATUS_INSUFFICIENT_LOGON_INFO }, + { "NT_STATUS_BAD_DLL_ENTRYPOINT", NT_STATUS_BAD_DLL_ENTRYPOINT }, + { "NT_STATUS_BAD_SERVICE_ENTRYPOINT", NT_STATUS_BAD_SERVICE_ENTRYPOINT }, + { "NT_STATUS_LPC_REPLY_LOST", NT_STATUS_LPC_REPLY_LOST }, + { "NT_STATUS_IP_ADDRESS_CONFLICT1", NT_STATUS_IP_ADDRESS_CONFLICT1 }, + { "NT_STATUS_IP_ADDRESS_CONFLICT2", NT_STATUS_IP_ADDRESS_CONFLICT2 }, + { "NT_STATUS_REGISTRY_QUOTA_LIMIT", NT_STATUS_REGISTRY_QUOTA_LIMIT }, + { "NT_STATUS_PATH_NOT_COVERED", NT_STATUS_PATH_NOT_COVERED }, + { "NT_STATUS_NO_CALLBACK_ACTIVE", NT_STATUS_NO_CALLBACK_ACTIVE }, + { "NT_STATUS_LICENSE_QUOTA_EXCEEDED", NT_STATUS_LICENSE_QUOTA_EXCEEDED }, + { "NT_STATUS_PWD_TOO_SHORT", NT_STATUS_PWD_TOO_SHORT }, + { "NT_STATUS_PWD_TOO_RECENT", NT_STATUS_PWD_TOO_RECENT }, + { "NT_STATUS_PWD_HISTORY_CONFLICT", NT_STATUS_PWD_HISTORY_CONFLICT }, + { "NT_STATUS_PLUGPLAY_NO_DEVICE", NT_STATUS_PLUGPLAY_NO_DEVICE }, + { "NT_STATUS_UNSUPPORTED_COMPRESSION", NT_STATUS_UNSUPPORTED_COMPRESSION }, + { "NT_STATUS_INVALID_HW_PROFILE", NT_STATUS_INVALID_HW_PROFILE }, + { "NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH", NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH }, + { "NT_STATUS_DRIVER_ORDINAL_NOT_FOUND", NT_STATUS_DRIVER_ORDINAL_NOT_FOUND }, + { "NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND", NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND }, + { "NT_STATUS_RESOURCE_NOT_OWNED", NT_STATUS_RESOURCE_NOT_OWNED }, + { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, + { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, + { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, + { NULL, 0 } +}; + -- cgit From e357d9106895b165bfa3f8331b9f186004c9a6cd Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 9 Nov 1997 17:30:10 +0000 Subject: 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) --- source3/libsmb/nterr.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') 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; +} + -- cgit From 77aec4ae6307c0ad0b843bbf23d64ccb1aaf7476 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Nov 1997 19:23:17 +0000 Subject: Rolled back tree state to 11:59pm 8th November 1997 EST to remove problems. Jeremy (This used to be commit 4a36ac236c2ad634f05efcd0179875d09988614a) --- source3/libsmb/nterr.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 7dd2234e1d..bda0f882a6 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -1,16 +1,12 @@ -/* NT error codes. please read nterr.h */ -#include "includes.h" #include "nterr.h" -typedef struct +static struct { char *nt_errstr; uint16 nt_errcode; -} nt_err_code_struct; - -nt_err_code_struct nt_errs[] = +} nt_errs[] = { { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, { "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED }, @@ -516,25 +512,3 @@ nt_err_code_struct nt_errs[] = { 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; -} - -- cgit From 5baa991aef0088a1e0f5d0e9350f3fd3168b13fb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Apr 1998 22:08:39 +0000 Subject: We will need this new nterr.c for the DOMAIN_CLIENT code. Jeremy. (This used to be commit 932b22cd495b9ce1ba03e5b91a50b314167255d7) --- source3/libsmb/nterr.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index bda0f882a6..dca97ab923 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -1,18 +1,23 @@ +/* NT error codes. please read nterr.h */ +#include "includes.h" #include "nterr.h" -static struct +typedef struct { char *nt_errstr; - uint16 nt_errcode; + uint32 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 }, { "NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS }, { "NT_STATUS_INFO_LENGTH_MISMATCH", NT_STATUS_INFO_LENGTH_MISMATCH }, { "NT_STATUS_ACCESS_VIOLATION", NT_STATUS_ACCESS_VIOLATION }, + { "STATUS_BUFFER_OVERFLOW", STATUS_BUFFER_OVERFLOW }, { "NT_STATUS_IN_PAGE_ERROR", NT_STATUS_IN_PAGE_ERROR }, { "NT_STATUS_PAGEFILE_QUOTA", NT_STATUS_PAGEFILE_QUOTA }, { "NT_STATUS_INVALID_HANDLE", NT_STATUS_INVALID_HANDLE }, @@ -512,3 +517,25 @@ static struct { NULL, 0 } }; +/***************************************************************************** + returns an NT error message. not amazingly helpful, but better than a number. + *****************************************************************************/ +char *get_nt_error_msg(uint32 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; +} + -- cgit From d3832506b2583130c4f4ba4b3edeabca987b7cbb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 00:02:57 +0000 Subject: This is the checkin that adds the security=domain functionality. WARNING - so far this has only been tested against a Samba PDC (still waiting for IS to add me the machine accounts :-). Still missing is the code in smbpasswd that will add a machine account password and change it on the domain controller, but this is not hard, and I will check it in soon. Jeremy. (This used to be commit 17b94a7084621b3f0106dd4d3386f05cdfc56d19) --- source3/libsmb/nterr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index dca97ab923..0788ae1b60 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -527,6 +527,8 @@ char *get_nt_error_msg(uint32 nt_code) strcpy(msg, "Unknown NT error"); + nt_code &= 0xFFFF; + while (nt_errs[idx].nt_errstr != NULL) { if (nt_errs[idx].nt_errcode == nt_code) @@ -536,6 +538,6 @@ char *get_nt_error_msg(uint32 nt_code) } idx++; } - return NULL; + return msg; } -- cgit From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: This is a security audit change of the main source. It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb) --- source3/libsmb/nterr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 0788ae1b60..d2f9335000 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -525,7 +525,7 @@ char *get_nt_error_msg(uint32 nt_code) static pstring msg; int idx = 0; - strcpy(msg, "Unknown NT error"); + pstrcpy(msg, "Unknown NT error"); nt_code &= 0xFFFF; @@ -533,7 +533,7 @@ char *get_nt_error_msg(uint32 nt_code) { if (nt_errs[idx].nt_errcode == nt_code) { - strcpy(msg, nt_errs[idx].nt_errstr); + pstrcpy(msg, nt_errs[idx].nt_errstr); return msg; } idx++; -- cgit From 7fe5ba774b27b01b91f0d7cc25abf8383b9afca6 Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Fri, 23 Apr 1999 14:47:45 +0000 Subject: Adding scheduler control pipe (\atsvc), client-side routines, and rpcclient command "at" (compatible with NT's "at" command - see rpcclient commit) - useful for remote NT administration. (This used to be commit cf30a472f702d7b50c3a85e2cf2f55b46a2bd452) --- source3/libsmb/nterr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index d2f9335000..b094050a33 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -514,6 +514,7 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, + { "NT_STATUS_NO_SUCH_JOB", NT_STATUS_NO_SUCH_JOB }, { NULL, 0 } }; @@ -525,7 +526,7 @@ char *get_nt_error_msg(uint32 nt_code) static pstring msg; int idx = 0; - pstrcpy(msg, "Unknown NT error"); + snprintf(msg, sizeof(msg), "%08x", nt_code); nt_code &= 0xFFFF; -- cgit From cae3620b2e8abbe35f0369a82d5461cb596475a3 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 24 Jun 1999 18:58:08 +0000 Subject: safe string error reporting functions (found a potential buffer overflow of a pstrcpy into an fstring). (This used to be commit ac0060443de800fec9042b69b299ff2e9128a31c) --- source3/libsmb/nterr.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index b094050a33..9cf1fb8214 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -521,12 +521,11 @@ nt_err_code_struct nt_errs[] = /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) +void get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len) { - static pstring msg; int idx = 0; - snprintf(msg, sizeof(msg), "%08x", nt_code); + snprintf(msg, len, "NT code %08x", nt_code); nt_code &= 0xFFFF; @@ -534,11 +533,19 @@ char *get_nt_error_msg(uint32 nt_code) { if (nt_errs[idx].nt_errcode == nt_code) { - pstrcpy(msg, nt_errs[idx].nt_errstr); - return msg; + safe_strcpy(msg, nt_errs[idx].nt_errstr, len); + return; } idx++; } - return msg; } +/***************************************************************************** + returns an NT error message. not amazingly helpful, but better than a number. + *****************************************************************************/ +char *get_nt_error_msg(uint32 nt_code) +{ + static pstring msg; + get_safe_nt_error_msg(nt_code, msg, sizeof(msg)); + return msg; +} -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/libsmb/nterr.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 9cf1fb8214..d2f9335000 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -514,18 +514,18 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, - { "NT_STATUS_NO_SUCH_JOB", NT_STATUS_NO_SUCH_JOB }, { NULL, 0 } }; /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -void get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len) +char *get_nt_error_msg(uint32 nt_code) { + static pstring msg; int idx = 0; - snprintf(msg, len, "NT code %08x", nt_code); + pstrcpy(msg, "Unknown NT error"); nt_code &= 0xFFFF; @@ -533,19 +533,11 @@ void get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len) { if (nt_errs[idx].nt_errcode == nt_code) { - safe_strcpy(msg, nt_errs[idx].nt_errstr, len); - return; + pstrcpy(msg, nt_errs[idx].nt_errstr); + return msg; } idx++; } -} - -/***************************************************************************** - returns an NT error message. not amazingly helpful, but better than a number. - *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) -{ - static pstring msg; - get_safe_nt_error_msg(nt_code, msg, sizeof(msg)); return msg; } + -- cgit From 00e3fe132476fcaed0f4b9bbe74b0a6559c39df0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Apr 2000 14:06:57 +0000 Subject: moved trans2.h and nterr.h into includes.h with all our other includes (This used to be commit d7cd7c88fdabb01d9e40ae8a657737907a21ac37) --- source3/libsmb/nterr.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index d2f9335000..ef3fb4b8ba 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -1,7 +1,6 @@ /* NT error codes. please read nterr.h */ #include "includes.h" -#include "nterr.h" typedef struct { -- cgit From ddc9b8b40642c90fe7c34b088eae4f8075f4033a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 09:49:55 +0000 Subject: more merging it is now at the stage that winbindd can compile in the head branch, but not link (This used to be commit d178c00aae77710ae6ff20a7f54a30e3bd8232bb) --- source3/libsmb/nterr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index ef3fb4b8ba..3f19a66941 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -526,11 +526,9 @@ char *get_nt_error_msg(uint32 nt_code) pstrcpy(msg, "Unknown NT error"); - nt_code &= 0xFFFF; - while (nt_errs[idx].nt_errstr != NULL) { - if (nt_errs[idx].nt_errcode == nt_code) + if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == (nt_code & 0xFFFFFF)) { pstrcpy(msg, nt_errs[idx].nt_errstr); return msg; -- cgit From 098b7b378c72632d8c3df0b795ac1e4c5dbfb04a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 3 Jul 2000 04:24:31 +0000 Subject: first pass at merging rpcclient from TNG to HEAD. You can get a semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. These files changed only with the addition of some support functions from TNG --jerry (This used to be commit a04ea15f723e559db3c60bed03318cc7be851f69) --- source3/libsmb/nterr.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 3f19a66941..f9d717477a 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -519,22 +519,32 @@ nt_err_code_struct nt_errs[] = /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) +BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len) { - static pstring msg; int idx = 0; - pstrcpy(msg, "Unknown NT error"); + slprintf(msg, len-1, "NT code %08x", nt_code); while (nt_errs[idx].nt_errstr != NULL) { if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == (nt_code & 0xFFFFFF)) { - pstrcpy(msg, nt_errs[idx].nt_errstr); - return msg; + safe_strcpy(msg, nt_errs[idx].nt_errstr, len); + return True; } idx++; } - return msg; + return False; } +/***************************************************************************** + returns an NT error message. not amazingly helpful, but better than a number. + *****************************************************************************/ +const char *get_nt_error_msg(uint32 nt_code) +{ + static pstring msg; + get_safe_nt_error_msg(nt_code, msg, sizeof(msg)); + return msg; +} + + -- cgit From 2e79da814da91f9682b73aa1e3285f1be4aa05b0 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 8 Dec 2000 02:45:51 +0000 Subject: Removed compiler warning. (This used to be commit 6d3bd1d80635d91e9590bcf093662259090ea6da) --- source3/libsmb/nterr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index f9d717477a..17bb825219 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -540,9 +540,10 @@ BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len) /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -const char *get_nt_error_msg(uint32 nt_code) +char *get_nt_error_msg(uint32 nt_code) { static pstring msg; + get_safe_nt_error_msg(nt_code, msg, sizeof(msg)); return msg; } -- cgit From 0c563186fb143e047180e3c296ea024e49f948b8 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 26 Jun 2001 06:26:05 +0000 Subject: Put an 0x in front of a hex number. (This used to be commit a48d480ce986ff1c00f2c17f30f23723ce0bb044) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 17bb825219..36dd65cda2 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -523,7 +523,7 @@ BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len) { int idx = 0; - slprintf(msg, len-1, "NT code %08x", nt_code); + slprintf(msg, len-1, "NT code 0x%08x", nt_code); while (nt_errs[idx].nt_errstr != NULL) { -- cgit From 2ccfea3de7b2b7dc0be2438c3adb3f7be82a2dfc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 10 Aug 2001 06:00:33 +0000 Subject: A rewrite of the error handling in the libsmb client code. I've separated out the error handling into a bunch of separate functions rather than all being handled in one big function. Fetch error codes from the last received packet: void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num); uint32 cli_nt_error(struct cli_state *); Convert errors to UNIX errno values: int cli_errno_from_dos(uint8 eclass, uint32 num); int cli_errno_from_nt(uint32 status); int cli_errno(struct cli_state *cli); Detect different kinds of errors: BOOL cli_is_dos_error(struct cli_state *cli); BOOL cli_is_nt_error(struct cli_state *cli); BOOL cli_is_error(struct cli_state *cli); This also means we now support CAP_STATUS32 as we can decode and understand NT errors instead of just DOS errors. Yay! Ported a whole bunch of files in libsmb to use this new API instead of the just the DOS error. (This used to be commit 6dbdb0d813f3c7ab20b38baa1223b0b479aadec9) --- source3/libsmb/nterr.c | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 36dd65cda2..1b8e8737f7 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -1,3 +1,24 @@ +/* + * Unix SMB/Netbios implementation. + * Version 1.9. + * RPC Pipe client / server routines + * Copyright (C) Luke Kenneth Casson Leighton 1997-2001. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + /* NT error codes. please read nterr.h */ #include "includes.h" @@ -519,33 +540,20 @@ nt_err_code_struct nt_errs[] = /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len) +char *get_nt_error_msg(uint32 nt_code) { - int idx = 0; + static pstring msg; + int idx = 0; - slprintf(msg, len-1, "NT code 0x%08x", nt_code); + slprintf(msg, sizeof(msg), "NT code 0x%08x", nt_code); - while (nt_errs[idx].nt_errstr != NULL) - { - if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == (nt_code & 0xFFFFFF)) - { - safe_strcpy(msg, nt_errs[idx].nt_errstr, len); - return True; + while (nt_errs[idx].nt_errstr != NULL) { + if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == + (nt_code & 0xFFFFFF)) { + return nt_errs[idx].nt_errstr; } idx++; } - return False; -} -/***************************************************************************** - returns an NT error message. not amazingly helpful, but better than a number. - *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) -{ - static pstring msg; - - get_safe_nt_error_msg(nt_code, msg, sizeof(msg)); return msg; } - - -- cgit From ee5f7237decfe446f4fdb08422beb2e6cb43af7f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Aug 2001 17:52:23 +0000 Subject: started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs (This used to be commit 1b778bc7d22efff3f90dc450eb12baa1241cf68f) --- source3/libsmb/nterr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 1b8e8737f7..7fdeb4e5a7 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -26,8 +26,7 @@ typedef struct { char *nt_errstr; - uint32 nt_errcode; - + NTSTATUS nt_errcode; } nt_err_code_struct; nt_err_code_struct nt_errs[] = @@ -534,22 +533,22 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, - { NULL, 0 } + { NULL, NT_STATUS(0) } }; /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) +char *get_nt_error_msg(NTSTATUS nt_code) { static pstring msg; int idx = 0; - slprintf(msg, sizeof(msg), "NT code 0x%08x", nt_code); + slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); while (nt_errs[idx].nt_errstr != NULL) { - if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == - (nt_code & 0xFFFFFF)) { + if ((NT_STATUS_V(nt_errs[idx].nt_errcode) & 0xFFFFFF) == + (NT_STATUS_V(nt_code) & 0xFFFFFF)) { return nt_errs[idx].nt_errstr; } idx++; -- cgit From a94843061a3d2dbc7de11db9c07226670555cf9b Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 11 Sep 2001 04:14:26 +0000 Subject: Added a string for NT_STATUS_OK, m'kay? (This used to be commit ff149308349fbf80399d9d541659f3c1d668306a) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 7fdeb4e5a7..1f61e648c2 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -31,6 +31,7 @@ typedef struct nt_err_code_struct nt_errs[] = { + { "NT_STATUS_OK", NT_STATUS_OK }, { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, { "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED }, { "NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS }, -- cgit From fab88997b021ad66dd7f03220d95d1f7ee315140 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 29 Oct 2001 08:12:44 +0000 Subject: This patch applied, except without the structure changes to nmblib.c Andrew Bartlett. From kai@cmail.ru Mon Oct 29 18:50:42 2001 Date: Fri, 19 Oct 2001 17:26:06 +0300 From: Andrew V. Samoilov To: samba-technical@lists.samba.org Subject: [patch]: makes some arrays const to be shared between processes Hi! This patch makes some arrays const. So these arrays go to text/rodata segment and are shared between all of the processes which use shared library with these arrays. Regards, Andrew V. Samoilov. P.S. Please cc your answer to kai@cmail.ru, I don't subscribed to this list. ChangeLog: * cliconnect.c (prots): Make const. * clierror.c (rap_errmap): Likewise. * nmblib.c (nmb_header_opcode_names): Likewise. (lookup_opcode_name): Make opcode_namep const. Eliminate i. * nterr.c (nt_err_code_struct): Typedef const. * smberr.c (err_code_struct): Make const. (err_classes): Likewise. (This used to be commit cb84485a2b0e1fdcb6fa90e0bfb97e125ae1b3dd) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 1f61e648c2..ab0a425633 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -23,7 +23,7 @@ #include "includes.h" -typedef struct +typedef const struct { char *nt_errstr; NTSTATUS nt_errcode; -- cgit From a2e136a8a0c9836420db0b595c8d45c106a0663c Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 23 Nov 2001 05:50:05 +0000 Subject: Finally worked out why a enumerate trusted domains was returning a NT_STATUS_UNABLE_TO_FREE_VM error. This error code was mis-defined as 0x8000001a instead of 0xc000001a. The former is actually a NT_STATUS_NO_MORE_ENTRIES warning which is what we see in the status code. Removed the & 0xffffff from the loop in get_nt_error_msg() as all the error constants now have the correct high bits set. (This used to be commit 80dca2c9e46753d87e673d712c96c76ffde0b276) --- source3/libsmb/nterr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index ab0a425633..238908d6cd 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -534,6 +534,7 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, + { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { NULL, NT_STATUS(0) } }; @@ -548,8 +549,8 @@ char *get_nt_error_msg(NTSTATUS nt_code) slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); while (nt_errs[idx].nt_errstr != NULL) { - if ((NT_STATUS_V(nt_errs[idx].nt_errcode) & 0xFFFFFF) == - (NT_STATUS_V(nt_code) & 0xFFFFFF)) { + if (NT_STATUS_V(nt_errs[idx].nt_errcode) == + NT_STATUS_V(nt_code)) { return nt_errs[idx].nt_errstr; } idx++; -- cgit From a71f3f66a1b47a70e402c4d82736f376449b923c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 25 Nov 2001 02:35:37 +0000 Subject: 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) --- source3/libsmb/nterr.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/libsmb/nterr.c') 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; +} -- cgit From 02ad29785b6eea290019163a41bffc27f0eb7855 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 1 Jan 2002 05:52:02 +0000 Subject: Add a function to convert 'NT_STATUS...' strings back into their actual error code. Andrew Bartlett (This used to be commit f0089b089b319009576bb39a076397bb44aff628) --- source3/libsmb/nterr.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/libsmb/nterr.c') 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; +} -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/libsmb/nterr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index f4d64653e4..4d13caba91 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -1,6 +1,5 @@ /* - * Unix SMB/Netbios implementation. - * Version 1.9. + * Unix SMB/CIFS implementation. * RPC Pipe client / server routines * Copyright (C) Luke Kenneth Casson Leighton 1997-2001. * -- cgit From ab13654dc9ac23872e4d1384e1c54e336f113009 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 17 Mar 2002 04:36:35 +0000 Subject: Renamed get_nt_error_msg() to nt_errstr(). (This used to be commit 1f007d3ed41c1b71a89fa6be7d173e67e927c302) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 4d13caba91..b74dde9b14 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -540,7 +540,7 @@ nt_err_code_struct nt_errs[] = /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *get_nt_error_msg(NTSTATUS nt_code) +char *nt_errstr(NTSTATUS nt_code) { static pstring msg; int idx = 0; -- cgit From d9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 15 Apr 2002 05:02:22 +0000 Subject: Merge of lsa lookup names/sids patch from HEAD. (This used to be commit e57c162897d4a7e66bb87091d179ac138f751c64) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index b74dde9b14..faf5147fe2 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -534,6 +534,7 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, + { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, { NULL, NT_STATUS(0) } }; -- cgit From e90b65284812aaa5ff9e9935ce9bbad7791cbbcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Jul 2002 10:35:28 +0000 Subject: updated the 3.0 branch from the head branch - ready for alpha18 (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index faf5147fe2..e2da6318e1 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -534,6 +534,7 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, + { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, { NULL, NT_STATUS(0) } }; -- cgit From a834a73e341059be154426390304a42e4a011f72 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Sep 2002 15:19:00 +0000 Subject: sync'ing up for 3.0alpha20 release (This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index e2da6318e1..02fd53fc05 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -28,7 +28,7 @@ typedef const struct NTSTATUS nt_errcode; } nt_err_code_struct; -nt_err_code_struct nt_errs[] = +static nt_err_code_struct nt_errs[] = { { "NT_STATUS_OK", NT_STATUS_OK }, { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, -- cgit From 8713f45a06cf242749e2ccb460d0d15c682350bb Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 21 Nov 2002 00:12:14 +0000 Subject: merge get_friendly_nt_err_msg() from app_head (This used to be commit af21e7738404f073fe2e22b282322e3facdfeb82) --- source3/libsmb/nterr.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 02fd53fc05..73d77b728a 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -539,6 +539,35 @@ static nt_err_code_struct nt_errs[] = { NULL, NT_STATUS(0) } }; +nt_err_code_struct nt_err_desc[] = +{ + { "Success", NT_STATUS_OK }, + { "Undetermined error", NT_STATUS_UNSUCCESSFUL }, + { "Access denied", NT_STATUS_ACCESS_DENIED }, + { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, + { "Password is too short", NT_STATUS_PWD_TOO_SHORT }, + { "Password is too recent", NT_STATUS_PWD_TOO_RECENT }, + { "Password history conflict", NT_STATUS_PWD_HISTORY_CONFLICT }, + { "No logon servers", NT_STATUS_NO_LOGON_SERVERS }, + { "Invalid account name", NT_STATUS_INVALID_ACCOUNT_NAME }, + { "User exists", NT_STATUS_USER_EXISTS }, + { "No such user", NT_STATUS_NO_SUCH_USER }, + { "Group exists", NT_STATUS_GROUP_EXISTS }, + { "No such group", NT_STATUS_NO_SUCH_GROUP }, + { "Member not in group", NT_STATUS_MEMBER_NOT_IN_GROUP }, + { "Wrong Password", NT_STATUS_WRONG_PASSWORD }, + { "Ill formed password", NT_STATUS_ILL_FORMED_PASSWORD }, + { "Password restriction", NT_STATUS_PASSWORD_RESTRICTION }, + { "Logon failure", NT_STATUS_LOGON_FAILURE }, + { "Account restruction", NT_STATUS_ACCOUNT_RESTRICTION }, + { "Invalid logon hours", NT_STATUS_INVALID_LOGON_HOURS }, + { "Invalid workstation", NT_STATUS_INVALID_WORKSTATION }, + { "Password expired", NT_STATUS_PASSWORD_EXPIRED }, + { "Account Disabled", NT_STATUS_ACCOUNT_DISABLED }, + { NULL, NT_STATUS(0) } +}; + + /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ @@ -560,6 +589,27 @@ char *nt_errstr(NTSTATUS nt_code) return msg; } +/************************************************************************ + Print friendler version fo NT error code + ***********************************************************************/ + +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_errs[idx].nt_errcode) == NT_STATUS_V(nt_code)) + { + return nt_errs[idx].nt_errstr; + } + idx++; + } + + /* fall back to NT_STATUS_XXX string */ + + return get_nt_error_msg(nt_code); +} + /***************************************************************************** returns an NT_STATUS constant as a string for inclusion in autogen C code *****************************************************************************/ -- cgit From 5939005588f9e0518793cd85e1e78082cb90b11d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 21 Nov 2002 01:01:58 +0000 Subject: get_nt_error_msg from APPLIANCE_HEAD is called nt_errstr in HEAD. This should fix the build. (This used to be commit a89187ccc95cc54e39518413bd4fff92c7223108) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 73d77b728a..89ad58b26f 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -607,7 +607,7 @@ char *get_friendly_nt_error_msg(NTSTATUS nt_code) /* fall back to NT_STATUS_XXX string */ - return get_nt_error_msg(nt_code); + return nt_errstr(nt_code); } /***************************************************************************** -- cgit From 8a2f73215a41f2ab65632e7c70351ece076b1589 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 4 Dec 2002 19:03:17 +0000 Subject: cleaning up some friendly error messages (This used to be commit 0f963685d9da1cd68cf922372c8ddaa769880f27) --- source3/libsmb/nterr.c | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 89ad58b26f..4bb21efaa7 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -542,28 +542,32 @@ static nt_err_code_struct nt_errs[] = nt_err_code_struct nt_err_desc[] = { { "Success", NT_STATUS_OK }, - { "Undetermined error", NT_STATUS_UNSUCCESSFUL }, - { "Access denied", NT_STATUS_ACCESS_DENIED }, - { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, - { "Password is too short", NT_STATUS_PWD_TOO_SHORT }, - { "Password is too recent", NT_STATUS_PWD_TOO_RECENT }, - { "Password history conflict", NT_STATUS_PWD_HISTORY_CONFLICT }, - { "No logon servers", NT_STATUS_NO_LOGON_SERVERS }, - { "Invalid account name", NT_STATUS_INVALID_ACCOUNT_NAME }, - { "User exists", NT_STATUS_USER_EXISTS }, - { "No such user", NT_STATUS_NO_SUCH_USER }, - { "Group exists", NT_STATUS_GROUP_EXISTS }, - { "No such group", NT_STATUS_NO_SUCH_GROUP }, - { "Member not in group", NT_STATUS_MEMBER_NOT_IN_GROUP }, - { "Wrong Password", NT_STATUS_WRONG_PASSWORD }, - { "Ill formed password", NT_STATUS_ILL_FORMED_PASSWORD }, - { "Password restriction", NT_STATUS_PASSWORD_RESTRICTION }, - { "Logon failure", NT_STATUS_LOGON_FAILURE }, - { "Account restruction", NT_STATUS_ACCOUNT_RESTRICTION }, - { "Invalid logon hours", NT_STATUS_INVALID_LOGON_HOURS }, - { "Invalid workstation", NT_STATUS_INVALID_WORKSTATION }, - { "Password expired", NT_STATUS_PASSWORD_EXPIRED }, - { "Account Disabled", NT_STATUS_ACCOUNT_DISABLED }, + { "Undetermined error", NT_STATUS_UNSUCCESSFUL }, + { "Access denied", NT_STATUS_ACCESS_DENIED }, + { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, + { "Password is too short", NT_STATUS_PWD_TOO_SHORT }, + { "Password is too recent", NT_STATUS_PWD_TOO_RECENT }, + { "Password history conflict", NT_STATUS_PWD_HISTORY_CONFLICT }, + { "No logon servers", NT_STATUS_NO_LOGON_SERVERS }, + { "Improperly formed account name", NT_STATUS_INVALID_ACCOUNT_NAME }, + { "User exists", NT_STATUS_USER_EXISTS }, + { "No such user", NT_STATUS_NO_SUCH_USER }, + { "Group exists", NT_STATUS_GROUP_EXISTS }, + { "No such group", NT_STATUS_NO_SUCH_GROUP }, + { "Member not in group", NT_STATUS_MEMBER_NOT_IN_GROUP }, + { "Wrong Password", NT_STATUS_WRONG_PASSWORD }, + { "Ill formed password", NT_STATUS_ILL_FORMED_PASSWORD }, + { "Password restriction", NT_STATUS_PASSWORD_RESTRICTION }, + { "Logon failure", NT_STATUS_LOGON_FAILURE }, + { "Account restriction", NT_STATUS_ACCOUNT_RESTRICTION }, + { "Invalid logon hours", NT_STATUS_INVALID_LOGON_HOURS }, + { "Invalid workstation", NT_STATUS_INVALID_WORKSTATION }, + { "Password expired", NT_STATUS_PASSWORD_EXPIRED }, + { "Account disabled", NT_STATUS_ACCOUNT_DISABLED }, + { "Unexpected information received", NT_STATUS_INVALID_PARAMETER }, + { "Memory allocation error", NT_STATUS_NO_MEMORY }, + { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, + { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, { NULL, NT_STATUS(0) } }; -- cgit From 98b19b0e5ee9d4e3c4b6bb2279b743ba5669bcac Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 17 Dec 2002 22:55:49 +0000 Subject: app_head merge for get_friendly_nt_err() (This used to be commit 5b311250257b3c45879a85ac46d6b6aa316514bf) --- source3/libsmb/nterr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 4bb21efaa7..e494995f86 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -602,9 +602,9 @@ 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_errs[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_errs[idx].nt_errstr; + return nt_err_desc[idx].nt_errstr; } idx++; } -- cgit From 634c54310c92c48dd4eceec602e230a021bdcfc5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 3 Jan 2003 08:28:12 +0000 Subject: Merge from HEAD - make Samba compile with -Wwrite-strings without additional warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c) --- source3/libsmb/nterr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index e494995f86..dbad05b91e 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -24,7 +24,7 @@ typedef const struct { - char *nt_errstr; + const char *nt_errstr; NTSTATUS nt_errcode; } nt_err_code_struct; @@ -575,7 +575,7 @@ nt_err_code_struct nt_err_desc[] = /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *nt_errstr(NTSTATUS nt_code) +const char *nt_errstr(NTSTATUS nt_code) { static pstring msg; int idx = 0; @@ -597,7 +597,7 @@ char *nt_errstr(NTSTATUS nt_code) Print friendler version fo NT error code ***********************************************************************/ -char *get_friendly_nt_error_msg(NTSTATUS nt_code) +const char *get_friendly_nt_error_msg(NTSTATUS nt_code) { int idx = 0; @@ -617,7 +617,7 @@ char *get_friendly_nt_error_msg(NTSTATUS nt_code) /***************************************************************************** returns an NT_STATUS constant as a string for inclusion in autogen C code *****************************************************************************/ -char *get_nt_error_c_code(NTSTATUS nt_code) +const char *get_nt_error_c_code(NTSTATUS nt_code) { static pstring out; int idx = 0; -- cgit From 72ae2c115944f56066aa8776f64edfc12e0e19c1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 22 Jan 2003 14:34:00 +0000 Subject: fix for CR 1603; provide description of NT_STATUS_PIPE_NOT_AVAILABLE (This used to be commit b063acd9062704be6352647dae2ad801ecacec75) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index dbad05b91e..6274680f60 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -568,6 +568,7 @@ nt_err_code_struct nt_err_desc[] = { "Memory allocation error", NT_STATUS_NO_MEMORY }, { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, + { "Named pipe note available", NT_STATUS_PIPE_NOT_AVAILABLE }, { NULL, NT_STATUS(0) } }; -- cgit From f354d6469ae8ed92cc02418b2b7018b7d9f8c1f1 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 23 Jan 2003 00:21:22 +0000 Subject: Fixed typo. (This used to be commit 09d8a8e87fbb13928b863f659381dddb09592985) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 6274680f60..551c6d66ce 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -568,7 +568,7 @@ nt_err_code_struct nt_err_desc[] = { "Memory allocation error", NT_STATUS_NO_MEMORY }, { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, - { "Named pipe note available", NT_STATUS_PIPE_NOT_AVAILABLE }, + { "Named pipe not available", NT_STATUS_PIPE_NOT_AVAILABLE }, { NULL, NT_STATUS(0) } }; -- cgit From 3bfd4406201593c1b5b7a97825bc514e700aea7a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 12 Feb 2003 16:44:13 +0000 Subject: adding more descriptions for nt status codes (This used to be commit 2fa33fcaee288f0607db9fc72d2f1cafdd6c5959) --- source3/libsmb/nterr.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 551c6d66ce..e6047847ae 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -541,10 +541,11 @@ static nt_err_code_struct nt_errs[] = nt_err_code_struct nt_err_desc[] = { - { "Success", NT_STATUS_OK }, + { "Success", NT_STATUS_OK }, { "Undetermined error", NT_STATUS_UNSUCCESSFUL }, { "Access denied", NT_STATUS_ACCESS_DENIED }, { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, + { "Must change password", NT_STATUS_PASSWORD_MUST_CHANGE }, { "Password is too short", NT_STATUS_PWD_TOO_SHORT }, { "Password is too recent", NT_STATUS_PWD_TOO_RECENT }, { "Password history conflict", NT_STATUS_PWD_HISTORY_CONFLICT }, @@ -569,6 +570,70 @@ nt_err_code_struct nt_err_desc[] = { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, { "Named pipe not available", NT_STATUS_PIPE_NOT_AVAILABLE }, + { "Not implemented", NT_STATUS_NOT_IMPLEMENTED }, + { "Invalid information class", NT_STATUS_INVALID_INFO_CLASS }, + { "Information length mismatch", NT_STATUS_INFO_LENGTH_MISMATCH }, + { "Access violation", NT_STATUS_ACCESS_VIOLATION }, + { "Invalid handle", NT_STATUS_INVALID_HANDLE }, + { "Invalid parameter", NT_STATUS_INVALID_PARAMETER }, + { "No memory", NT_STATUS_NO_MEMORY }, + { "Buffer too small", NT_STATUS_BUFFER_TOO_SMALL }, + { "Revision mismatch", NT_STATUS_REVISION_MISMATCH }, + { "No logon servers", NT_STATUS_NO_LOGON_SERVERS }, + { "No such logon session", NT_STATUS_NO_SUCH_LOGON_SESSION }, + { "No such privilege", NT_STATUS_NO_SUCH_PRIVILEGE }, + { "Procedure not found", NT_STATUS_PROCEDURE_NOT_FOUND }, + { "Server disabled", NT_STATUS_SERVER_DISABLED }, + { "Invalid pipe state", NT_STATUS_INVALID_PIPE_STATE }, + { "Named pipe busy", NT_STATUS_PIPE_BUSY }, + { "Illegal function", NT_STATUS_ILLEGAL_FUNCTION }, + { "Named pipe dicconnected", NT_STATUS_PIPE_DISCONNECTED }, + { "Named pipe closing", NT_STATUS_PIPE_CLOSING }, + { "Remote host not listening", NT_STATUS_REMOTE_NOT_LISTENING }, + { "Duplicate name on network", NT_STATUS_DUPLICATE_NAME }, + { "Print queue is full", NT_STATUS_PRINT_QUEUE_FULL }, + { "No print spool space available", NT_STATUS_NO_SPOOL_SPACE }, + { "Too many names", NT_STATUS_TOO_MANY_NAMES }, + { "Too many sessions", NT_STATUS_TOO_MANY_SESSIONS }, + { "Invalid server state", NT_STATUS_INVALID_SERVER_STATE }, + { "Invalid domain state", NT_STATUS_INVALID_DOMAIN_STATE }, + { "Invalid domain role", NT_STATUS_INVALID_DOMAIN_ROLE }, + { "No such domain", NT_STATUS_NO_SUCH_DOMAIN }, + { "Domain exists", NT_STATUS_DOMAIN_EXISTS }, + { "Domain limit exceeded", NT_STATUS_DOMAIN_LIMIT_EXCEEDED }, + { "Bad logon session state", NT_STATUS_BAD_LOGON_SESSION_STATE }, + { "Logon session collision", NT_STATUS_LOGON_SESSION_COLLISION }, + { "Invalid logon type", NT_STATUS_INVALID_LOGON_TYPE }, + { "Cancelled", NT_STATUS_CANCELLED }, + { "Invalid computer name", NT_STATUS_INVALID_COMPUTER_NAME }, + { "Logon server conflict", NT_STATUS_LOGON_SERVER_CONFLICT }, + { "Time difference at domain controller", NT_STATUS_TIME_DIFFERENCE_AT_DC }, + { "Pipe broken", NT_STATUS_PIPE_BROKEN }, + { "Registry corrupt", NT_STATUS_REGISTRY_CORRUPT }, + { "Too many secrets", NT_STATUS_TOO_MANY_SECRETS }, + { "Too many SIDs", NT_STATUS_TOO_MANY_SIDS }, + { "Lanmanager cross encryption required", NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED }, + { "Log file full", NT_STATUS_LOG_FILE_FULL }, + { "No trusted LSA secret", NT_STATUS_NO_TRUST_LSA_SECRET }, + { "No trusted SAM account", NT_STATUS_NO_TRUST_SAM_ACCOUNT }, + { "Trusted domain failure", NT_STATUS_TRUSTED_DOMAIN_FAILURE }, + { "Trust relationship failure", NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE }, + { "Trust failure", NT_STATUS_TRUST_FAILURE }, + { "Netlogon service not started", NT_STATUS_NETLOGON_NOT_STARTED }, + { "Account expired", NT_STATUS_ACCOUNT_EXPIRED }, + { "Network credential conflict", NT_STATUS_NETWORK_CREDENTIAL_CONFLICT }, + { "Remote session limit", NT_STATUS_REMOTE_SESSION_LIMIT }, + { "No logon interdomain trust account", NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT }, + { "No logon workstation trust account", NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT }, + { "No logon server trust account", NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT }, + { "Domain trust inconsistent", NT_STATUS_DOMAIN_TRUST_INCONSISTENT }, + { "No user session key available", NT_STATUS_NO_USER_SESSION_KEY }, + { "User session deleted", NT_STATUS_USER_SESSION_DELETED }, + { "Insufficient server resources", NT_STATUS_INSUFF_SERVER_RESOURCES }, + { "Insufficient logon information", NT_STATUS_INSUFFICIENT_LOGON_INFO }, + + { "License quota exceeded", NT_STATUS_LICENSE_QUOTA_EXCEEDED }, + { NULL, NT_STATUS(0) } }; -- cgit From e8573c8fa928602fd979d5ac45c692e7464f0aad Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 12 May 2003 01:20:17 +0000 Subject: Add NT quota support. Patch from Stefan (metze) Metzemacher 1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab 2. Disabled by default and when requested, will be probed and enabled only on Linux where it works 3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far Documentation to follow (This used to be commit 4bf022ce9e45be85609426762ba2644ac2031326) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index e6047847ae..166229ec6c 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -533,6 +533,7 @@ static nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, + { "NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, -- cgit From 869348dfcbf66a88998cb80c00902848db96901f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 6 Apr 2004 16:44:24 +0000 Subject: r84: Implement --required-membership-of=, an ntlm_auth option that restricts all authentication to members of this particular group. Also implement an option to allow ntlm_auth to get 'squashed' error codes, which are safer to communicate to remote network clients. Andrew Bartlett (This used to be commit eb1c1b5eb086f49a230142ad2de45dc0e9691df3) --- source3/libsmb/nterr.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 166229ec6c..b01451ea0f 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -717,3 +717,31 @@ 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 + * are authenticating, NT replaces both NT_STATUS_NO_SUCH_USER and + * NT_STATUS_WRONG_PASSWORD with NT_STATUS_LOGON_FAILURE in certain situations + * (session setups in particular). + * + * @param nt_status NTSTATUS input for squashing. + * @return the 'squashed' nt_status + **/ + +NTSTATUS nt_status_squash(NTSTATUS nt_status) +{ + if NT_STATUS_IS_OK(nt_status) { + return nt_status; + } else if NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) { + /* Match WinXP and don't give the game away */ + return NT_STATUS_LOGON_FAILURE; + + } else if NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD) { + /* Match WinXP and don't give the game away */ + return NT_STATUS_LOGON_FAILURE; + } else { + return nt_status; + } +} -- cgit 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 From 8189bb6e4c5a3cde757bb7823f51541c8940914b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Feb 2006 02:07:14 +0000 Subject: r13502: Fix error messages for usershares when smbd is not running. More generic error return cleanup in libsmb/ needs doing (everything returning NTSTATUS not BOOL). Jeremy (This used to be commit 654bb9853b450c5d509d182f67ec26ac320fd590) --- source3/libsmb/nterr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 677c5d84c7..4f97379ee0 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -541,6 +541,8 @@ static nt_err_code_struct nt_errs[] = { NULL, NT_STATUS(0) } }; +/* These need sorting..... */ + nt_err_code_struct nt_err_desc[] = { { "Success", NT_STATUS_OK }, @@ -595,6 +597,8 @@ nt_err_code_struct nt_err_desc[] = { "Duplicate name on network", NT_STATUS_DUPLICATE_NAME }, { "Print queue is full", NT_STATUS_PRINT_QUEUE_FULL }, { "No print spool space available", NT_STATUS_NO_SPOOL_SPACE }, + { "The network name cannot be found", NT_STATUS_BAD_NETWORK_NAME }, + { "The connection was refused", NT_STATUS_CONNECTION_REFUSED }, { "Too many names", NT_STATUS_TOO_MANY_NAMES }, { "Too many sessions", NT_STATUS_TOO_MANY_SESSIONS }, { "Invalid server state", NT_STATUS_INVALID_SERVER_STATE }, -- cgit From 3fc9b7e626e196b9692f1a29cde246355f608499 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Aug 2006 14:18:15 +0000 Subject: r17556: Remove duplicate entries. Thanks to Michael Adam Volker (This used to be commit ea83001d3ed0b5da67cf367c17fdef662bc01681) --- source3/libsmb/nterr.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 4f97379ee0..15072f70d3 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -572,7 +572,6 @@ nt_err_code_struct nt_err_desc[] = { "Unexpected information received", NT_STATUS_INVALID_PARAMETER }, { "Memory allocation error", NT_STATUS_NO_MEMORY }, { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, - { "Account locked out", NT_STATUS_ACCOUNT_LOCKED_OUT }, { "Named pipe not available", NT_STATUS_PIPE_NOT_AVAILABLE }, { "Not implemented", NT_STATUS_NOT_IMPLEMENTED }, { "Invalid information class", NT_STATUS_INVALID_INFO_CLASS }, @@ -583,7 +582,6 @@ nt_err_code_struct nt_err_desc[] = { "No memory", NT_STATUS_NO_MEMORY }, { "Buffer too small", NT_STATUS_BUFFER_TOO_SMALL }, { "Revision mismatch", NT_STATUS_REVISION_MISMATCH }, - { "No logon servers", NT_STATUS_NO_LOGON_SERVERS }, { "No such logon session", NT_STATUS_NO_SUCH_LOGON_SESSION }, { "No such privilege", NT_STATUS_NO_SUCH_PRIVILEGE }, { "Procedure not found", NT_STATUS_PROCEDURE_NOT_FOUND }, -- cgit From 232569c1f1a93bf0291c6e02569857a7a001c3dd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 21 Aug 2006 21:25:17 +0000 Subject: r17672: remove duplicate description on NT_STATUS_INVALID_PARAMETER (from Michael Adam ) (This used to be commit 7b51e27d026f2511edcde054f0d2deb9932d2fe8) --- source3/libsmb/nterr.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 15072f70d3..c247d818c1 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -569,7 +569,6 @@ nt_err_code_struct nt_err_desc[] = { "Invalid workstation", NT_STATUS_INVALID_WORKSTATION }, { "Password expired", NT_STATUS_PASSWORD_EXPIRED }, { "Account disabled", NT_STATUS_ACCOUNT_DISABLED }, - { "Unexpected information received", NT_STATUS_INVALID_PARAMETER }, { "Memory allocation error", NT_STATUS_NO_MEMORY }, { "No domain controllers located", NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND }, { "Named pipe not available", NT_STATUS_PIPE_NOT_AVAILABLE }, -- cgit From 4bbb995e8dab284b4deaa2e2ee38eb329305d1c2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Aug 2006 17:24:31 +0000 Subject: r17854: Steal the LDAP in NTSTATUS trick from Samba4 Thanks to Michael Adam Volker (This used to be commit 91878f9b6fbe5187fb7d0464008ea0abe7f11a73) --- source3/libsmb/nterr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index c247d818c1..507bb60da4 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -650,11 +650,14 @@ const char *nt_errstr(NTSTATUS nt_code) static pstring msg; int idx = 0; + if (NT_STATUS_TYPE(nt_code) == NT_STATUS_TYPE_LDAP) { + return ldap_err2string(NT_STATUS_LDAP_CODE(nt_code)); + } + slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); while (nt_errs[idx].nt_errstr != NULL) { - if (NT_STATUS_V(nt_errs[idx].nt_errcode) == - NT_STATUS_V(nt_code)) { + if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; } idx++; -- cgit From cb3e14d5a2fe03439fcfa628b0e95dc2501bbd52 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Aug 2006 17:36:17 +0000 Subject: r17855: Fix the build on systems without LDAP (This used to be commit 2e9f5c520a843ad22088388d155a172a63c140d5) --- source3/libsmb/nterr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 507bb60da4..e874b80473 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -650,9 +650,11 @@ const char *nt_errstr(NTSTATUS nt_code) static pstring msg; int idx = 0; +#ifdef HAVE_LDAP if (NT_STATUS_TYPE(nt_code) == NT_STATUS_TYPE_LDAP) { return ldap_err2string(NT_STATUS_LDAP_CODE(nt_code)); } +#endif slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); -- cgit From 0c3194816b513e3743ddcacd1eca2b683ca39b88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 24 Sep 2006 02:32:34 +0000 Subject: r18865: fixed some of the most obvious NTSTATUS/WERROR mixups in Samba3. It still doesn't compile with immediate structures and the NTSTATUS/WERROR separation, as there are still several places where the two error types are mixed up. I haven't fixed those as they require decisions about the rpcclient code that I really don't want to get into (the error handling there is a mess) So samba3 compiles now, but only becaise HAVE_IMMEDIATE_STRUCTURES is not used (look for HAVE_IMMEDIATE_STRUCTURES_XX_DISABLED) (This used to be commit 8438a6a7d4506d395c8b4bd0e99f9c100e5e3c4e) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index e874b80473..2e4b1106af 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -28,7 +28,7 @@ typedef const struct NTSTATUS nt_errcode; } nt_err_code_struct; -static nt_err_code_struct nt_errs[] = +static const nt_err_code_struct nt_errs[] = { { "NT_STATUS_OK", NT_STATUS_OK }, { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, -- cgit From 147fc86a947623e20bc85e797cb48371a54a0b77 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Sep 2006 05:06:42 +0000 Subject: r18891: Fix "double const" warning from host opi (This used to be commit 47c19811ae2282259f523a0d41a08d84de74cbda) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 2e4b1106af..db522556e4 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -22,7 +22,7 @@ #include "includes.h" -typedef const struct +typedef struct { const char *nt_errstr; NTSTATUS nt_errcode; -- cgit From 84d2ceb1df5bfeb179f9eede602496aea353e5ec Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 28 Feb 2007 09:04:05 +0000 Subject: r21581: Add an error code I just got (This used to be commit 5ef0286b56b368abd4da2cbe3d826a3438f3acc3) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index db522556e4..35ebc3d339 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -533,6 +533,7 @@ static const nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, + { "NT_STATUS_DS_NO_MORE_RIDS", NT_STATUS_DS_NO_MORE_RIDS }, { "NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/libsmb/nterr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 35ebc3d339..aa740066f1 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -5,7 +5,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/libsmb/nterr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index aa740066f1..d88e650c9c 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ /* NT error codes. please read nterr.h */ -- cgit From 9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Oct 2007 21:28:54 +0000 Subject: r25533: remove a pstring (This used to be commit 0f2552e20fb66b0b80006a8a7b999ccf6f54c656) --- source3/libsmb/nterr.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index d88e650c9c..774e50e700 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -647,7 +647,6 @@ nt_err_code_struct nt_err_desc[] = const char *nt_errstr(NTSTATUS nt_code) { - static pstring msg; int idx = 0; #ifdef HAVE_LDAP @@ -656,8 +655,6 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif - slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); - while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; @@ -665,7 +662,8 @@ const char *nt_errstr(NTSTATUS nt_code) idx++; } - return msg; + return talloc_asprintf(talloc_tos(), "NT code 0x%08x", + NT_STATUS_V(nt_code)); } /************************************************************************ @@ -688,28 +686,6 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code) return nt_errstr(nt_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; - 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; -} - /***************************************************************************** Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS) *****************************************************************************/ -- cgit From b92212575d370275bf1609cac6bc13c71de472d4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Oct 2007 22:06:24 +0000 Subject: r25538: Revert r25533 (This used to be commit 1e02208c43cb27ca4b43d268a7f0324f2a9b2cfd) --- source3/libsmb/nterr.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 774e50e700..d88e650c9c 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -647,6 +647,7 @@ nt_err_code_struct nt_err_desc[] = const char *nt_errstr(NTSTATUS nt_code) { + static pstring msg; int idx = 0; #ifdef HAVE_LDAP @@ -655,6 +656,8 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif + slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); + while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; @@ -662,8 +665,7 @@ const char *nt_errstr(NTSTATUS nt_code) idx++; } - return talloc_asprintf(talloc_tos(), "NT code 0x%08x", - NT_STATUS_V(nt_code)); + return msg; } /************************************************************************ @@ -686,6 +688,28 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code) return nt_errstr(nt_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; + 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; +} + /***************************************************************************** Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS) *****************************************************************************/ -- cgit From 6069670f1bebc37527c8363a72a653e43fff7c0b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Nov 2007 15:30:01 +0100 Subject: Some pstring removal Hi! Feel free to push :-) Volker From 7fae6b3709a973bd0a5a13d3f5c880c61d5e35de Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Nov 2007 15:28:59 +0100 Subject: [PATCH] Remove some static pstrings (This used to be commit c3a66b4ee97a902c5cf43c3bb145541849a029ed) --- source3/libsmb/nterr.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index d88e650c9c..cf443f2339 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -647,8 +647,8 @@ nt_err_code_struct nt_err_desc[] = const char *nt_errstr(NTSTATUS nt_code) { - static pstring msg; int idx = 0; + char *result; #ifdef HAVE_LDAP if (NT_STATUS_TYPE(nt_code) == NT_STATUS_TYPE_LDAP) { @@ -656,8 +656,6 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif - slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); - while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; @@ -665,7 +663,10 @@ const char *nt_errstr(NTSTATUS nt_code) idx++; } - return msg; + result = talloc_asprintf(talloc_tos(), "NT code 0x%08x", + NT_STATUS_V(nt_code)); + SMB_ASSERT(result != NULL); + return result; } /************************************************************************ @@ -694,7 +695,7 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code) const char *get_nt_error_c_code(NTSTATUS nt_code) { - static pstring out; + char *result; int idx = 0; while (nt_errs[idx].nt_errstr != NULL) { @@ -705,9 +706,10 @@ const char *get_nt_error_c_code(NTSTATUS nt_code) idx++; } - slprintf(out, sizeof(out), "NT_STATUS(0x%08x)", NT_STATUS_V(nt_code)); - - return out; + result = talloc_asprintf(talloc_tos(), "NT_STATUS(0x%08x)", + NT_STATUS_V(nt_code)); + SMB_ASSERT(result); + return result; } /***************************************************************************** -- cgit From d3b4b69a270efd85728ac77fe23a0fb39d9dce10 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 7 Dec 2007 16:19:34 +0100 Subject: Add NT_STATUS_DOWNGRADE_DETECTED (thanks to Magnus Mertens). Guenther (This used to be commit 970daaa0a620d8e47475909cd7b5e54869602530) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index cf443f2339..608fe9db20 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -534,6 +534,7 @@ static const nt_err_code_struct nt_errs[] = { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, { "NT_STATUS_DS_NO_MORE_RIDS", NT_STATUS_DS_NO_MORE_RIDS }, { "NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT }, + { "NT_STATUS_DOWNGRADE_DETECTED", NT_STATUS_DOWNGRADE_DETECTED }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, -- cgit From b028fd3f8c99e6d36237f5a312fd0bc800b38edd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 2 Apr 2008 15:26:27 +0200 Subject: Add NT_STATUS_RPC_CANNOT_SUPPORT. Guenther (This used to be commit 9e15ce03ca66a0b5ffdb39dd2faaad6e0f967e31) --- source3/libsmb/nterr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 608fe9db20..fc6340342f 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -539,6 +539,7 @@ static const nt_err_code_struct nt_errs[] = { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, { "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES }, + { "NT_STATUS_RPC_CANNOT_SUPPORT", NT_STATUS_RPC_CANNOT_SUPPORT }, { NULL, NT_STATUS(0) } }; -- cgit From 870c54ebb4097d14e3e89a3b81df4c3fc9b57ad3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 13 Aug 2008 17:40:30 +0200 Subject: If it is a forced DOS error, nt_errstr should say so (This used to be commit ef5489ac805237274d6088aaa7ae870cc0deb52f) --- source3/libsmb/nterr.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index fc6340342f..a52a1bc6e1 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -658,6 +658,11 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif + if (NT_STATUS_IS_DOS(nt_code)) { + return smb_dos_err_name(NT_STATUS_DOS_CLASS(nt_code), + NT_STATUS_DOS_CODE(nt_code)); + } + while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; -- cgit From 8d03db99b8c0623929f9351940a7e80adbf45e73 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 13 Aug 2008 18:19:06 +0200 Subject: Revert "If it is a forced DOS error, nt_errstr should say so" This reverts commit ef5489ac805237274d6088aaa7ae870cc0deb52f. (This used to be commit e987e9956f02557c7ec87a369b92f87083fda620) --- source3/libsmb/nterr.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/libsmb/nterr.c') diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index a52a1bc6e1..fc6340342f 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -658,11 +658,6 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif - if (NT_STATUS_IS_DOS(nt_code)) { - return smb_dos_err_name(NT_STATUS_DOS_CLASS(nt_code), - NT_STATUS_DOS_CODE(nt_code)); - } - while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; -- cgit