]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pylibsmb: Use async cli_mkdir also for smb2
authorVolker Lendecke <vl@samba.org>
Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 28 May 2020 19:11:40 +0000 (19:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index 062ef7c9d72216a62a08dbf33bad1d41204ad4bf..426c7b28b646bf407461f6be5e1d58b18dfa9b49 100644 (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;