1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

pylibsmb: Use async cli_mkdir also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2020-05-26 09:01:57 +02:00 committed by Jeremy Allison
parent 99ced4cc58
commit 0b6debbbb0

View File

@ -1326,23 +1326,18 @@ static PyObject *py_smb_mkdir(struct py_cli_state *self, PyObject *args)
{
NTSTATUS status;
const char *dirname = NULL;
struct tevent_req *req = NULL;
if (!PyArg_ParseTuple(args, "s:mkdir", &dirname)) {
return NULL;
}
if (self->is_smb1) {
struct tevent_req *req = NULL;
req = cli_mkdir_send(NULL, self->ev, self->cli, dirname);
if (!py_tevent_req_wait_exc(self, req)) {
return NULL;
}
status = cli_mkdir_recv(req);
TALLOC_FREE(req);
} else {
status = cli_mkdir(self->cli, dirname);
req = cli_mkdir_send(NULL, self->ev, self->cli, dirname);
if (!py_tevent_req_wait_exc(self, req)) {
return NULL;
}
status = cli_mkdir_recv(req);
TALLOC_FREE(req);
PyErr_NTSTATUS_IS_ERR_RAISE(status);
Py_RETURN_NONE;