Skip site navigation (1)Skip section navigation (2)
Date:      18 Jun 2001 03:40:28 +0200
From:      Assar Westerlund <assar@FreeBSD.ORG>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        current@FreeBSD.ORG
Subject:   Re: symlink(2) [Was: Re: tcsh.cat]
Message-ID:  <5lu21eo99v.fsf@assaris.sics.se>
In-Reply-To: Garance A Drosihn's message of "Sun, 17 Jun 2001 21:16:24 -0400"
References:  <200106170518.f5H5I6V44586@harmony.village.org> <Pine.BSF.4.21.0106172154520.582-100000@besplex.bde.org> <20010617113141A.jkh@osd.bsdi.com> <20010617231418.A60728@nagual.pp.ru> <200106172128.f5HLSe108208@earth.backplane.com> <p05100e0eb753048b371c@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-=-=

Garance A Drosihn <drosih@rpi.edu> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5lu21eo99v.fsf>