s3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set STATUS_NO_MORE_FILES when...
authorJeremy Allison <jra@samba.org>
Tue, 21 Oct 2014 21:41:32 +0000 (14:41 -0700)
committerSteve French <sfrench@samba.org>
Thu, 23 Oct 2014 18:44:31 +0000 (20:44 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
Tested-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Steve French <sfrench@samba.org>
Autobuild-Date(master): Thu Oct 23 20:44:31 CEST 2014 on sn-devel-104

source3/libsmb/cli_smb2_fnum.c

index a099e034d8825c880a47732e34683324cb0175e8..de4bd6feb62c2f39bf8a522e96c659d2cab36c20 100644 (file)
@@ -667,6 +667,7 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
        bool processed_file = false;
        TALLOC_CTX *frame = talloc_stackframe();
        TALLOC_CTX *subframe = NULL;
+       bool mask_has_wild;
 
        if (smbXcli_conn_has_async_calls(cli->conn)) {
                /*
@@ -690,6 +691,8 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
                goto fail;
         }
 
+       mask_has_wild = ms_has_wild(mask);
+
        status = cli_smb2_create_fnum(cli,
                        parent_dir,
                        0,                      /* create_flags */
@@ -791,6 +794,17 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
 
                TALLOC_FREE(subframe);
 
+               if (!mask_has_wild) {
+                       /*
+                        * MacOSX 10 doesn't set STATUS_NO_MORE_FILES
+                        * when handed a non-wildcard path. Do it
+                        * for the server (with a non-wildcard path
+                        * there should only ever be one file returned.
+                        */
+                       status = STATUS_NO_MORE_FILES;
+                       break;
+               }
+
        } while (NT_STATUS_IS_OK(status));
 
        if (NT_STATUS_EQUAL(status, STATUS_NO_MORE_FILES)) {