git: 65ae1d493e31 - stable/14 - msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 01 Sep 2024 00:55:05 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=65ae1d493e314f5270cc92315cea0bb2e1afa3b0
commit 65ae1d493e314f5270cc92315cea0bb2e1afa3b0
Author: Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2024-08-25 14:50:53 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-09-01 00:53:36 +0000
msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE
PR: 281033
(cherry picked from commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880)
---
sys/fs/msdosfs/msdosfs_lookup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c
index 2a90339d0878..e799a5ce05f6 100644
--- a/sys/fs/msdosfs/msdosfs_lookup.c
+++ b/sys/fs/msdosfs/msdosfs_lookup.c
@@ -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: