]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pylibsmb: Remove SMB2 special case for cli_list()
authorVolker Lendecke <vl@samba.org>
Mon, 16 Nov 2020 07:26:56 +0000 (08:26 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Nov 2020 02:48:40 +0000 (02:48 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index a1d48fe863e62b77b483332169b18f2b0e200550..a04cafdb36ffce091965b10fe90ffece6878ad19 100644 (file)
@@ -1178,6 +1178,12 @@ static NTSTATUS do_listing(struct py_cli_state *self,
 {
        char *mask = NULL;
        unsigned int info_level = SMB_FIND_FILE_BOTH_DIRECTORY_INFO;
+       struct do_listing_state state = {
+               .mask = mask,
+               .callback_fn = callback_fn,
+               .private_data = priv,
+       };
+       struct tevent_req *req = NULL;
        NTSTATUS status;
 
        if (user_mask == NULL) {
@@ -1191,34 +1197,22 @@ static NTSTATUS do_listing(struct py_cli_state *self,
        }
        dos_format(mask);
 
-       if (self->is_smb1) {
-               struct do_listing_state state = {
-                       .mask = mask,
-                       .callback_fn = callback_fn,
-                       .private_data = priv,
-               };
-               struct tevent_req *req = NULL;
-
-               req = cli_list_send(NULL, self->ev, self->cli, mask, attribute,
-                                   info_level);
-               if (req == NULL) {
-                       status = NT_STATUS_NO_MEMORY;
-                       goto done;
-               }
-               tevent_req_set_callback(req, do_listing_cb, &state);
+       req = cli_list_send(NULL, self->ev, self->cli, mask, attribute,
+                           info_level);
+       if (req == NULL) {
+               status = NT_STATUS_NO_MEMORY;
+               goto done;
+       }
+       tevent_req_set_callback(req, do_listing_cb, &state);
 
-               if (!py_tevent_req_wait_exc(self, req)) {
-                       return NT_STATUS_INTERNAL_ERROR;
-               }
-               TALLOC_FREE(req);
+       if (!py_tevent_req_wait_exc(self, req)) {
+               return NT_STATUS_INTERNAL_ERROR;
+       }
+       TALLOC_FREE(req);
 
-               status = state.status;
-               if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_FILES)) {
-                       status = NT_STATUS_OK;
-               }
-       } else {
-               status = cli_list(self->cli, mask, attribute, callback_fn,
-                                 priv);
+       status = state.status;
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_FILES)) {
+               status = NT_STATUS_OK;
        }
 
 done: