From owner-freebsd-current Sun Jun 17 18:40:39 2001 Delivered-To: freebsd-current@freebsd.org Received: from assaris.sics.se (dhcp-221-128.pdc.kth.se [130.237.221.128]) by hub.freebsd.org (Postfix) with ESMTP id 7E55F37B40A for ; Sun, 17 Jun 2001 18:40:25 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id DAA38602; Mon, 18 Jun 2001 03:40:28 +0200 (CEST) (envelope-from assar) To: Garance A Drosihn Cc: current@FreeBSD.ORG Subject: Re: symlink(2) [Was: Re: tcsh.cat] References: <200106170518.f5H5I6V44586@harmony.village.org> <20010617113141A.jkh@osd.bsdi.com> <20010617231418.A60728@nagual.pp.ru> <200106172128.f5HLSe108208@earth.backplane.com> From: Assar Westerlund Date: 18 Jun 2001 03:40:28 +0200 In-Reply-To: Garance A Drosihn's message of "Sun, 17 Jun 2001 21:16:24 -0400" Message-ID: <5lu21eo99v.fsf@assaris.sics.se> Lines: 10 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Garance A Drosihn 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment 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); --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message