diff options
author | julian <julian@FreeBSD.org> | 1996-10-12 00:07:53 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-10-12 00:07:53 +0000 |
commit | 4485d0a8784141af29c4d5f5d17536f8bb4cf360 (patch) | |
tree | bc5b6f1537ac78e1c5e515f426350f6cef920e13 /sys/miscfs/devfs | |
parent | 1e0af5014366f9bf43e608bf93a9fccfb0032d3e (diff) | |
download | FreeBSD-src-4485d0a8784141af29c4d5f5d17536f8bb4cf360.zip FreeBSD-src-4485d0a8784141af29c4d5f5d17536f8bb4cf360.tar.gz |
reads and writes to devices update m and a times
add some security onn the chmod/chown operations
should now be root or owner
(still needs more thought but kinda-plugs tow holes pointed out by bde)
Diffstat (limited to 'sys/miscfs/devfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_vnops.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index ef17d50..8ffed00 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.26 1996/09/11 07:52:18 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.27 1996/09/20 05:55:47 nate Exp $ * * symlinks can wait 'til later. */ @@ -622,6 +622,12 @@ DBPRINT(("setattr\n")); return EINVAL; } + if (cred->cr_uid != file_node->uid + && (error = suser(cred, &p->p_acflag)) + && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 + || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) + return (error); + if (vap->va_size != VNOVAL) { return error; /*XXX (?) */ } @@ -1801,8 +1807,8 @@ static struct vnodeopv_entry_desc dev_spec_vnodeop_entries[] = { { &vop_getattr_desc, (vop_t *)devfs_getattr }, /* getattr */ { &vop_setattr_desc, (vop_t *)devfs_setattr }, /* setattr */ { &vop_read_desc, (vop_t *)spec_read }, /* read */ - { &vop_write_desc, (vop_t *)spec_write }, /* write */ - { &vop_ioctl_desc, (vop_t *)spec_ioctl }, /* ioctl */ + { &vop_write_desc, (vop_t *)devfs_write }, /* write */ + { &vop_ioctl_desc, (vop_t *)devfs_ioctl }, /* ioctl */ { &vop_select_desc, (vop_t *)spec_select }, /* select */ { &vop_mmap_desc, (vop_t *)spec_mmap }, /* mmap */ { &vop_fsync_desc, (vop_t *)spec_fsync }, /* fsync */ |