From c569b093954972913a3a2ad2f035fbd485789767 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Oct 2014 14:41:32 -0700 Subject: [PATCH] s3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set STATUS_NO_MORE_FILES when handed a non-wildcard path. Signed-off-by: Jeremy Allison Reviewed-by: Steve French Tested-by: Ralph Boehme Autobuild-User(master): Steve French Autobuild-Date(master): Thu Oct 23 20:44:31 CEST 2014 on sn-devel-104 (cherry picked from commit 95bf43bc6a0b6a4a47b8a556eee3b78446ea4123) --- source3/libsmb/cli_smb2_fnum.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index 8eb776a..aeade88 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -501,6 +501,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)) { /* @@ -524,6 +525,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 */ @@ -625,6 +628,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)) { -- 2.1.0.rc2.206.gedb03e5