msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE

PR:	281033

(cherry picked from commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880)
This commit is contained in:
Jose Luis Duran 2024-08-25 17:50:53 +03:00 committed by Konstantin Belousov
parent 5a542a6055
commit 65ae1d493e

View file

@ -198,7 +198,9 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname
switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename,
cnp->cn_namelen, 0, pmp)) {
case 0:
return (EINVAL);
if (nameiop == CREATE || nameiop == RENAME)
return (EINVAL);
return (ENOENT);
case 1:
break;
case 2: