From f9c36fae757d197ee4de06f0ecf94ae13faad0de Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 May 2008 21:38:33 +0200 Subject: Export functions for setting NTSTATUS and WERRORs in python. (This used to be commit 4bcb92d2d49d90863b1e64b15d055517fbfd263c) --- source4/librpc/rpc/pyrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/librpc') diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index cf16c582f4..8a0486c05e 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -22,6 +22,7 @@ #include "librpc/rpc/pyrpc.h" #include "librpc/rpc/dcerpc.h" #include "lib/events/events.h" +#include "libcli/util/pyerrors.h" static PyObject *py_iface_server_name(PyObject *obj, void *closure) { @@ -58,15 +59,14 @@ static PyObject *py_iface_request(PyObject *self, PyObject *args, PyObject *kwar return NULL; } - data_in.data = talloc_strndup(mem_ctx, in_data, in_length); + data_in.data = (uint8_t *)talloc_strndup(mem_ctx, in_data, in_length); data_in.length = in_length; status = dcerpc_request(iface->pipe, NULL /* FIXME: object GUID */, opnum, false, mem_ctx, &data_in, &data_out); if (NT_STATUS_IS_ERR(status)) { - /* FIXME: Set more appropriate error */ - PyErr_SetString(PyExc_RuntimeError, "Unable to connect"); + PyErr_SetNTSTATUS(status); talloc_free(mem_ctx); return NULL; } -- cgit