Don't silently accept attempts to change flags where they are not

supported.
This commit is contained in:
Peter Wemm 1998-06-10 06:34:57 +00:00
parent c3a24f69d9
commit 7a204420d3
10 changed files with 50 additions and 15 deletions

View File

@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
* $Id: fdesc_vnops.c,v 1.33 1997/10/27 13:33:38 bde Exp $
* $Id: fdesc_vnops.c,v 1.34 1998/02/09 06:09:42 eivind Exp $
*/
/*
@ -512,6 +512,8 @@ fdesc_setattr(ap)
break;
case Fctty:
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
default:
@ -528,12 +530,16 @@ fdesc_setattr(ap)
*/
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:
error = 0;
if (vap->va_flags != VNOVAL)
error = ENOPNOTSUPP;
else
error = 0;
break;
default:

View File

@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vnops.c,v 1.26 1998/01/31 07:23:13 eivind Exp $
* $Id: null_vnops.c,v 1.27 1998/04/17 22:36:54 des Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
* $Id: null_vnops.c,v 1.26 1998/01/31 07:23:13 eivind Exp $
* $Id: null_vnops.c,v 1.27 1998/04/17 22:36:54 des Exp $
*/
/*
@ -421,6 +421,8 @@ null_setattr(ap)
case VBLK:
case VSOCK:
case VFIFO:
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
case VREG:
case VLNK:

View File

@ -35,7 +35,7 @@
*
* @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95
*
* $Id: portal_vnops.c,v 1.30 1998/03/26 20:52:31 phk Exp $
* $Id: portal_vnops.c,v 1.31 1998/05/17 09:37:39 sos Exp $
*/
/*
@ -497,6 +497,9 @@ portal_setattr(ap)
if (ap->a_vp->v_flag & VROOT)
return (EACCES);
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
}

View File

@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
* $Id: procfs_vnops.c,v 1.56 1998/03/26 20:52:42 phk Exp $
* $Id: procfs_vnops.c,v 1.57 1998/05/19 00:00:14 tegge Exp $
*/
/*
@ -594,6 +594,10 @@ procfs_setattr(ap)
struct proc *a_p;
} */ *ap;
{
if (ap->a_vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
/*
* just fake out attribute setting
* it's not good to generate an error

View File

@ -1,4 +1,3 @@
/*
* Copyright 1997,1998 Julian Elischer. All rights reserved.
* julian@freebsd.org
@ -24,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: devfs_vnops.c,v 1.54 1998/04/19 23:32:17 julian Exp $
* $Id: devfs_vnops.c,v 1.55 1998/05/07 04:58:32 msmith Exp $
*/
@ -523,6 +522,9 @@ devfs_setattr(struct vop_setattr_args *ap)
int i;
dn_p file_node;
if (vap->va_flags != VNOVAL) /* XXX needs to be implemented */
return (EOPNOTSUPP);
if (error = devfs_vntodn(vp,&file_node))
{
printf("devfs_vntodn returned %d ",error);

View File

@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
* $Id: fdesc_vnops.c,v 1.33 1997/10/27 13:33:38 bde Exp $
* $Id: fdesc_vnops.c,v 1.34 1998/02/09 06:09:42 eivind Exp $
*/
/*
@ -512,6 +512,8 @@ fdesc_setattr(ap)
break;
case Fctty:
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
default:
@ -528,12 +530,16 @@ fdesc_setattr(ap)
*/
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:
error = 0;
if (vap->va_flags != VNOVAL)
error = ENOPNOTSUPP;
else
error = 0;
break;
default:

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95
* $Id: kernfs_vnops.c,v 1.29 1998/03/26 20:52:21 phk Exp $
* $Id: kernfs_vnops.c,v 1.30 1998/03/28 10:33:11 bde Exp $
*/
/*
@ -432,6 +432,9 @@ kernfs_setattr(ap)
} */ *ap;
{
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
/*
* Silently ignore attribute changes.
* This allows for open with truncate to have no

View File

@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vnops.c,v 1.26 1998/01/31 07:23:13 eivind Exp $
* $Id: null_vnops.c,v 1.27 1998/04/17 22:36:54 des Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
* $Id: null_vnops.c,v 1.26 1998/01/31 07:23:13 eivind Exp $
* $Id: null_vnops.c,v 1.27 1998/04/17 22:36:54 des Exp $
*/
/*
@ -421,6 +421,8 @@ null_setattr(ap)
case VBLK:
case VSOCK:
case VFIFO:
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
case VREG:
case VLNK:

View File

@ -35,7 +35,7 @@
*
* @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95
*
* $Id: portal_vnops.c,v 1.30 1998/03/26 20:52:31 phk Exp $
* $Id: portal_vnops.c,v 1.31 1998/05/17 09:37:39 sos Exp $
*/
/*
@ -497,6 +497,9 @@ portal_setattr(ap)
if (ap->a_vp->v_flag & VROOT)
return (EACCES);
if (vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
return (0);
}

View File

@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
* $Id: procfs_vnops.c,v 1.56 1998/03/26 20:52:42 phk Exp $
* $Id: procfs_vnops.c,v 1.57 1998/05/19 00:00:14 tegge Exp $
*/
/*
@ -594,6 +594,10 @@ procfs_setattr(ap)
struct proc *a_p;
} */ *ap;
{
if (ap->a_vap->va_flags != VNOVAL)
return (EOPNOTSUPP);
/*
* just fake out attribute setting
* it's not good to generate an error