Deleted Added
full compact
cd9660_vnops.c (184205) cd9660_vnops.c (184413)
1/*-
2 * Copyright (c) 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley
6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
7 * Support code is derived from software contributed to Berkeley
8 * by Atsushi Murai (amurai@spec.co.jp).

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley
6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
7 * Support code is derived from software contributed to Berkeley
8 * by Atsushi Murai (amurai@spec.co.jp).

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/fs/cd9660/cd9660_vnops.c 184205 2008-10-23 15:53:51Z des $");
38__FBSDID("$FreeBSD: head/sys/fs/cd9660/cd9660_vnops.c 184413 2008-10-28 13:44:11Z trasz $");
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/namei.h>
43#include <sys/kernel.h>
44#include <sys/conf.h>
45#include <sys/stat.h>
46#include <sys/bio.h>

--- 73 unchanged lines hidden (view full) ---

120 * The mode is shifted to select the owner/group/other fields. The
121 * super user is granted all permissions.
122 */
123/* ARGSUSED */
124static int
125cd9660_access(ap)
126 struct vop_access_args /* {
127 struct vnode *a_vp;
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/namei.h>
43#include <sys/kernel.h>
44#include <sys/conf.h>
45#include <sys/stat.h>
46#include <sys/bio.h>

--- 73 unchanged lines hidden (view full) ---

120 * The mode is shifted to select the owner/group/other fields. The
121 * super user is granted all permissions.
122 */
123/* ARGSUSED */
124static int
125cd9660_access(ap)
126 struct vop_access_args /* {
127 struct vnode *a_vp;
128 int a_mode;
128 accmode_t a_accmode;
129 struct ucred *a_cred;
130 struct thread *a_td;
131 } */ *ap;
132{
133 struct vnode *vp = ap->a_vp;
134 struct iso_node *ip = VTOI(vp);
129 struct ucred *a_cred;
130 struct thread *a_td;
131 } */ *ap;
132{
133 struct vnode *vp = ap->a_vp;
134 struct iso_node *ip = VTOI(vp);
135 mode_t mode = ap->a_mode;
135 accmode_t accmode = ap->a_accmode;
136
137 if (vp->v_type == VCHR || vp->v_type == VBLK)
138 return (EOPNOTSUPP);
139
140 /*
141 * Disallow write attempts unless the file is a socket,
142 * fifo, or a block or character device resident on the
143 * filesystem.
144 */
136
137 if (vp->v_type == VCHR || vp->v_type == VBLK)
138 return (EOPNOTSUPP);
139
140 /*
141 * Disallow write attempts unless the file is a socket,
142 * fifo, or a block or character device resident on the
143 * filesystem.
144 */
145 if (mode & VWRITE) {
145 if (accmode & VWRITE) {
146 switch (vp->v_type) {
147 case VDIR:
148 case VLNK:
149 case VREG:
150 return (EROFS);
151 /* NOT REACHED */
152 default:
153 break;
154 }
155 }
156
157 return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid,
146 switch (vp->v_type) {
147 case VDIR:
148 case VLNK:
149 case VREG:
150 return (EROFS);
151 /* NOT REACHED */
152 default:
153 break;
154 }
155 }
156
157 return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid,
158 ip->inode.iso_gid, ap->a_mode, ap->a_cred, NULL));
158 ip->inode.iso_gid, ap->a_accmode, ap->a_cred, NULL));
159}
160
161static int
162cd9660_open(ap)
163 struct vop_open_args /* {
164 struct vnode *a_vp;
165 int a_mode;
166 struct ucred *a_cred;

--- 695 unchanged lines hidden ---
159}
160
161static int
162cd9660_open(ap)
163 struct vop_open_args /* {
164 struct vnode *a_vp;
165 int a_mode;
166 struct ucred *a_cred;

--- 695 unchanged lines hidden ---