Deleted Added
sdiff udiff text old ( 22990 ) new ( 23680 )
full compact
1/*
2 * Copyright (c) 1992, 1993, 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 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
39 */
40
41#ifndef lint
42static char copyright[] =
43"@(#) Copyright (c) 1992, 1993, 1994\n\
44 The Regents of the University of California. All rights reserved.\n";
45#endif /* not lint */
46
47#ifndef lint
48/*
49static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95";
50*/
51static const char rcsid[] =
52 "$Id: mount_cd9660.c,v 1.9 1997/02/22 14:32:44 peter Exp $";
53#endif /* not lint */
54
55#include <sys/param.h>
56#include <sys/mount.h>
57#include <sys/../isofs/cd9660/cd9660_mount.h>
58
59#include <err.h>
60#include <stdlib.h>
61#include <stdio.h>
62#include <string.h>
63#include <sysexits.h>
64#include <unistd.h>
65

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

79int
80main(argc, argv)
81 int argc;
82 char **argv;
83{
84 struct iso_args args;
85 int ch, mntflags, opts;
86 char *dev, *dir;
87 struct vfsconf vfc;
88 int error;
89
90 mntflags = opts = 0;
91 while ((ch = getopt(argc, argv, "ego:r")) != EOF)
92 switch (ch) {
93 case 'e':
94 opts |= ISOFSMNT_EXTATT;
95 break;
96 case 'g':

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

111
112 if (argc != 2)
113 usage();
114
115 dev = argv[0];
116 dir = argv[1];
117
118#define DEFAULT_ROOTUID -2
119 /*
120 * ISO 9660 filesystems are not writeable.
121 */
122 mntflags |= MNT_RDONLY;
123 args.export.ex_flags = MNT_EXRDONLY;
124 args.fspec = dev;
125 args.export.ex_root = DEFAULT_ROOTUID;
126 args.flags = opts;
127
128 error = getvfsbyname("cd9660", &vfc);
129 if (error && vfsisloadable("cd9660")) {
130 if (vfsload("cd9660"))
131 err(EX_OSERR, "vfsload(cd9660)");
132 endvfsent(); /* flush cache */
133 error = getvfsbyname("cd9660", &vfc);
134 }
135 if (error)
136 errx(1, "cd9660 filesystem is not available");
137
138 if (mount(vfc.vfc_name, dir, mntflags, &args) < 0)
139 err(1, NULL);
140 exit(0);
141}
142
143void
144usage()
145{
146 (void)fprintf(stderr,
147 "usage: mount_cd9660 [-egrt] [-o options] special node\n");
148 exit(EX_USAGE);
149}