Fix trans2findfirst for the large directory optimization
authorVolker Lendecke <vl@samba.org>
Tue, 18 Nov 2008 16:03:38 +0000 (17:03 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 18 Nov 2008 16:10:32 +0000 (17:10 +0100)
With

case sensitive = yes
preserve case = no
short preserve case = no
default case = upper

a "dir FOO.txt" would not find "FOO.TXT" because FOO.txt ends up unconverted in
the mask for mask_match.

Jeremy, please check!

Volker
(cherry picked from commit 0dbcc308e30b121268cdfcdd70c50c4ed38ab433)

source/smbd/filename.c

index 562f1e8d943fe9bbb57a632838e5715bc061d7e3..3eb2d63734a9e1cad5b5d9455ca36b17e44bc776 100644 (file)
@@ -206,6 +206,11 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                        *pp_saved_last_component = talloc_strdup(ctx,
                                                        orig_path);
                }
+               if (conn->case_sensitive && !conn->case_preserve &&
+                   !conn->short_case_preserve) {
+                       strnorm(*pp_saved_last_component,
+                               lp_defaultcase(SNUM(conn)));
+               }
        }
 
        if (!(name = talloc_strdup(ctx, orig_path))) {