bug in do_match

Michel Stoop stoop at ncg.nl
Mon Feb 21 09:50:15 GMT 2000


Hello,

I have run into a bug in lib/util.c:do_match

The following happens.
In a directory there are some files ending with 1111
i.e. db0i01111, constr1111 (no extentions)
Now from an NT client in a command prompt I do:
dir *1111. this does not return the matching files.

I traced this down to a function in do_match wich
first removes the trailing not matching part from
the filename and then narrows it down to what should
be the match. But when the characters are the same
the match gets too short. The following fix solved
the problem. please check if I have done it right ;-)

1273,1275c1273,1279
<         while(*str && (case_sig ? (*p == *str) :
(toupper(*p)==toupper(*str))))
<           str++;
<         str--; /* We've eaten the match char after the '*' */
---
>         /* fix for NT dos prompt 'DIR *1111' where the chars are the same
>            after the '*' so they where eaten and not returning matches! */
>         if(!*str) {
>           while(*str && (case_sig ? (*p == *str) :
(toupper(*p)==toupper(*str))))
>             str++;
>           str--; /* We've eaten the match char after the '*' */
>         }

I run and compile on HP-UX 10.20

Michel Stoop,

Senior Network and Systems Administrator
postmaster for ncg.nl, ccggron.nl and vuykgron.nl
Numeriek Centrum Groningen B.V.
Postbus 204
9700AE Groningen
+31 (0)50 541 26 32  fax: +31 (0)50 542 37 17
http://www.ncg.nl
mailto:stoop at ncg.nl
---




More information about the samba-technical mailing list