Directory check before access check.
This commit is contained in:
parent
a116b3aa55
commit
e2f06e7c89
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue