Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libsmb/nterr.c

    r414 r740  
    1 /* 
     1/*
    22 *  Unix SMB/CIFS implementation.
    33 *  RPC Pipe client / server routines
    44 *  Copyright (C) Luke Kenneth Casson Leighton 1997-2001.
    5  * 
     5 *
    66 *  This program is free software; you can redistribute it and/or modify
    77 *  it under the terms of the GNU General Public License as published by
    88 *  the Free Software Foundation; either version 3 of the License, or
    99 *  (at your option) any later version.
    10  * 
     10 *
    1111 *  This program is distributed in the hope that it will be useful,
    1212 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1313 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1414 *  GNU General Public License for more details.
    15  * 
     15 *
    1616 *  You should have received a copy of the GNU General Public License
    1717 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
     
    2121
    2222#include "includes.h"
     23#include "smb_ldap.h"
     24#undef strcasecmp
     25
     26#if !defined(N_)
     27#define N_(string) string
     28#endif
    2329
    2430typedef struct
     
    3137{
    3238        { "NT_STATUS_OK", NT_STATUS_OK },
     39        { "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES },
     40        { "STATUS_NO_MORE_EAS", STATUS_NO_MORE_EAS },
     41        { "STATUS_INVALID_EA_NAME", STATUS_INVALID_EA_NAME },
     42        { "STATUS_EA_LIST_INCONSISTENT", STATUS_EA_LIST_INCONSISTENT },
     43        { "STATUS_INVALID_EA_FLAG", STATUS_INVALID_EA_FLAG },
    3344        { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL },
    3445        { "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED },
     
    535546        { "NT_STATUS_DS_NO_MORE_RIDS", NT_STATUS_DS_NO_MORE_RIDS },
    536547        { "NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT },
     548        { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES },
     549        { "NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED", NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED },
     550        { "NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX", NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX },
     551        { "NT_STATUS_RPC_UNKNOWN_IF", NT_STATUS_RPC_UNKNOWN_IF },
     552        { "NT_STATUS_RPC_CALL_FAILED", NT_STATUS_RPC_CALL_FAILED },
     553        { "NT_STATUS_RPC_PROTOCOL_ERROR", NT_STATUS_RPC_PROTOCOL_ERROR },
     554        { "NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE", NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE },
     555        { "NT_STATUS_RPC_CANNOT_SUPPORT", NT_STATUS_RPC_CANNOT_SUPPORT },
     556        { "NT_STATUS_RPC_SEC_PKG_ERROR", NT_STATUS_RPC_SEC_PKG_ERROR },
     557        { "NT_STATUS_RPC_SS_CONTEXT_MISMATCH", NT_STATUS_RPC_SS_CONTEXT_MISMATCH },
     558        { "NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE", NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE },
     559        { "NT_STATUS_RPC_BAD_STUB_DATA", NT_STATUS_RPC_BAD_STUB_DATA },
     560        { "NT_STATUS_RPC_INVALID_PIPE_OBJECT", NT_STATUS_RPC_INVALID_PIPE_OBJECT },
     561        { "NT_STATUS_RPC_INVALID_PIPE_OPERATION", NT_STATUS_RPC_INVALID_PIPE_OPERATION },
     562        { "NT_STATUS_RPC_WRONG_PIPE_VERSION", NT_STATUS_RPC_WRONG_PIPE_VERSION },
     563        { "NT_STATUS_RPC_PIPE_CLOSED", NT_STATUS_RPC_PIPE_CLOSED },
     564        { "NT_STATUS_RPC_PIPE_DISCIPLINE_ERROR", NT_STATUS_RPC_PIPE_DISCIPLINE_ERROR },
     565        { "NT_STATUS_RPC_PIPE_EMPTY", NT_STATUS_RPC_PIPE_EMPTY },
     566        { "NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED", NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED },
     567        { "NT_STATUS_OBJECTID_NOT_FOUND", NT_STATUS_OBJECTID_NOT_FOUND },
    537568        { "NT_STATUS_DOWNGRADE_DETECTED", NT_STATUS_DOWNGRADE_DETECTED },
    538         { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES },
     569        { "NT_STATUS_NO_S4U_PROT_SUPPORT", NT_STATUS_NO_S4U_PROT_SUPPORT },
     570        { "NT_STATUS_CROSSREALM_DELEGATION_FAILURE", NT_STATUS_CROSSREALM_DELEGATION_FAILURE },
     571        { "NT_STATUS_INVALID_LOCK_RANGE", NT_STATUS_INVALID_LOCK_RANGE },
     572        { "NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS", NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS },
     573        { "NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION", NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION },
    539574        { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES },
    540575        { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED },
    541         { "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES },
    542         { "NT_STATUS_RPC_CANNOT_SUPPORT", NT_STATUS_RPC_CANNOT_SUPPORT },
    543         { "NT_STATUS_RPC_NT_CALL_FAILED", NT_STATUS_RPC_NT_CALL_FAILED },
    544         { "NT_STATUS_RPC_NT_PROTOCOL_ERROR", NT_STATUS_RPC_NT_PROTOCOL_ERROR },
    545         { "NT_STATUS_RPC_NT_PROCNUM_OUT_OF_RANGE", NT_STATUS_RPC_NT_PROCNUM_OUT_OF_RANGE },
    546         { "NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED", NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED },
     576        { "STATUS_NOTIFY_CLEANUP", STATUS_NOTIFY_CLEANUP },
     577        { "STATUS_NOTIFY_ENUM_DIR", STATUS_NOTIFY_ENUM_DIR },
     578
    547579        { NULL, NT_STATUS(0) }
    548580};
     
    550582/* These need sorting..... */
    551583
    552 nt_err_code_struct nt_err_desc[] =
     584static const nt_err_code_struct nt_err_desc[] =
    553585{
    554         { "Success",                            NT_STATUS_OK },
    555         { "Undetermined error",                 NT_STATUS_UNSUCCESSFUL },
    556         { "Access denied",                      NT_STATUS_ACCESS_DENIED },
    557         { "Account locked out",                 NT_STATUS_ACCOUNT_LOCKED_OUT },
    558         { "Must change password",               NT_STATUS_PASSWORD_MUST_CHANGE },
    559         { "Password is too short",              NT_STATUS_PWD_TOO_SHORT },
    560         { "Password is too recent",             NT_STATUS_PWD_TOO_RECENT },
    561         { "Password history conflict",          NT_STATUS_PWD_HISTORY_CONFLICT },
    562         { "No logon servers",                   NT_STATUS_NO_LOGON_SERVERS },
    563         { "Improperly formed account name",     NT_STATUS_INVALID_ACCOUNT_NAME },
    564         { "User exists",                        NT_STATUS_USER_EXISTS },
    565         { "No such user",                       NT_STATUS_NO_SUCH_USER },
    566         { "Group exists",                       NT_STATUS_GROUP_EXISTS },
    567         { "No such group",                      NT_STATUS_NO_SUCH_GROUP },
    568         { "Member not in group",                NT_STATUS_MEMBER_NOT_IN_GROUP },
    569         { "Wrong Password",                     NT_STATUS_WRONG_PASSWORD },
    570         { "Ill formed password",                NT_STATUS_ILL_FORMED_PASSWORD },
    571         { "Password restriction",               NT_STATUS_PASSWORD_RESTRICTION },
    572         { "Logon failure",                      NT_STATUS_LOGON_FAILURE },
    573         { "Account restriction",                NT_STATUS_ACCOUNT_RESTRICTION },
    574         { "Invalid logon hours",                NT_STATUS_INVALID_LOGON_HOURS },
    575         { "Invalid workstation",                NT_STATUS_INVALID_WORKSTATION },
    576         { "Password expired",                   NT_STATUS_PASSWORD_EXPIRED },
    577         { "Account disabled",                   NT_STATUS_ACCOUNT_DISABLED },
    578         { "Memory allocation error",            NT_STATUS_NO_MEMORY },
    579         { "No domain controllers located",      NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND },
    580         { "Named pipe not available",           NT_STATUS_PIPE_NOT_AVAILABLE },
    581         { "Not implemented",                    NT_STATUS_NOT_IMPLEMENTED },
    582         { "Invalid information class",          NT_STATUS_INVALID_INFO_CLASS },
    583         { "Information length mismatch",        NT_STATUS_INFO_LENGTH_MISMATCH },
    584         { "Access violation",                   NT_STATUS_ACCESS_VIOLATION },
    585         { "Invalid handle",                     NT_STATUS_INVALID_HANDLE },
    586         { "Invalid parameter",                  NT_STATUS_INVALID_PARAMETER },
    587         { "No memory",                          NT_STATUS_NO_MEMORY },
    588         { "Buffer too small",                   NT_STATUS_BUFFER_TOO_SMALL },
    589         { "Revision mismatch",                  NT_STATUS_REVISION_MISMATCH },
    590         { "No such logon session",              NT_STATUS_NO_SUCH_LOGON_SESSION },
    591         { "No such privilege",                  NT_STATUS_NO_SUCH_PRIVILEGE },
    592         { "Procedure not found",                NT_STATUS_PROCEDURE_NOT_FOUND },
    593         { "Server disabled",                    NT_STATUS_SERVER_DISABLED },
    594         { "Invalid pipe state",                 NT_STATUS_INVALID_PIPE_STATE },
    595         { "Named pipe busy",                    NT_STATUS_PIPE_BUSY },
    596         { "Illegal function",                   NT_STATUS_ILLEGAL_FUNCTION },
    597         { "Named pipe dicconnected",            NT_STATUS_PIPE_DISCONNECTED },
    598         { "Named pipe closing",                 NT_STATUS_PIPE_CLOSING },
    599         { "Remote host not listening",          NT_STATUS_REMOTE_NOT_LISTENING },
    600         { "Duplicate name on network",          NT_STATUS_DUPLICATE_NAME },
    601         { "Print queue is full",                NT_STATUS_PRINT_QUEUE_FULL },
    602         { "No print spool space available",     NT_STATUS_NO_SPOOL_SPACE },
    603         { "The network name cannot be found",   NT_STATUS_BAD_NETWORK_NAME },
    604         { "The connection was refused",         NT_STATUS_CONNECTION_REFUSED },
    605         { "Too many names",                     NT_STATUS_TOO_MANY_NAMES },
    606         { "Too many sessions",                  NT_STATUS_TOO_MANY_SESSIONS },
    607         { "Invalid server state",               NT_STATUS_INVALID_SERVER_STATE },
    608         { "Invalid domain state",               NT_STATUS_INVALID_DOMAIN_STATE },
    609         { "Invalid domain role",                NT_STATUS_INVALID_DOMAIN_ROLE },
    610         { "No such domain",                     NT_STATUS_NO_SUCH_DOMAIN },
    611         { "Domain exists",                      NT_STATUS_DOMAIN_EXISTS },
    612         { "Domain limit exceeded",              NT_STATUS_DOMAIN_LIMIT_EXCEEDED },
    613         { "Bad logon session state",            NT_STATUS_BAD_LOGON_SESSION_STATE },
    614         { "Logon session collision",            NT_STATUS_LOGON_SESSION_COLLISION },
    615         { "Invalid logon type",                 NT_STATUS_INVALID_LOGON_TYPE },
    616         { "Cancelled",                          NT_STATUS_CANCELLED },
    617         { "Invalid computer name",              NT_STATUS_INVALID_COMPUTER_NAME },     
    618         { "Logon server conflict",              NT_STATUS_LOGON_SERVER_CONFLICT },
    619         { "Time difference at domain controller", NT_STATUS_TIME_DIFFERENCE_AT_DC },
    620         { "Pipe broken",                        NT_STATUS_PIPE_BROKEN },
    621         { "Registry corrupt",                   NT_STATUS_REGISTRY_CORRUPT },
    622         { "Too many secrets",                   NT_STATUS_TOO_MANY_SECRETS },
    623         { "Too many SIDs",                      NT_STATUS_TOO_MANY_SIDS },
    624         { "Lanmanager cross encryption required", NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED },
    625         { "Log file full",                      NT_STATUS_LOG_FILE_FULL },
    626         { "No trusted LSA secret",              NT_STATUS_NO_TRUST_LSA_SECRET },
    627         { "No trusted SAM account",             NT_STATUS_NO_TRUST_SAM_ACCOUNT },
    628         { "Trusted domain failure",             NT_STATUS_TRUSTED_DOMAIN_FAILURE },
    629         { "Trust relationship failure",         NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE },
    630         { "Trust failure",                      NT_STATUS_TRUST_FAILURE },
    631         { "Netlogon service not started",       NT_STATUS_NETLOGON_NOT_STARTED },
    632         { "Account expired",                    NT_STATUS_ACCOUNT_EXPIRED },
    633         { "Network credential conflict",        NT_STATUS_NETWORK_CREDENTIAL_CONFLICT },
    634         { "Remote session limit",               NT_STATUS_REMOTE_SESSION_LIMIT },
    635         { "No logon interdomain trust account", NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT },
    636         { "No logon workstation trust account", NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT },
    637         { "No logon server trust account",      NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT },
    638         { "Domain trust inconsistent",          NT_STATUS_DOMAIN_TRUST_INCONSISTENT },
    639         { "No user session key available",      NT_STATUS_NO_USER_SESSION_KEY },
    640         { "User session deleted",               NT_STATUS_USER_SESSION_DELETED },
    641         { "Insufficient server resources",      NT_STATUS_INSUFF_SERVER_RESOURCES },
    642         { "Insufficient logon information",     NT_STATUS_INSUFFICIENT_LOGON_INFO },
    643        
    644         { "License quota exceeded",             NT_STATUS_LICENSE_QUOTA_EXCEEDED },
    645         { "No more files",                      STATUS_NO_MORE_FILES },
     586        { N_("Success"),                                NT_STATUS_OK },
     587        { N_("Undetermined error"),             NT_STATUS_UNSUCCESSFUL },
     588        { N_("Access denied"),                  NT_STATUS_ACCESS_DENIED },
     589        { N_("Account locked out"),             NT_STATUS_ACCOUNT_LOCKED_OUT },
     590        { N_("Must change password"),           NT_STATUS_PASSWORD_MUST_CHANGE },
     591        { N_("Password is too short"),          NT_STATUS_PWD_TOO_SHORT },
     592        { N_("Password is too recent"),                 NT_STATUS_PWD_TOO_RECENT },
     593        { N_("Password history conflict"),              NT_STATUS_PWD_HISTORY_CONFLICT },
     594        { N_("No logon servers"),                       NT_STATUS_NO_LOGON_SERVERS },
     595        { N_("Improperly formed account name"),         NT_STATUS_INVALID_ACCOUNT_NAME },
     596        { N_("User exists"),                    NT_STATUS_USER_EXISTS },
     597        { N_("No such user"),                   NT_STATUS_NO_SUCH_USER },
     598        { N_("Group exists"),                   NT_STATUS_GROUP_EXISTS },
     599        { N_("No such group"),                  NT_STATUS_NO_SUCH_GROUP },
     600        { N_("Member not in group"),            NT_STATUS_MEMBER_NOT_IN_GROUP },
     601        { N_("Wrong Password"),                         NT_STATUS_WRONG_PASSWORD },
     602        { N_("Ill formed password"),            NT_STATUS_ILL_FORMED_PASSWORD },
     603        { N_("Password restriction"),           NT_STATUS_PASSWORD_RESTRICTION },
     604        { N_("Logon failure"),                  NT_STATUS_LOGON_FAILURE },
     605        { N_("Account restriction"),            NT_STATUS_ACCOUNT_RESTRICTION },
     606        { N_("Invalid logon hours"),            NT_STATUS_INVALID_LOGON_HOURS },
     607        { N_("Invalid workstation"),            NT_STATUS_INVALID_WORKSTATION },
     608        { N_("Password expired"),                       NT_STATUS_PASSWORD_EXPIRED },
     609        { N_("Account disabled"),                       NT_STATUS_ACCOUNT_DISABLED },
     610        { N_("Unexpected information received"),        NT_STATUS_INVALID_PARAMETER },
     611        { N_("Memory allocation error"),                NT_STATUS_NO_MEMORY },
     612        { N_("No domain controllers located"),  NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND },
     613        { N_("Account locked out"),             NT_STATUS_ACCOUNT_LOCKED_OUT },
     614        { N_("Named pipe not available"),               NT_STATUS_PIPE_NOT_AVAILABLE },
     615        { N_("Not implemented"),                        NT_STATUS_NOT_IMPLEMENTED },
     616        { N_("Invalid information class"),              NT_STATUS_INVALID_INFO_CLASS },
     617        { N_("Information length mismatch"),    NT_STATUS_INFO_LENGTH_MISMATCH },
     618        { N_("Access violation"),                       NT_STATUS_ACCESS_VIOLATION },
     619        { N_("Invalid handle"),                         NT_STATUS_INVALID_HANDLE },
     620        { N_("Invalid parameter"),                      NT_STATUS_INVALID_PARAMETER },
     621        { N_("No memory"),                              NT_STATUS_NO_MEMORY },
     622        { N_("Buffer too small"),                       NT_STATUS_BUFFER_TOO_SMALL },
     623        { N_("Revision mismatch"),                      NT_STATUS_REVISION_MISMATCH },
     624        { N_("No logon servers"),                       NT_STATUS_NO_LOGON_SERVERS },
     625        { N_("No such logon session"),          NT_STATUS_NO_SUCH_LOGON_SESSION },
     626        { N_("No such privilege"),                      NT_STATUS_NO_SUCH_PRIVILEGE },
     627        { N_("Procedure not found"),            NT_STATUS_PROCEDURE_NOT_FOUND },
     628        { N_("Server disabled"),                        NT_STATUS_SERVER_DISABLED },
     629        { N_("Invalid pipe state"),             NT_STATUS_INVALID_PIPE_STATE },
     630        { N_("Named pipe busy"),                        NT_STATUS_PIPE_BUSY },
     631        { N_("Illegal function"),                       NT_STATUS_ILLEGAL_FUNCTION },
     632        { N_("Named pipe disconnected"),                NT_STATUS_PIPE_DISCONNECTED },
     633        { N_("Named pipe closing"),             NT_STATUS_PIPE_CLOSING },
     634        { N_("Remote host not listening"),              NT_STATUS_REMOTE_NOT_LISTENING },
     635        { N_("Duplicate name on network"),              NT_STATUS_DUPLICATE_NAME },
     636        { N_("Print queue is full"),            NT_STATUS_PRINT_QUEUE_FULL },
     637        { N_("No print spool space available"),         NT_STATUS_NO_SPOOL_SPACE },
     638        { N_("The network name cannot be found"),   NT_STATUS_BAD_NETWORK_NAME },
     639        { N_("The connection was refused"),         NT_STATUS_CONNECTION_REFUSED },
     640        { N_("Too many names"),                         NT_STATUS_TOO_MANY_NAMES },
     641        { N_("Too many sessions"),                      NT_STATUS_TOO_MANY_SESSIONS },
     642        { N_("Invalid server state"),           NT_STATUS_INVALID_SERVER_STATE },
     643        { N_("Invalid domain state"),           NT_STATUS_INVALID_DOMAIN_STATE },
     644        { N_("Invalid domain role"),            NT_STATUS_INVALID_DOMAIN_ROLE },
     645        { N_("No such domain"),                         NT_STATUS_NO_SUCH_DOMAIN },
     646        { N_("Domain exists"),                  NT_STATUS_DOMAIN_EXISTS },
     647        { N_("Domain limit exceeded"),          NT_STATUS_DOMAIN_LIMIT_EXCEEDED },
     648        { N_("Bad logon session state"),                NT_STATUS_BAD_LOGON_SESSION_STATE },
     649        { N_("Logon session collision"),                NT_STATUS_LOGON_SESSION_COLLISION },
     650        { N_("Invalid logon type"),             NT_STATUS_INVALID_LOGON_TYPE },
     651        { N_("Cancelled"),                              NT_STATUS_CANCELLED },
     652        { N_("Invalid computer name"),          NT_STATUS_INVALID_COMPUTER_NAME },
     653        { N_("Logon server conflict"),          NT_STATUS_LOGON_SERVER_CONFLICT },
     654        { N_("Time difference at domain controller"), NT_STATUS_TIME_DIFFERENCE_AT_DC },
     655        { N_("Pipe broken"),                    NT_STATUS_PIPE_BROKEN },
     656        { N_("Registry corrupt"),                       NT_STATUS_REGISTRY_CORRUPT },
     657        { N_("Too many secrets"),                       NT_STATUS_TOO_MANY_SECRETS },
     658        { N_("Too many SIDs"),                  NT_STATUS_TOO_MANY_SIDS },
     659        { N_("Lanmanager cross encryption required"), NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED },
     660        { N_("Log file full"),                  NT_STATUS_LOG_FILE_FULL },
     661        { N_("No trusted LSA secret"),          NT_STATUS_NO_TRUST_LSA_SECRET },
     662        { N_("No trusted SAM account"),                 NT_STATUS_NO_TRUST_SAM_ACCOUNT },
     663        { N_("Trusted domain failure"),                 NT_STATUS_TRUSTED_DOMAIN_FAILURE },
     664        { N_("Trust relationship failure"),     NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE },
     665        { N_("Trust failure"),                  NT_STATUS_TRUST_FAILURE },
     666        { N_("Netlogon service not started"),   NT_STATUS_NETLOGON_NOT_STARTED },
     667        { N_("Account expired"),                        NT_STATUS_ACCOUNT_EXPIRED },
     668        { N_("Network credential conflict"),    NT_STATUS_NETWORK_CREDENTIAL_CONFLICT },
     669        { N_("Remote session limit"),           NT_STATUS_REMOTE_SESSION_LIMIT },
     670        { N_("No logon interdomain trust account"), NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT },
     671        { N_("No logon workstation trust account"), NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT },
     672        { N_("No logon server trust account"),  NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT },
     673        { N_("Domain trust inconsistent"),              NT_STATUS_DOMAIN_TRUST_INCONSISTENT },
     674        { N_("No user session key available"),  NT_STATUS_NO_USER_SESSION_KEY },
     675        { N_("User session deleted"),           NT_STATUS_USER_SESSION_DELETED },
     676        { N_("Insufficient server resources"),  NT_STATUS_INSUFF_SERVER_RESOURCES },
     677        { N_("Insufficient logon information"),         NT_STATUS_INSUFFICIENT_LOGON_INFO },
     678
     679        { N_("License quota exceeded"),                 NT_STATUS_LICENSE_QUOTA_EXCEEDED },
     680        { N_("No more files"),                  STATUS_NO_MORE_FILES },
    646681
    647682        { NULL, NT_STATUS(0) }
     
    654689const char *nt_errstr(NTSTATUS nt_code)
    655690{
    656         int idx = 0;
     691        int idx = 0;
    657692        char *result;
    658693
    659694#ifdef HAVE_LDAP
    660         if (NT_STATUS_IS_LDAP(nt_code)) {
    661                 return ldap_err2string(NT_STATUS_LDAP_CODE(nt_code));
     695        if (NT_STATUS_IS_LDAP(nt_code)) {
     696                return ldap_err2string(NT_STATUS_LDAP_CODE(nt_code));
    662697        }
    663698#endif
     
    669704
    670705        while (nt_errs[idx].nt_errstr != NULL) {
    671                 if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
    672                         return nt_errs[idx].nt_errstr;
     706                if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
     707                    NT_STATUS_V(nt_code)) {
     708                        return nt_errs[idx].nt_errstr;
    673709                }
    674710                idx++;
     
    684720 Print friendler version fo NT error code
    685721 ***********************************************************************/
    686  
     722
    687723const char *get_friendly_nt_error_msg(NTSTATUS nt_code)
    688724{
    689         int idx = 0;
     725        int idx = 0;
    690726
    691727        while (nt_err_desc[idx].nt_errstr != NULL) {
    692728                if (NT_STATUS_V(nt_err_desc[idx].nt_errcode) == NT_STATUS_V(nt_code)) {
    693                         return nt_err_desc[idx].nt_errstr;
     729                        return nt_err_desc[idx].nt_errstr;
    694730                }
    695731                idx++;
    696732        }
    697        
     733
    698734        /* fall back to NT_STATUS_XXX string */
    699        
     735
    700736        return nt_errstr(nt_code);
    701737}
     
    708744{
    709745        char *result;
    710         int idx = 0;
     746        int idx = 0;
    711747
    712748        while (nt_errs[idx].nt_errstr != NULL) {
    713                 if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
    714                     NT_STATUS_V(nt_code)) {
    715                         return nt_errs[idx].nt_errstr;
     749                if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
     750                    NT_STATUS_V(nt_code)) {
     751                        return nt_errs[idx].nt_errstr;
    716752                }
    717753                idx++;
     
    730766NTSTATUS nt_status_string_to_code(const char *nt_status_str)
    731767{
    732         int idx = 0;
     768        int idx = 0;
    733769
    734770        while (nt_errs[idx].nt_errstr != NULL) {
    735                 if (strcmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) {
    736                         return nt_errs[idx].nt_errcode;
     771                if (strcasecmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) {
     772                        return nt_errs[idx].nt_errcode;
    737773                }
    738774                idx++;
     
    744780 * Squash an NT_STATUS in line with security requirements.
    745781 * In an attempt to avoid giving the whole game away when users
    746  * are authenticating, NT replaces both NT_STATUS_NO_SUCH_USER and 
    747  * NT_STATUS_WRONG_PASSWORD with NT_STATUS_LOGON_FAILURE in certain situations 
     782 * are authenticating, NT replaces both NT_STATUS_NO_SUCH_USER and
     783 * NT_STATUS_WRONG_PASSWORD with NT_STATUS_LOGON_FAILURE in certain situations
    748784 * (session setups in particular).
    749785 *
     
    755791{
    756792        if NT_STATUS_IS_OK(nt_status) {
    757                 return nt_status;               
     793                return nt_status;
    758794        } else if NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) {
    759795                /* Match WinXP and don't give the game away */
    760796                return NT_STATUS_LOGON_FAILURE;
    761                
     797
    762798        } else if NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD) {
    763799                /* Match WinXP and don't give the game away */
     
    765801        } else {
    766802                return nt_status;
    767         } 
     803        }
    768804}
Note: See TracChangeset for help on using the changeset viewer.