Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2001 10:06:36 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Bakul Shah <bakul@bitblocks.com>, current@FreeBSD.ORG
Subject:   Re: Ok, try this patch. (was Re: symlink(2) [Was: Re: tcsh.cat]) 
Message-ID:  <200106231706.f5NH6a872811@earth.backplane.com>
References:   <Pine.BSF.4.21.0106191536440.14564-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
    Ok, Bruce... the symlink patch has been sitting in my tree for a week
    now.  I am going to let you decide whether I should commit it or not.
    If not, into the trash heap it goes.  This is likely to be the only
    way the problem will be solved since creating an empty symlink via
    the 'ln -s' utility is perfect legal.  So, in or out?

						-Matt

Index: kern/vfs_lookup.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_lookup.c,v
retrieving revision 1.38.2.2
diff -u -r1.38.2.2 vfs_lookup.c
--- kern/vfs_lookup.c	2001/05/20 12:11:57	1.38.2.2
+++ kern/vfs_lookup.c	2001/06/18 01:39:46
@@ -200,6 +200,12 @@
 			break;
 		}
 		linklen = MAXPATHLEN - auio.uio_resid;
+		if (linklen == 0) {
+			if (ndp->ni_pathlen > 1)
+				zfree(namei_zone, cp);
+			error = ENOENT;
+			break;
+		}
 		if (linklen + ndp->ni_pathlen >= MAXPATHLEN) {
 			if (ndp->ni_pathlen > 1)
 				zfree(namei_zone, cp);

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?200106231706.f5NH6a872811>