Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Apr 2007 07:56:22 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 118144 for review
Message-ID:  <200704150756.l3F7uMUh019517@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118144

Change 118144 by rdivacky@rdivacky_witten on 2007/04/15 07:55:54

	Check whether the vnode is a directory and return ENOTDIR if not.

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#3 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#3 (text+ko) ====

@@ -989,6 +989,10 @@
 		error = fgetvp(td, dirfd, &dir_vn);
 		if (error)
 			return (error);
+		if (dir_vn->v_type != VDIR) {
+			vrele(dir_vn);
+			return (ENOTDIR);
+		}
 	}
 
 	NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, td, dir_vn);
@@ -1918,6 +1922,10 @@
 		error = fgetvp(td, dirfd, &dir_vn);
 		if (error)
 			return (error);
+		if (dir_vn->v_type != VDIR) {
+			vrele(dir_vn);
+			return (ENOTDIR);
+		}
 	}
 
 	NDINIT_AT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,



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