From 44c6fcf68bad3fb090180c230a2459993946e31d Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Wed, 20 May 2026 09:23:33 +0200 Subject: [PATCH] namespace dname fix --- src/namspace.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/namspace.c b/src/namspace.c index 26bb243..a6a0191 100644 --- a/src/namspace.c +++ b/src/namspace.c @@ -1520,15 +1520,15 @@ static int search_match(struct dirent *dirbuff, if (namespace == NAME_DOS) { char saved_dir[1024]; char *slash; + uint8 dos_alias[DOS83_NAME_MAX + 1]; if (*name == '.') { flag = 0; } else { /* - * For DOS namespace searches, build the DOS-visible alias first, - * then keep using the historical namespace matcher. The old matcher - * understands the special 0xff-prefixed wildcard patterns used by - * namespace search requests, while the regular DOS matcher does not. + * Keep dname as the real name used later by get_add_new_entry(). + * Build the DOS-visible alias only for matching against the DOS + * namespace wildcard pattern. */ strncpy(saved_dir, (char *)ds->unixname, sizeof(saved_dir) - 1); saved_dir[sizeof(saved_dir) - 1] = '\0'; @@ -1541,25 +1541,25 @@ static int search_match(struct dirent *dirbuff, dos83_build_name_in_dir(saved_dir, name, - dname, - size_dname, + dos_alias, + sizeof(dos_alias), vol_options); XDPRINTF((2,0, "NS search_match DOS alias entry='%s' raw='%s' alias='%s' namespace=%d", entry, name, - dname, + dos_alias, namespace)); - flag = fn_dos_match_old(dname, entry, vol_options); + flag = fn_dos_match_old(dos_alias, entry, vol_options); XDPRINTF((2,0, "NS search_match DOS alias result=%d entry='%s' raw='%s' alias='%s'", flag, entry, name, - dname)); + dos_alias)); } } else if (namespace == NAME_OS2) { flag = (*name != '.' || (*(name+1) != '.' && *(name+1) != '\0' ))