summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-12-23 22:12:33 +0000
committerJeremy Allison <jra@samba.org>1998-12-23 22:12:33 +0000
commit7564b2b6e7913258d0af4cc933823f786da60aac (patch)
treeae3e8f4f56a01aa7a3a7c974a3c1a3fcf60a6a72 /source/lib
parent25318f8404f0261d895a48db82e7d9baa8604b03 (diff)
downloadsamba-7564b2b6e7913258d0af4cc933823f786da60aac.tar.gz
samba-7564b2b6e7913258d0af4cc933823f786da60aac.tar.xz
samba-7564b2b6e7913258d0af4cc933823f786da60aac.zip
Fixed issues with client wildcards. It turns out that NT matches
wildcards against both long and short filenames in a trans2 wildcard match. This fix gets us closer to NT compatibility (still not entirely there yet.... one more issue I know about to fix....). Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 3bf0a42c52a..d760e61fd00 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -1317,6 +1317,21 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2)
pstrcpy(t_pattern,regexp);
pstrcpy(t_filename,str);
+ if(trans2) {
+
+ /* a special case for 16 bit apps */
+ if (strequal(t_pattern,"????????.???"))
+ pstrcpy(t_pattern,"*");
+
+#if 0
+ /*
+ * Handle broken clients that send us old 8.3 format.
+ */
+ string_sub(t_pattern,"????????","*");
+ string_sub(t_pattern,".???",".*");
+#endif
+ }
+
#if 0
/*
* Not sure if this is a good idea. JRA.
@@ -1413,19 +1428,21 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2)
*/
if (strequal (t_filename, ".")) {
/*
- * Patterns: *.* *. ?. ? are valid
- *
+ * Patterns: *.* *. ?. ? ????????.??? are valid.
+ *
*/
if(strequal(t_pattern, "*.*") || strequal(t_pattern, "*.") ||
- strequal(t_pattern, "?.") || strequal(t_pattern, "?"))
+ strequal(t_pattern, "????????.???") ||
+ strequal(t_pattern, "?.") || strequal(t_pattern, "?"))
matched = True;
} else if (strequal (t_filename, "..")) {
/*
- * Patterns: *.* *. ?. ? *.? are valid
+ * Patterns: *.* *. ?. ? *.? ????????.??? are valid.
*
*/
if(strequal(t_pattern, "*.*") || strequal(t_pattern, "*.") ||
strequal(t_pattern, "?.") || strequal(t_pattern, "?") ||
+ strequal(t_pattern, "????????.???") ||
strequal(t_pattern, "*.?") || strequal(t_pattern, "?.*"))
matched = True;
} else {