From: Philip Homburg Date: Wed, 8 Aug 2007 15:26:47 +0000 (+0000) Subject: Directory check before access check. X-Git-Tag: v3.1.4~334 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/nslookup.html?a=commitdiff_plain;h=e2f06e7c892ab8f2eba3ad04a1f4844fd72944a8;p=minix.git Directory check before access check. --- diff --git a/servers/vfs/link.c b/servers/vfs/link.c index b61bfb217..0e901f4b3 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -68,6 +68,14 @@ PUBLIC int do_link() return EXDEV; } + /* Make sure that the object is a directory */ + if ((vp_d->v_mode & I_TYPE) != I_DIRECTORY) + { + put_vnode(vp_o); + put_vnode(vp_d); + return ENOTDIR; + } + r= forbidden(vp_d, W_BIT|X_BIT, 0 /*!use_realuid*/); if (r != OK) {