diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-06-01 15:44:08 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-06-01 15:44:08 +0000 |
commit | 13f9c7d6f84ae7ed01ebfe829350fef64aa4a9f3 (patch) | |
tree | f0b5d38f0eb3701534bfbbb38dfb55b7343be3c2 | |
parent | bf014e17cf18a4216e61f10169786ed944b8f90d (diff) |
mkdir() on ntfs should return EROFS, not ENOENT.
issue found by landry
ok kettenis millert
-rw-r--r-- | sys/ntfs/ntfs_subr.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c index 773e36d21a7..eb5eb13b2a3 100644 --- a/sys/ntfs/ntfs_subr.c +++ b/sys/ntfs/ntfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_subr.c,v 1.45 2016/02/07 09:31:14 stefan Exp $ */ +/* $OpenBSD: ntfs_subr.c,v 1.46 2016/06/01 15:44:07 natano Exp $ */ /* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */ /*- @@ -1055,14 +1055,20 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp, struct vnode *vp, } } while (1); - /* perform full scan if no entry was found */ - if (!fullscan && error == ENOENT) { - fullscan = 1; - cn = 0; /* need zero, used by lookup_ctx */ + if (error == ENOENT) { + /* perform full scan if no entry was found */ + if (!fullscan) { + fullscan = 1; + cn = 0; /* need zero, used by lookup_ctx */ - DDPRINTF("ntfs_ntlookupfile: fullscan performed for: %.*s\n", - (unsigned int)fnamelen, fname); - goto loop; + DDPRINTF("ntfs_ntlookupfile: fullscan performed for: %.*s\n", + (unsigned int)fnamelen, fname); + goto loop; + } + + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)) + error = EJUSTRETURN; } DPRINTF("finish\n"); |