]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:pylibsmb: PyErr_NTSTATUS_IS_ERR_RAISE => PyErr_NTSTATUS_NOT_OK_RAISE
authorStefan Metzmacher <metze@samba.org>
Wed, 9 Dec 2020 09:13:54 +0000 (10:13 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 Dec 2020 13:59:38 +0000 (13:59 +0000)
We want to raise an exception for everything that's not NT_STATUS_OK.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index b84685b55f9c015232a143fb2bcacb7c1e0aea3d..b204f9fa1ccc217b87c348cb44ff6e2de85507f4 100644 (file)
@@ -834,7 +834,7 @@ static PyObject *py_smb_savefile(struct py_cli_state *self, PyObject *args)
        }
        status = cli_ntcreate_recv(req, &fnum, NULL);
        TALLOC_FREE(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        /* write the new file contents */
        state.data = data;
@@ -848,7 +848,7 @@ static PyObject *py_smb_savefile(struct py_cli_state *self, PyObject *args)
        }
        status = cli_push_recv(req);
        TALLOC_FREE(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        /* close the file handle */
        req = cli_close_send(NULL, self->ev, self->cli, fnum);
@@ -856,7 +856,7 @@ static PyObject *py_smb_savefile(struct py_cli_state *self, PyObject *args)
                return NULL;
        }
        status = cli_close_recv(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        Py_RETURN_NONE;
 }
@@ -945,11 +945,11 @@ static PyObject *py_smb_loadfile(struct py_cli_state *self, PyObject *args)
        }
        status = cli_ntcreate_recv(req, &fnum, NULL);
        TALLOC_FREE(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        /* get a buffer to hold the file contents */
        status = py_smb_filesize(self, fnum, &size);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        result = PyBytes_FromStringAndSize(NULL, size);
        if (result == NULL) {
@@ -1312,7 +1312,7 @@ static PyObject *py_smb_rmdir(struct py_cli_state *self, PyObject *args)
        }
        status = cli_rmdir_recv(req);
        TALLOC_FREE(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        Py_RETURN_NONE;
 }
@@ -1336,7 +1336,7 @@ static PyObject *py_smb_mkdir(struct py_cli_state *self, PyObject *args)
        }
        status = cli_mkdir_recv(req);
        TALLOC_FREE(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        Py_RETURN_NONE;
 }
@@ -1390,7 +1390,7 @@ static PyObject *py_smb_get_sd(struct py_cli_state *self, PyObject *args)
                return false;
        }
        status = cli_query_security_descriptor_recv(req, NULL, &sd);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        return py_return_ndr_struct(
                "samba.dcerpc.security", "descriptor", sd, sd);
@@ -1424,7 +1424,7 @@ static PyObject *py_smb_set_sd(struct py_cli_state *self, PyObject *args)
        }
 
        status = cli_set_security_descriptor_recv(req);
-       PyErr_NTSTATUS_IS_ERR_RAISE(status);
+       PyErr_NTSTATUS_NOT_OK_RAISE(status);
 
        Py_RETURN_NONE;
 }