Directory check before access check.

This commit is contained in:
Philip Homburg 2007-08-08 15:26:47 +00:00
parent a116b3aa55
commit e2f06e7c89

View file

@ -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)
{