mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
Instead of completely disallowing VOP_SETATTR, just do it where there is
an underlying vnode. Suggested by: bde
This commit is contained in:
parent
d2cb162e9c
commit
f574046378
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61315
@ -401,13 +401,17 @@ fdesc_setattr(ap)
|
||||
return (EBADF);
|
||||
|
||||
/*
|
||||
* Do not allow anybody to actually setattr anything.
|
||||
* Allow setattr where there is an underlying vnode.
|
||||
*/
|
||||
switch (fp->f_type) {
|
||||
case DTYPE_FIFO:
|
||||
case DTYPE_PIPE:
|
||||
case DTYPE_VNODE:
|
||||
error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap,
|
||||
ap->a_cred, ap->a_p);
|
||||
break;
|
||||
|
||||
case DTYPE_SOCKET:
|
||||
case DTYPE_PIPE:
|
||||
case DTYPE_KQUEUE:
|
||||
if (vap->va_flags != VNOVAL)
|
||||
error = EOPNOTSUPP;
|
||||
|
@ -401,13 +401,17 @@ fdesc_setattr(ap)
|
||||
return (EBADF);
|
||||
|
||||
/*
|
||||
* Do not allow anybody to actually setattr anything.
|
||||
* Allow setattr where there is an underlying vnode.
|
||||
*/
|
||||
switch (fp->f_type) {
|
||||
case DTYPE_FIFO:
|
||||
case DTYPE_PIPE:
|
||||
case DTYPE_VNODE:
|
||||
error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap,
|
||||
ap->a_cred, ap->a_p);
|
||||
break;
|
||||
|
||||
case DTYPE_SOCKET:
|
||||
case DTYPE_PIPE:
|
||||
case DTYPE_KQUEUE:
|
||||
if (vap->va_flags != VNOVAL)
|
||||
error = EOPNOTSUPP;
|
||||
|
Loading…
Reference in New Issue
Block a user