pylibsmb: Use async cli_chkpath 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:39 +0000 (19:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index 20dc3482d60b822bd57b720186f2d6ff54e2fd09..062ef7c9d72216a62a08dbf33bad1d41204ad4bf 100644 (file)
@@ -1354,19 +1354,14 @@ static PyObject *py_smb_mkdir(struct py_cli_state *self, PyObject *args)
 static bool check_dir_path(struct py_cli_state *self, const char *path)
 {
        NTSTATUS status;
+       struct tevent_req *req = NULL;
 
-       if (self->is_smb1) {
-               struct tevent_req *req = NULL;
-
-               req = cli_chkpath_send(NULL, self->ev, self->cli, path);
-               if (!py_tevent_req_wait_exc(self, req)) {
-                       return false;
-               }
-               status = cli_chkpath_recv(req);
-               TALLOC_FREE(req);
-       } else {
-               status = cli_chkpath(self->cli, path);
+       req = cli_chkpath_send(NULL, self->ev, self->cli, path);
+       if (!py_tevent_req_wait_exc(self, req)) {
+               return false;
        }
+       status = cli_chkpath_recv(req);
+       TALLOC_FREE(req);
 
        return NT_STATUS_IS_OK(status);
 }