If lower case of a character is longer than upper case of that, then ----- DIR <i>.* ----- does not match even if <i>.TXT exists ( '<i>' is ONE character whose lower case is longer than whose upper case of that). Because in strlower_m at util_str.c:1138 /* I assume that lowercased string takes the same number of bytes * as source string even in UTF-8 encoding. (VIV) */ unix_strlower(s,strlen(s)+1,s,strlen(s)+1); Please do not assume. Now there are lots of messages like: [2003/07/05 21:34:02, 0] lib/charcnv.c:convert_string(194) convert_string: Required 8, available 5 When I insert smb_panic() after that message and type: ----- DIR <i>.* ----- then the stack trace is: [2003/07/05 21:34:02, 0] lib/util.c:smb_panic(1469) BACKTRACE: 15 stack frames: #0 bin/smbd(smb_panic+0x16b) [0x816d4e3] #1 bin/smbd(convert_string+0xf2) [0x815cb36] #2 bin/smbd(unix_strlower+0x78) [0x815cf0c] #3 bin/smbd(strlower_m+0x53) [0x81677f3] #4 bin/smbd(mask_match+0x95) [0x816eadd] #5 bin/smbd [0x80998e3] #6 bin/smbd [0x809ac4b] #7 bin/smbd(reply_trans2+0x6bc) [0x80a077c] #8 bin/smbd [0x80b09ee] #9 bin/smbd [0x80b0a8e] #10 bin/smbd(process_smb+0x187) [0x80b0d33] #11 bin/smbd(smbd_process+0x1b2) [0x80b16a2] #12 bin/smbd(main+0x6cb) [0x81b53af] #13 /lib/libc.so.6(__libc_start_main+0xbb) [0x4016114f] #14 bin/smbd(yp_get_default_domain+0x69) [0x8070de1]
Created attachment 54 [details] Don't strlower for fnmatch This patch tries to avoid doing the strlower_m at all - instead we just do a case-insentitive compare in the fnmatch code. The fnmatch code is untested, as is the change to push_ucs2 (to make it cope with this situation for the STR_UPPER flag). StrCaseCmp is again tested with the software test framework. Andrew Bartlett
I have committed a fix for this - similar to the suggested patch. Jeremy.
originally reported against 3.0.0beta2. CLeaning out non-production release versions.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.