The branch, master has been updated
       via  4e95d78 smbd: tevent_req_nterror already returns bool :-)
       via  25c14ef smbd: Use full_path_tos() where appropriate
       via  62403c4 s3: smbd : SMB2 - fix SMB2_SEARCH when searching non 
wildcard string with a case-canonicalized share.
       via  b297583 s3: smbd - SMB[2|3]. Ensure a \ or / can't be found 
anywhere in a search path, not just at the start.
      from  ba4467c s3-winbindd: Implement SamLogon IRPC call

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4e95d785277439a4deb93029581cbd7ab0163680
Author: Volker Lendecke <[email protected]>
Date:   Wed Jun 11 09:35:37 2014 +0000

    smbd: tevent_req_nterror already returns bool :-)
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Wed Jun 11 21:13:06 CEST 2014 on sn-devel-104

commit 25c14ef0928ed46131dd4599fed37ec74bbc74e5
Author: Volker Lendecke <[email protected]>
Date:   Wed Jun 11 09:32:56 2014 +0000

    smbd: Use full_path_tos() where appropriate
    
    Recently I've got reports that SMB2_FIND is slower than trans2 findfirst,
    so this tries to use recent performance-sensitive APIs right from the
    start :-)
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 62403c49924274d58b2e15196fa8082f984a548b
Author: Jeremy Allison <[email protected]>
Date:   Tue Jun 10 15:58:15 2014 -0700

    s3: smbd : SMB2 - fix SMB2_SEARCH when searching non wildcard string with a 
case-canonicalized share.
    
    We need to go through filename_convert() in order for the filename
    canonicalization to be done on a non-wildcard search string (as is
    done in the SMB1 findfirst code path).
    
    Fixes Bug #10650 - "case sensitive = True" option doesn't work with "max 
protocol = SMB2" or higher in large directories.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10650
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Ira Cooper <[email protected]>

commit b297583dfdeeaef0a9f2a0c8f22b3d22ef187c76
Author: Jeremy Allison <[email protected]>
Date:   Tue Jun 10 14:41:45 2014 -0700

    s3: smbd - SMB[2|3]. Ensure a \ or / can't be found anywhere in a search 
path, not just at the start.
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Ira Cooper <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/smb2_find.c |   48 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 43 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c
index 3f779b8..6bc44a5 100644
--- a/source3/smbd/smb2_find.c
+++ b/source3/smbd/smb2_find.c
@@ -224,6 +224,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX 
*mem_ctx,
        uint32_t dirtype = FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | 
FILE_ATTRIBUTE_DIRECTORY;
        bool dont_descend = false;
        bool ask_sharemode = true;
+       bool wcard_has_wild;
        struct tm tm;
        char *p;
 
@@ -252,11 +253,11 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX 
*mem_ctx,
                tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_INVALID);
                return tevent_req_post(req, ev);
        }
-       if (strcmp(in_file_name, "\\") == 0) {
+       if (strchr_m(in_file_name, '\\') != NULL) {
                tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_INVALID);
                return tevent_req_post(req, ev);
        }
-       if (strcmp(in_file_name, "/") == 0) {
+       if (strchr_m(in_file_name, '/') != NULL) {
                tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_INVALID);
                return tevent_req_post(req, ev);
        }
@@ -323,11 +324,48 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX 
*mem_ctx,
                dptr_CloseDir(fsp);
        }
 
-       if (fsp->dptr == NULL) {
-               bool wcard_has_wild;
+       wcard_has_wild = ms_has_wild(in_file_name);
+
+       /* Ensure we've canonicalized any search path if not a wildcard. */
+       if (!wcard_has_wild) {
+               struct smb_filename *smb_fname = NULL;
+               const char *fullpath;
+               char tmpbuf[PATH_MAX];
+               char *to_free = NULL;
+
+               if (ISDOT(fsp->fsp_name->base_name)) {
+                       fullpath = in_file_name;
+               } else {
+                       size_t len;
+                       char *tmp;
+
+                       len = full_path_tos(
+                               fsp->fsp_name->base_name, in_file_name,
+                               tmpbuf, sizeof(tmpbuf), &tmp, &to_free);
+                       if (len == -1) {
+                               tevent_req_oom(req);
+                               return tevent_req_post(req, ev);
+                       }
+                       fullpath = tmp;
+               }
+               status = filename_convert(state,
+                               conn,
+                               false, /* Not a DFS path. */
+                               fullpath,
+                               UCF_SAVE_LCOMP | UCF_ALWAYS_ALLOW_WCARD_LCOMP,
+                               &wcard_has_wild,
+                               &smb_fname);
+
+               TALLOC_FREE(to_free);
 
-               wcard_has_wild = ms_has_wild(in_file_name);
+               if (tevent_req_nterror(req, status)) {
+                       return tevent_req_post(req, ev);
+               }
 
+               in_file_name = smb_fname->original_lcomp;
+       }
+
+       if (fsp->dptr == NULL) {
                status = dptr_create(conn,
                                     NULL, /* req */
                                     fsp,


-- 
Samba Shared Repository

Reply via email to