diff options
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/pyrpc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index 718c749ef8..10f1d4be25 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -207,14 +207,10 @@ static PyMemberDef dcerpc_interface_members[] = { static void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status) { - if (p != NULL && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { - const char *errstr = dcerpc_errstr(NULL, p->last_fault_code); - PyErr_SetObject(PyExc_RuntimeError, - Py_BuildValue("(i,s)", p->last_fault_code, - errstr)); - } else { - PyErr_SetNTSTATUS(status); + if (p && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { + status = dcerpc_fault_to_nt_status(p->last_fault_code); } + PyErr_SetNTSTATUS(status); } static PyObject *py_iface_request(PyObject *self, PyObject *args, PyObject *kwargs) |