In the function ufs_readlink(), check read permission before
reading link.
This commit is contained in:
parent
1611699624
commit
164890a9fc
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ufs_vnops.c,v 1.28 1997/06/30 20:16:31 fvdl Exp $ */
|
/* $NetBSD: ufs_vnops.c,v 1.29 1997/10/03 16:45:49 enami Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1989, 1993
|
* Copyright (c) 1982, 1986, 1989, 1993
|
||||||
|
@ -1495,7 +1495,11 @@ ufs_readlink(v)
|
||||||
} */ *ap = v;
|
} */ *ap = v;
|
||||||
register struct vnode *vp = ap->a_vp;
|
register struct vnode *vp = ap->a_vp;
|
||||||
register struct inode *ip = VTOI(vp);
|
register struct inode *ip = VTOI(vp);
|
||||||
int isize;
|
int isize, error;
|
||||||
|
|
||||||
|
error = VOP_ACCESS(vp, VREAD, ap->a_cred, ap->a_uio->uio_procp);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
|
||||||
isize = ip->i_ffs_size;
|
isize = ip->i_ffs_size;
|
||||||
if (isize < vp->v_mount->mnt_maxsymlinklen ||
|
if (isize < vp->v_mount->mnt_maxsymlinklen ||
|
||||||
|
|
Loading…
Reference in New Issue