Garance A Drosihn <[EMAIL PROTECTED]> writes: > I think that it's reasonable to just make it a specific error, and > thus end this thread. No harm will come of making it a specific > error on open, and it will address the problems mentioned earlier. What about this? /assar
Index: vfs_lookup.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_lookup.c,v retrieving revision 1.45 diff -u -w -u -w -r1.45 vfs_lookup.c --- vfs_lookup.c 2001/05/01 08:12:59 1.45 +++ vfs_lookup.c 2001/06/18 01:40:04 @@ -220,6 +220,12 @@ error = ENAMETOOLONG; break; } + if (linklen == 0) { + if (ndp->ni_pathlen > 1) + zfree(namei_zone, cp); + error = ENOENT; + break; + } if (ndp->ni_pathlen > 1) { bcopy(ndp->ni_next, cp + linklen, ndp->ni_pathlen); zfree(namei_zone, cnp->cn_pnbuf);