svn commit: samba r6044 - in branches/SAMBA_3_0/source: lib smbd
jra at samba.org
jra at samba.org
Thu Mar 24 19:33:06 GMT 2005
Author: jra
Date: 2005-03-24 19:33:02 +0000 (Thu, 24 Mar 2005)
New Revision: 6044
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6044
Log:
Ensure the old search calls always ask mask_match to translate
patterns like ????????.??? - even if using an NT1 protocol.
Matches W2K3 behavior.
Jeremy.
Modified:
branches/SAMBA_3_0/source/lib/ms_fnmatch.c
branches/SAMBA_3_0/source/lib/util.c
branches/SAMBA_3_0/source/smbd/dir.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/ms_fnmatch.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ms_fnmatch.c 2005-03-24 19:32:53 UTC (rev 6043)
+++ branches/SAMBA_3_0/source/lib/ms_fnmatch.c 2005-03-24 19:33:02 UTC (rev 6044)
@@ -146,7 +146,7 @@
return -1;
}
-int ms_fnmatch(const char *pattern, const char *string, enum protocol_types protocol,
+int ms_fnmatch(const char *pattern, const char *string, BOOL translate_pattern,
BOOL is_case_sensitive)
{
wpstring p, s;
@@ -179,7 +179,7 @@
return -1;
}
- if (protocol <= PROTOCOL_LANMAN2) {
+ if (translate_pattern) {
/*
for older negotiated protocols it is possible to
translate the pattern to produce a "new style"
Modified: branches/SAMBA_3_0/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util.c 2005-03-24 19:32:53 UTC (rev 6043)
+++ branches/SAMBA_3_0/source/lib/util.c 2005-03-24 19:33:02 UTC (rev 6044)
@@ -2475,10 +2475,26 @@
if (strcmp(pattern,".") == 0)
return False;
- return ms_fnmatch(pattern, string, Protocol, is_case_sensitive) == 0;
+ return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0;
}
/*******************************************************************
+ A wrapper that handles case sensitivity and the special handling
+ of the ".." name. Varient that is only called by old search code which requires
+ pattern translation.
+*******************************************************************/
+
+BOOL mask_match_search(const char *string, char *pattern, BOOL is_case_sensitive)
+{
+ if (strcmp(string,"..") == 0)
+ string = ".";
+ if (strcmp(pattern,".") == 0)
+ return False;
+
+ return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0;
+}
+
+/*******************************************************************
A wrapper that handles a list of patters and calls mask_match()
on each. Returns True if any of the patterns match.
*******************************************************************/
Modified: branches/SAMBA_3_0/source/smbd/dir.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/dir.c 2005-03-24 19:32:53 UTC (rev 6043)
+++ branches/SAMBA_3_0/source/smbd/dir.c 2005-03-24 19:33:02 UTC (rev 6044)
@@ -698,7 +698,7 @@
static BOOL mangle_mask_match(connection_struct *conn, fstring filename, char *mask)
{
mangle_map(filename,True,False,SNUM(conn));
- return mask_match(filename,mask,False);
+ return mask_match_search(filename,mask,False);
}
/****************************************************************************
@@ -740,7 +740,7 @@
see masktest for a demo
*/
if ((strcmp(mask,"*.*") == 0) ||
- mask_match(filename,mask,False) ||
+ mask_match_search(filename,mask,False) ||
mangle_mask_match(conn,filename,mask)) {
if (!mangle_is_8_3(filename, False))
More information about the samba-cvs
mailing list