1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Fix to do NT wildcard matching.

Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent cd244b45a5
commit 170070b9c7

View File

@ -3097,8 +3097,30 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2)
}
}
matched = do_match(sbase,ebase,case_sig) &&
(trans2 || do_match(sext,eext,case_sig));
if(trans2) {
/*
* Match each component of the path, split up by '.'
* characters.
*/
char *fp, *rp, *cp2, *cp1;
matched = False;
for( cp1 = ebase, cp2 = sbase; cp1;) {
fp = strchr(cp2, '.');
if(fp)
*fp = '\0';
rp = strchr(cp1, '.');
if(rp)
*rp = '\0';
if(!do_match(cp2, cp1, case_sig))
break;
cp2 = fp ? fp + 1 : "";
cp1 = rp ? rp + 1 : NULL;
}
if(cp1 == NULL)
matched = True;
} else {
matched = do_match(sbase,ebase,case_sig) && do_match(sext,eext,case_sig);
}
DEBUG(8,("mask_match returning %d\n", matched));