Since NFSv4 byte range locking only works for regular files,

add a sanity check for the vnode type to the NFSv4 client.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2011-11-14 00:10:11 +00:00
parent 90379d6116
commit 670bf6f126
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227494

View File

@ -2941,6 +2941,8 @@ nfs_advlock(struct vop_advlock_args *ap)
u_quad_t size;
if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) {
if (vp->v_type != VREG)
return (EINVAL);
if ((ap->a_flags & F_POSIX) != 0)
cred = p->p_ucred;
else