Samba bug with OS/2 EAs and FindFirst bug

Steven French sfrench at
Thu Sep 5 21:11:01 GMT 2002

>interoperability problem with OS/2 to Samba that shows up e.g. in Lotus
123 and a few other apps saving files with new names >("Save As" dialog).
It looks like Windows servers (this works from OS/2 to Windows) and Samba
servers differ in how they treat >impicit wildcards.   Comparing traces
between the Windows and Samba cases shows up immediate differences in how
>Trans2FindFirst of a directory (e.g. "\") is handled.    With search
attributes of 0, and a target of "\", Windows returns all of the files
>(but not dirs) Samba 2.2.5 returned file not found.

I did some additional debugging of the problem above and found the problem
- Samba 2.2.5 has converted the incoming pathname (e.g. "\") to a mask of
"." by the time it enters the loop so the check for a trailing '/' doesn't
work (the '/' has already been stripped off the path_mask) and therefore
the pattern matching in the loop is e.g. attempting to compare "." to
"file1", "file2" etc. rather than "*.*" (or even better "*") to "file1",
"file2" etc.    The best fix will probably involve appending the wildcard
char to the trailing slash earlier before it gets stripped off.   (By the
way the change to append the wildcard character to the '/' properly does
get the applications like Lotus 123 to save properly to Samba, not just to
Windows servers).

[from smbd/trans2.c - get_lanman2_dir_entry]
         p = strrchr(path_mask,'/');
        if(p != NULL) {
                if(p[1] == '\0')
                        pstrcpy(mask, p+1);
        } else
                pstrcpy(mask, path_mask);

        while (!found) {
                BOOL got_match;


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at

More information about the samba-technical mailing list