s4:librpc/rpc: the python bindings should use !NT_STATUS_IS_OK instead of NT_STATUS_I...
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Apr 2010 07:07:21 +0000 (09:07 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Apr 2010 14:01:40 +0000 (16:01 +0200)
Everything but NT_STATUS_OK is an error here.

metze

source4/librpc/rpc/pyrpc.c

index 04565f24955e08677d44d895f658e964e0b3fc42..718c749ef8db9cab867f84a7ccf813ca9785ce37 100644 (file)
@@ -60,7 +60,7 @@ static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface,
        }
 
        status = md->call(iface->binding_handle, mem_ctx, r);
-       if (NT_STATUS_IS_ERR(status)) {
+       if (!NT_STATUS_IS_OK(status)) {
                PyErr_SetDCERPCStatus(iface->pipe, status);
                talloc_free(mem_ctx);
                return NULL;
@@ -248,7 +248,7 @@ static PyObject *py_iface_request(PyObject *self, PyObject *args, PyObject *kwar
        status = dcerpc_request(iface->pipe, object?&object_guid:NULL,
                                opnum, mem_ctx, &data_in, &data_out);
 
-       if (NT_STATUS_IS_ERR(status)) {
+       if (!NT_STATUS_IS_OK(status)) {
                PyErr_SetDCERPCStatus(iface->pipe, status);
                talloc_free(mem_ctx);
                return NULL;
@@ -288,7 +288,7 @@ static PyObject *py_iface_alter_context(PyObject *self, PyObject *args, PyObject
        status = dcerpc_alter_context(iface->pipe, iface->pipe, &abstract_syntax, 
                                      &transfer_syntax);
 
-       if (NT_STATUS_IS_ERR(status)) {
+       if (!NT_STATUS_IS_OK(status)) {
                PyErr_SetDCERPCStatus(iface->pipe, status);
                return NULL;
        }
@@ -449,7 +449,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje
                             table, credentials, event_ctx, lp_ctx);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       if (!NT_STATUS_IS_OK(status)) {
                PyErr_SetDCERPCStatus(ret->pipe, status);
                talloc_free(mem_ctx);
                return NULL;