namspace: fix DOS alias lookup during search

Use the generated DOS alias for search matching while keeping the real
Unix filename for the directory entry.  This prevents matched long-name
entries from failing later when the server tries to add/stat them.
This commit is contained in:
Mario Fetka
2026-05-20 15:36:39 +02:00
parent 372288926d
commit aa4c21242d

View File

@@ -1494,9 +1494,17 @@ static int search_match(struct dirent *dirbuff,
if (!inode_search) {
if (namespace == NAME_DOS) {
if (*name != '.') {
uint8 dosalias[14];
build_dos_83_alias(vol_options, ds->unixname, name,
dirbuff->d_ino, dname, size_dname);
flag = fn_dos_match_old(dname, entry, vol_options);
dirbuff->d_ino, dosalias, sizeof(dosalias));
flag = fn_dos_match_old(dosalias, entry, vol_options);
/*
* Keep dname as the real on-disk name. get_add_new_entry()
* appends dname to the parent and stats it; passing the synthetic
* DOS alias here makes long-name matches fail with
* "nw_search_file_dir:Cannot add entry". The alias is only for
* matching and for the returned INFO_MSK_ENTRY_NAME.
*/
}
} else if (namespace == NAME_OS2) {
flag = (*name != '.' || (*(name+1) != '.' && *(name+1) != '\0' ))