Deleted Added
full compact
cd9660_vnops.c (37384) cd9660_vnops.c (43301)
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).

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
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).

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
39 * $Id: cd9660_vnops.c,v 1.52 1998/03/06 09:46:14 msmith Exp $
39 * $Id: cd9660_vnops.c,v 1.53 1998/07/04 20:45:30 julian Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/namei.h>
45#include <sys/kernel.h>
46#include <sys/stat.h>
47#include <sys/buf.h>

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

104 return (EISDIR);
105 case VLNK:
106 case VREG:
107 return (EROFS);
108 case VCHR:
109 case VBLK:
110 case VSOCK:
111 case VFIFO:
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/namei.h>
45#include <sys/kernel.h>
46#include <sys/stat.h>
47#include <sys/buf.h>

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

104 return (EISDIR);
105 case VLNK:
106 case VREG:
107 return (EROFS);
108 case VCHR:
109 case VBLK:
110 case VSOCK:
111 case VFIFO:
112 case VNON:
113 case VBAD:
112 return (0);
113 }
114 }
115 return (0);
116}
117
118/*
119 * Check mode permission on inode pointer. Mode is READ, WRITE or EXEC.

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

143 * file system.
144 */
145 if (mode & VWRITE) {
146 switch (vp->v_type) {
147 case VDIR:
148 case VLNK:
149 case VREG:
150 return (EROFS);
114 return (0);
115 }
116 }
117 return (0);
118}
119
120/*
121 * Check mode permission on inode pointer. Mode is READ, WRITE or EXEC.

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

145 * file system.
146 */
147 if (mode & VWRITE) {
148 switch (vp->v_type) {
149 case VDIR:
150 case VLNK:
151 case VREG:
152 return (EROFS);
153 /* NOT REACHED */
154 default:
155 break;
151 }
152 }
153
154 /* User id 0 always gets access. */
155 if (cred->cr_uid == 0)
156 return (0);
157
158 mask = 0;

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

357 idp->eofflag = 0;
358 return (-1);
359 }
360
361 *idp->cookies++ = off;
362 --idp->ncookies;
363 }
364
156 }
157 }
158
159 /* User id 0 always gets access. */
160 if (cred->cr_uid == 0)
161 return (0);
162
163 mask = 0;

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

362 idp->eofflag = 0;
363 return (-1);
364 }
365
366 *idp->cookies++ = off;
367 --idp->ncookies;
368 }
369
365 if (error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio))
370 if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0)
366 return (error);
367 idp->uio_off = off;
368 return (0);
369}
370
371int
372iso_shipdir(idp)
373 struct isoreaddir *idp;

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

391 dp = &idp->assocent;
392 sname = dp->d_name + 1;
393 sl = dp->d_namlen - 1;
394 }
395 if (sl > 0) {
396 if (sl != cl
397 || bcmp(sname,cname,sl)) {
398 if (idp->assocent.d_namlen) {
371 return (error);
372 idp->uio_off = off;
373 return (0);
374}
375
376int
377iso_shipdir(idp)
378 struct isoreaddir *idp;

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

396 dp = &idp->assocent;
397 sname = dp->d_name + 1;
398 sl = dp->d_namlen - 1;
399 }
400 if (sl > 0) {
401 if (sl != cl
402 || bcmp(sname,cname,sl)) {
403 if (idp->assocent.d_namlen) {
399 if (error = iso_uiodir(idp,&idp->assocent,idp->assocoff))
404 if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0)
400 return (error);
401 idp->assocent.d_namlen = 0;
402 }
403 if (idp->saveent.d_namlen) {
405 return (error);
406 idp->assocent.d_namlen = 0;
407 }
408 if (idp->saveent.d_namlen) {
404 if (error = iso_uiodir(idp,&idp->saveent,idp->saveoff))
409 if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0)
405 return (error);
406 idp->saveent.d_namlen = 0;
407 }
408 }
409 }
410 idp->current.d_reclen = GENERIC_DIRSIZ(&idp->current);
411 if (assoc) {
412 idp->assocoff = idp->curroff;

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

487 /*
488 * If offset is on a block boundary,
489 * read the next directory block.
490 * Release previous if it exists.
491 */
492 if ((idp->curroff & bmask) == 0) {
493 if (bp != NULL)
494 brelse(bp);
410 return (error);
411 idp->saveent.d_namlen = 0;
412 }
413 }
414 }
415 idp->current.d_reclen = GENERIC_DIRSIZ(&idp->current);
416 if (assoc) {
417 idp->assocoff = idp->curroff;

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

492 /*
493 * If offset is on a block boundary,
494 * read the next directory block.
495 * Release previous if it exists.
496 */
497 if ((idp->curroff & bmask) == 0) {
498 if (bp != NULL)
499 brelse(bp);
495 if (error =
496 cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))
500 if ((error =
501 cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0)
497 break;
498 entryoffsetinblock = 0;
499 }
500 /*
501 * Get pointer to next entry.
502 */
503 ep = (struct iso_directory_record *)
504 ((char *)bp->b_data + entryoffsetinblock);

--- 411 unchanged lines hidden ---
502 break;
503 entryoffsetinblock = 0;
504 }
505 /*
506 * Get pointer to next entry.
507 */
508 ep = (struct iso_directory_record *)
509 ((char *)bp->b_data + entryoffsetinblock);

--- 411 unchanged lines hidden ---