1be46b3 Handle exceptions when establishing trusts

1 file Authored by abbra 11 years ago, Committed by mkosek 11 years ago,
    Handle exceptions when establishing trusts
    
    Translate exceptions produced by DCERPC bindings when establishing trusts.
    There are two types of errors that may be produced by DCERPC bindings:
    - RuntimeError with a text (RuntimeError('NT_STATUS_OBJECT_NAME_NOT_FOUND')
    - RuntimeError with a numeric code and 'friendly' message
    
    Error codes could have two prefixes:
      - NT error codes, start with NT_STATUS_ prefix
      - Windows error codes, start with WERR_ prefix
    
    Full list of errors is available in Samba source code:
      libcli/util/ntstatus.h: NT_STATUS error codes
      libcli/util/werror.h: Windows error codes
    
    Majority of errors returned when dealing with trusts are of NT_STATUS type,
    these also include all typical POSIX errors mapped to corresponding NT errors.
    
    Unfortunately, in the textual RuntimeError case very little can be done to
    get better clarification of the error. More error paths will need to be added
    as they will be discovered -- DCERPC error messaging is complex.
    
    https://fedorahosted.org/freeipa/ticket/2868
    
        
file modified
+60 -15