From beb4f83128f2b60dd57a2abcf20051a8b079c7c3 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Wed, 20 May 2026 20:05:55 +0200 Subject: [PATCH] dos mangle v15 --- src/nwvolume.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/nwvolume.c b/src/nwvolume.c index 57359cc..1d12ad1 100644 --- a/src/nwvolume.c +++ b/src/nwvolume.c @@ -393,8 +393,27 @@ static int look_name_space_map(NW_VOL *v, DEV_NAMESPACE_MAP *dnm, int k=-1; while (++k < v->maps_count) { mp=v->dev_namespace_maps[k]; - if (mp->dev == dnm->dev && mp->namespace == dnm->namespace) - return(k); + if (mp->dev == dnm->dev) { + /* + * VOL_OPTION_ONE_DEV encodes handles as the raw 32-bit inode: + * + * handle = inode + * + * In that mode there is no room in the handle for the dev/namespace + * map index. All namespaces on this one Unix device therefore have + * to share the same map entry. Otherwise a volume with both 'o' and + * 'O' set can map the DOS root entry, but later OS/2 namespace lookups + * fail with: + * + * Cannot map inode=..., dev=..., namespace=4 to vol=... handle + * + * Non-ONE_DEV volumes keep the old behaviour and still distinguish + * mappings by both device and namespace. + */ + if ((v->options & VOL_OPTION_ONE_DEV) + || mp->namespace == dnm->namespace) + return(k); + } } if (do_insert && v->maps_count < v->max_maps_count) { /* now do insert the new map */