summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-24 21:38:33 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-24 21:38:33 +0200
commitf9c36fae757d197ee4de06f0ecf94ae13faad0de (patch)
tree9c93537b32bc7b0748183b894c2a1e600a0eff76 /source4/librpc
parentfe5be25547b5517ebc2e74d298921ae8c53650e5 (diff)
downloadsamba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.tar.gz
samba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.tar.bz2
samba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.zip
Export functions for setting NTSTATUS and WERRORs in python.
(This used to be commit 4bcb92d2d49d90863b1e64b15d055517fbfd263c)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/pyrpc.c6
1 files changed, 3 insertions, 3 deletions
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;
}