r2801: Wrapped functions that return a DOS error code can return DCERPC
authorTim Potter <tpot@samba.org>
Sun, 3 Oct 2004 08:50:31 +0000 (08:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:35 +0000 (12:59 -0500)
faults if they are badly formed.  Handle this by checking the value of
NTSTATUS as well as WERROR.
(This used to be commit bb1be7819741f6c7dc1ee982cb2a255b6d776b79)

source4/scripting/swig/dcerpc.i

index a560cca57017f3ed85bbca1b1f48d40e8e4b63e9..d8589693acfac85f6ca7b299138cfaa134b80022 100644 (file)
@@ -366,6 +366,10 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
 
 %exception {
        $action
+       if (NT_STATUS_IS_ERR(result)) {
+               set_ntstatus_exception(NT_STATUS_V(result));
+               return NULL;
+       }
        if (!W_ERROR_IS_OK(arg3->out.result)) {
                set_werror_exception(W_ERROR_V(arg3->out.result));
                return NULL;