- VFS_SET(msdos) -> VFS_SET(msdosfs)

- msdos.ko -> msdosfs.ko
- mount_msdos(8) -> mount_msdosfs(8)
- "msdos" -> "msdosfs" compatibility glue in mount(8)
This commit is contained in:
Ruslan Ermilov 2001-06-01 10:57:26 +00:00
parent 1a4a063934
commit 4ccd754686
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77577
16 changed files with 23 additions and 712 deletions

View file

@ -43,7 +43,7 @@ SUBDIR= adjkerntz \
mount_cd9660 \
mount_ext2fs \
mount_ifs \
mount_msdos \
mount_msdosfs \
mount_nfs \
mount_ntfs \
mount_nullfs \

View file

@ -166,7 +166,7 @@ time, while its absence indicates a UTC CMOS clock.
.Sh SEE ALSO
.Xr tzset 3 ,
.Xr crontab 5 ,
.Xr mount_msdos 8 ,
.Xr mount_msdosfs 8 ,
.Xr rc 8 ,
.Xr sysctl 8 ,
.Xr tzsetup 8 ,

View file

@ -374,7 +374,7 @@ file system table
.Xr mount_fdescfs 8 ,
.Xr mount_hpfs 8 ,
.Xr mount_linprocfs 8 ,
.Xr mount_msdos 8 ,
.Xr mount_msdosfs 8 ,
.Xr mount_nfs 8 ,
.Xr mount_ntfs 8 ,
.Xr mount_nullfs 8 ,

View file

@ -419,6 +419,10 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
if (flags & MNT_UPDATE)
optbuf = catopt(optbuf, "update");
/* Compatibility glue. */
if (strcmp(vfstype, "msdos") == 0)
vfstype = "msdosfs";
argc = 0;
argv[argc++] = vfstype;
mangle(optbuf, &argc, argv);

View file

@ -1,23 +0,0 @@
#
# $FreeBSD$
#
PROG= mount_msdos
SRCS= mount_msdos.c getmntopts.c
MAN= mount_msdos.8
DPADD= ${LIBUTIL}
LDADD= -lutil
MOUNT= ${.CURDIR}/../mount
CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}
TABDIR= ${DESTDIR}${LIBDATADIR}/msdosfs
TABLES= iso22dos koi2dos
afterinstall:
cd ${.CURDIR} && \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE} \
${TABLES} ${TABDIR}
.include <bsd.prog.mk>

View file

@ -1,58 +0,0 @@
# $FreeBSD$
#
# u2w: 16 rows of Latin2 -> Unicode conversion table (upper half)
#
0x0080 0x0081 0x0082 0x0083 0x0084 0x0085 0x0086 0x0087
0x0088 0x0089 0x008a 0x008b 0x008c 0x008d 0x008e 0x008f
0x0090 0x0091 0x0092 0x0093 0x0094 0x0095 0x0096 0x0097
0x0098 0x0099 0x009a 0x009b 0x009c 0x009d 0x009e 0x009f
0x00a0 0x0104 0x02d8 0x0141 0x00a4 0x013d 0x015a 0x00a7
0x00a8 0x0160 0x015e 0x0164 0x0179 0x00ad 0x017d 0x017b
0x00b0 0x0105 0x02db 0x0142 0x00b4 0x013e 0x015b 0x02c7
0x00b8 0x0161 0x015f 0x0165 0x017a 0x02dd 0x017e 0x017c
0x0154 0x00c1 0x00c2 0x0102 0x00c4 0x0139 0x0106 0x00c7
0x010c 0x00c9 0x0118 0x00cb 0x011a 0x00cd 0x00ce 0x010e
0x0110 0x0143 0x0147 0x00d3 0x00d4 0x0150 0x00d6 0x00d7
0x0158 0x016e 0x00da 0x0170 0x00dc 0x00dd 0x0162 0x00df
0x0155 0x00e1 0x00e2 0x0103 0x00e4 0x013a 0x0107 0x00e7
0x010d 0x00e9 0x0119 0x00eb 0x011b 0x00ed 0x00ee 0x010f
0x0111 0x0144 0x0148 0x00f3 0x00f4 0x0151 0x00f6 0x00f7
0x0159 0x016f 0x00fa 0x0171 0x00fc 0x00fd 0x0163 0x02d9
#
# d2u: 16 rows of CP852 -> Latin2 conversion table (upper half)
#
0xc7 0xfc 0xe9 0xe2 0xe4 0xf9 0xe6 0xe7
0xb3 0xeb 0xd5 0xf5 0xee 0xac 0xc4 0xc6
0xc9 0xc5 0xe5 0xf4 0xf6 0xa5 0xb5 0xa6
0xb6 0xd6 0xdc 0xab 0xbb 0xa3 0xd7 0xe8
0xe1 0xed 0xf3 0xfa 0xa1 0xb1 0xae 0xbe
0xca 0xea 0x3f 0xbc 0xc8 0xba 0x3f 0x3f
0x3f 0x3f 0x3f 0x3f 0x3f 0xc1 0xc2 0xcc
0xaa 0x3f 0x3f 0x3f 0x3f 0xaf 0xbf 0x3f
0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0xc3 0xe3
0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0xa4
0xf0 0xd0 0xcf 0xcb 0xef 0xd2 0xcd 0xce
0xec 0x3f 0x3f 0x3f 0x3f 0xde 0xd9 0x3f
0xd3 0xdf 0xd4 0xd1 0xf1 0xf2 0xa9 0xb9
0xc0 0xda 0xe0 0xdb 0xfd 0xdd 0xfe 0xb4
0xad 0xbd 0xb2 0xb7 0xa2 0xa7 0xf7 0xb8
0xb0 0xa8 0xff 0xfb 0xd8 0xf8 0x3f 0xa0
#
# u2d: 16 rows of Latin2 -> CP852 conversion table (upper half)
#
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0xff 0xa4 0xf4 0x9d 0xcf 0x95 0x97 0xf5
0xf9 0xe6 0xb8 0x9b 0x8d 0xf0 0xa6 0xbd
0xf8 0xa5 0xf2 0x88 0xef 0x96 0x98 0xf3
0xf7 0xe7 0xad 0x9c 0xab 0xf1 0xa7 0xbe
0xe8 0xb5 0xb6 0xc6 0x8e 0x91 0x8f 0x80
0xac 0x90 0xa8 0xd3 0xb7 0xd6 0xd7 0xd2
0xd1 0xe3 0xd5 0xe0 0xe2 0x8a 0x99 0x9e
0xfc 0xde 0xe9 0xeb 0x9a 0xed 0xdd 0xe1
0xea 0xa0 0x83 0xc7 0x84 0x92 0x86 0x87
0x9f 0x82 0xa9 0x89 0xd8 0xa1 0x8c 0xd4
0xd0 0xe4 0xe5 0xa2 0x93 0x8b 0x94 0xf6
0xfd 0x85 0xa3 0xfb 0x81 0xec 0xee 0xfa

View file

@ -1,58 +0,0 @@
# $FreeBSD$
#
# u2w: 16 rows of KOI8-R -> Unicode conversion table (upper half)
#
0x2500 0x2502 0x250c 0x2510 0x2514 0x2518 0x251c 0x2524
0x252c 0x2534 0x253c 0x2580 0x2584 0x2588 0x258c 0x2590
0x2591 0x2592 0x2593 0x2320 0x25a0 0x2219 0x221a 0x2248
0x2264 0x2265 0x00a0 0x2321 0x00b0 0x00b2 0x00b7 0x00f7
0x2550 0x2551 0x2552 0x0451 0x2553 0x2554 0x2555 0x2556
0x2557 0x2558 0x2559 0x255a 0x255b 0x255c 0x255d 0x255e
0x255f 0x2560 0x2561 0x0401 0x2562 0x2563 0x2564 0x2565
0x2566 0x2567 0x2568 0x2569 0x256a 0x256b 0x256c 0x00a9
0x044e 0x0430 0x0431 0x0446 0x0434 0x0435 0x0444 0x0433
0x0445 0x0438 0x0439 0x043a 0x043b 0x043c 0x043d 0x043e
0x043f 0x044f 0x0440 0x0441 0x0442 0x0443 0x0436 0x0432
0x044c 0x044b 0x0437 0x0448 0x044d 0x0449 0x0447 0x044a
0x042e 0x0410 0x0411 0x0426 0x0414 0x0415 0x0424 0x0413
0x0425 0x0418 0x0419 0x041a 0x041b 0x041c 0x041d 0x041e
0x041f 0x042f 0x0420 0x0421 0x0422 0x0423 0x0416 0x0412
0x042c 0x042b 0x0417 0x0428 0x042d 0x0429 0x0427 0x042a
#
# d2u: 16 rows of CP866 -> KOI8-R conversion table (upper half)
#
0xe1 0xe2 0xf7 0xe7 0xe4 0xe5 0xf6 0xfa
0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0
0xf2 0xf3 0xf4 0xf5 0xe6 0xe8 0xe3 0xfe
0xfb 0xfd 0xff 0xf9 0xf8 0xfc 0xe0 0xf1
0xc1 0xc2 0xd7 0xc7 0xc4 0xc5 0xd6 0xda
0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0
0x90 0x91 0x92 0x81 0x87 0xb2 0xb4 0xa7
0xa6 0xb5 0xa1 0xa8 0xae 0xad 0xac 0x83
0x84 0x89 0x88 0x86 0x80 0x8a 0xaf 0xb0
0xab 0xa5 0xbb 0xb8 0xb1 0xa0 0xbe 0xb9
0xba 0xb6 0xb7 0xaa 0xa9 0xa2 0xa4 0xbd
0xbc 0x85 0x82 0x8d 0x8c 0x8e 0x8f 0x8b
0xd2 0xd3 0xd4 0xd5 0xc6 0xc8 0xc3 0xde
0xdb 0xdd 0xdf 0xd9 0xd8 0xdc 0xc0 0xd1
0xb3 0xa3 229 197 73 105 245 213
0x9c 0x95 0x9e 0x96 78 210 0x94 0x9a
#
# u2d: 16 rows of KOI8-R -> CP866 conversion table (upper half)
#
0xc4 0xb3 0xda 0xbf 0xc0 0xd9 0xc3 0xb4
0xc2 0xc1 0xc5 0xdf 0xdc 0xdb 0xdd 0xde
0xb0 0xb1 0xb2 179 0xfe 0xf9 0xfb 61
60 62 0xff 179 0xf8 50 0xfa 58
0xcd 0xba 0xd5 0xf1 0xd6 0xc9 0xb8 0xb7
0xbb 0xd4 0xd3 0xc8 0xbe 0xbd 0xbc 0xc6
0xc7 0xcc 0xb5 0xf0 0xb6 0xb9 0xd1 0xd2
0xcb 0xcf 0xd0 0xca 0xd8 0xd7 0xce 99
0xee 0xa0 0xa1 0xe6 0xa4 0xa5 0xe4 0xa3
0xe5 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae
0xaf 0xef 0xe0 0xe1 0xe2 0xe3 0xa6 0xa2
0xec 0xeb 0xa7 0xe8 0xed 0xe9 0xe7 0xea
0x9e 0x80 0x81 0x96 0x84 0x85 0x94 0x83
0x95 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e
0x8f 0x9f 0x90 0x91 0x92 0x93 0x86 0x82
0x9c 0x9b 0x87 0x98 0x9d 0x99 0x97 0x9a

View file

@ -1,215 +0,0 @@
.\" $NetBSD: mount_msdos.8,v 1.13 1998/02/06 05:57:00 perry Exp $
.\"
.\" Copyright (c) 1993,1994 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgment:
.\" This product includes software developed by Christopher G. Demetriou.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd April 7, 1994
.Dt MOUNT_MSDOS 8
.Os
.Sh NAME
.Nm mount_msdos
.Nd mount an MS-DOS file system
.Sh SYNOPSIS
.Nm
.Op Fl o Ar options
.Op Fl u Ar uid
.Op Fl g Ar gid
.Op Fl m Ar mask
.Op Fl s
.Op Fl l
.Op Fl 9
.\".Op Fl G
.Op Fl L Ar locale
.Op Fl W Ar table
.Pa special
.Pa node
.Sh DESCRIPTION
The
.Nm
command attaches the MS-DOS filesystem residing on
the device
.Pa special
to the global filesystem namespace at the location
indicated by
.Pa node .
This command is normally executed by
.Xr mount 8
at boot time, but can be used by any user to mount an
MS-DOS file system on any directory that they own (provided,
of course, that they have appropriate access to the device that
contains the file system).
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl o Ar options
Use the specified mount
.Ar options ,
as described in
.Xr mount 8 ,
or one of the MSDOS filesystem-specific options
.Ar shortnames ,
.Ar longnames
or
.Ar nowin95 ,
all of which can be used to affect Windows name translation in the
underlying filesystem.
.It Fl u Ar uid
Set the owner of the files in the file system to
.Ar uid .
The default owner is the owner of the directory
on which the file system is being mounted.
.It Fl g Ar gid
Set the group of the files in the file system to
.Ar gid .
The default group is the group of the directory
on which the file system is being mounted.
.It Fl m Ar mask
Specify the maximum file permissions for files
in the file system.
(For example, a
.Ar mask
of
.Li 755
specifies that, by default, the owner should have
read, write, and execute permissions for files, but
others should only have read and execute permissions.
See
.Xr chmod 1
for more information about octal file modes.)
Only the nine low-order bits of
.Ar mask
are used.
The default
.Ar mask
is taken from the
directory on which the file system is being mounted.
.It Fl s
Force behaviour to
ignore and not generate Win'95 long filenames.
.It Fl l
Force listing and generation of
Win'95 long filenames
and separate creation/modification/access dates.
.Pp
If neither
.Fl s
nor
.Fl l
are given,
.Nm
searches the root directory of the filesystem to
be mounted for any existing Win'95 long filenames.
If no such entries are found, but short DOS filenames are found,
.Fl s
is the default.
Otherwise
.Fl l
is assumed.
.It Fl 9
Ignore the special Win'95 directory entries even
if deleting or renaming a file.
This forces
.Fl s .
.\".It Fl G
.\"This option causes the filesystem to be interpreted as an Atari-Gemdos
.\"filesystem. The differences to the MS-DOS filesystem are minimal and
.\"limited to the boot block. This option enforces
.\".Fl s .
.It Fl L Ar locale
Specify locale name used for internal uppercase and lowercase conversions
for DOS and Win'95 names.
By default ISO 8859-1 assumed as local character set.
.It Fl W Ar table
Specify text file with 3 conversion tables:
.Bl -enum
.It
Local character set to Unicode conversion table (upper half) for Win'95 long
names, 128 Unicode codes separated by 8 per row.
If some code not present in Unicode, use
0x003F code ('?') as replacement.
.It
DOS to local character set conversion table (upper half) for DOS names,
128 character codes separated by 8 per row.
Code 0x3F ('?') used for impossible translations.
.It
Local character set to DOS conversion table (upper half) for DOS names,
128 character codes separated by 8 per row.
Some codes have special meaning:
.Bl -hang
.It 0x00
character disallowed in DOS file name;
.It 0x01
character should be replaced by '_' in DOS file name;
.It 0x02
character should be skipped in DOS file name;
.El
.El
.Pp
By default ISO 8859-1 assumed as local character set.
If file path isn't absolute,
.Pa /usr/libdata/msdosfs/
prefix prepended.
.El
.Sh FILES
.Bl -tag -width /usr/libdata/msdosfs -compact
.It Pa /usr/libdata/msdosfs
default place for character sets conversion tables
.El
.Sh SEE ALSO
.Xr mount 2 ,
.Xr unmount 2 ,
.Xr fstab 5 ,
.Xr mount 8
.Sh CAVEATS
The use of the
.Fl 9
flag could result in damaged filesystems,
albeit the damage is in part taken care of by
procedures similar to the ones used in Win'95.
.Pp
.Fx 2.1
and earlier versions could not handle cluster sizes larger than 16K.
Just mounting an MS-DOS file system could cause corruption to any
mounted file system.
Cluster sizes larger than 16K are unavoidable for file system sizes
larger than 1G, and also occur when filesystems larger than 1G are
shrunk to smaller than 1G using FIPS.
.Sh HISTORY
The
.Nm
utility first appeared in
.Fx 2.0 .
Its predecessor, the
.Nm mount_pcfs
utility appeared in
.Fx 1.0 ,
and was abandoned in favor
of the more aptly-named
.Nm .

View file

@ -1,339 +0,0 @@
/* $NetBSD: mount_msdos.c,v 1.18 1997/09/16 12:24:18 lukem Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <fs/msdosfs/msdosfsmount.h>
#include <ctype.h>
#include <err.h>
#include <grp.h>
#include <locale.h>
#include <pwd.h>
#include <stdio.h>
/* must be after stdio to declare fparseln */
#include <libutil.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
#include "mntopts.h"
/*
* XXX - no way to specify "foo=<bar>"-type options; that's what we'd
* want for "-u", "-g", "-m", "-L", and "-W".
*/
static struct mntopt mopts[] = {
MOPT_STDOPTS,
MOPT_FORCE,
MOPT_SYNC,
MOPT_UPDATE,
#ifdef MSDOSFSMNT_GEMDOSFS
{ "gemdosfs", 0, MSDOSFSMNT_GEMDOSFS, 1 },
#endif
{ "shortnames", 0, MSDOSFSMNT_SHORTNAME, 1 },
{ "longnames", 0, MSDOSFSMNT_LONGNAME, 1 },
{ "nowin95", 0, MSDOSFSMNT_NOWIN95, 1 },
{ NULL }
};
static gid_t a_gid __P((char *));
static uid_t a_uid __P((char *));
static mode_t a_mask __P((char *));
static void usage __P((void)) __dead2;
static void load_u2wtable __P((struct msdosfs_args *, char *));
static void load_ultable __P((struct msdosfs_args *, char *));
int
main(argc, argv)
int argc;
char **argv;
{
struct msdosfs_args args;
struct stat sb;
int c, error, mntflags, set_gid, set_uid, set_mask;
char *dev, *dir, mntpath[MAXPATHLEN];
struct vfsconf vfc;
mntflags = set_gid = set_uid = set_mask = 0;
(void)memset(&args, '\0', sizeof(args));
args.magic = MSDOSFS_ARGSMAGIC;
while ((c = getopt(argc, argv, "sl9u:g:m:o:L:W:")) != -1) {
switch (c) {
#ifdef MSDOSFSMNT_GEMDOSFS
case 'G':
args.flags |= MSDOSFSMNT_GEMDOSFS;
break;
#endif
case 's':
args.flags |= MSDOSFSMNT_SHORTNAME;
break;
case 'l':
args.flags |= MSDOSFSMNT_LONGNAME;
break;
case '9':
args.flags |= MSDOSFSMNT_NOWIN95;
break;
case 'u':
args.uid = a_uid(optarg);
set_uid = 1;
break;
case 'g':
args.gid = a_gid(optarg);
set_gid = 1;
break;
case 'm':
args.mask = a_mask(optarg);
set_mask = 1;
break;
case 'L':
load_ultable(&args, optarg);
args.flags |= MSDOSFSMNT_ULTABLE;
break;
case 'W':
load_u2wtable(&args, optarg);
args.flags |= MSDOSFSMNT_U2WTABLE;
break;
case 'o':
getmntopts(optarg, mopts, &mntflags, &args.flags);
break;
case '?':
default:
usage();
break;
}
}
if (optind + 2 != argc)
usage();
dev = argv[optind];
dir = argv[optind + 1];
/*
* Resolve the mountpoint with realpath(3) and remove unnecessary
* slashes from the devicename if there are any.
*/
(void)checkpath(dir, mntpath);
(void)rmslashes(dev, dev);
args.fspec = dev;
args.export.ex_root = -2; /* unchecked anyway on DOS fs */
if (mntflags & MNT_RDONLY)
args.export.ex_flags = MNT_EXRDONLY;
else
args.export.ex_flags = 0;
if (!set_gid || !set_uid || !set_mask) {
if (stat(mntpath, &sb) == -1)
err(EX_OSERR, "stat %s", mntpath);
if (!set_uid)
args.uid = sb.st_uid;
if (!set_gid)
args.gid = sb.st_gid;
if (!set_mask)
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
}
error = getvfsbyname("msdos", &vfc);
if (error && vfsisloadable("msdos")) {
if (vfsload("msdos"))
err(EX_OSERR, "vfsload(msdos)");
endvfsent(); /* clear cache */
error = getvfsbyname("msdos", &vfc);
}
if (error)
errx(EX_OSERR, "msdos filesystem is not available");
if (mount(vfc.vfc_name, mntpath, mntflags, &args) < 0)
err(EX_OSERR, "%s", dev);
exit (0);
}
gid_t
a_gid(s)
char *s;
{
struct group *gr;
char *gname;
gid_t gid;
if ((gr = getgrnam(s)) != NULL)
gid = gr->gr_gid;
else {
for (gname = s; *s && isdigit(*s); ++s);
if (!*s)
gid = atoi(gname);
else
errx(EX_NOUSER, "unknown group id: %s", gname);
}
return (gid);
}
uid_t
a_uid(s)
char *s;
{
struct passwd *pw;
char *uname;
uid_t uid;
if ((pw = getpwnam(s)) != NULL)
uid = pw->pw_uid;
else {
for (uname = s; *s && isdigit(*s); ++s);
if (!*s)
uid = atoi(uname);
else
errx(EX_NOUSER, "unknown user id: %s", uname);
}
return (uid);
}
mode_t
a_mask(s)
char *s;
{
int done, rv;
char *ep;
done = 0;
rv = -1;
if (*s >= '0' && *s <= '7') {
done = 1;
rv = strtol(optarg, &ep, 8);
}
if (!done || rv < 0 || *ep)
errx(EX_USAGE, "invalid file mode: %s", s);
return (rv);
}
void
usage()
{
fprintf(stderr, "%s\n%s\n",
"usage: mount_msdos [-o options] [-u user] [-g group] [-m mask]",
" [-s] [-l] [-9] [-L locale] [-W table] bdev dir");
exit(EX_USAGE);
}
void
load_u2wtable (pargs, name)
struct msdosfs_args *pargs;
char *name;
{
FILE *f;
int i, j, code[8];
size_t line = 0;
char buf[128];
char *fn, *s, *p;
if (*name == '/')
fn = name;
else {
snprintf(buf, sizeof(buf), "/usr/libdata/msdosfs/%s", name);
buf[127] = '\0';
fn = buf;
}
if ((f = fopen(fn, "r")) == NULL)
err(EX_NOINPUT, "%s", fn);
p = NULL;
for (i = 0; i < 16; i++) {
do {
if (p != NULL) free(p);
if ((p = s = fparseln(f, NULL, &line, NULL, 0)) == NULL)
errx(EX_DATAERR, "can't read u2w table row %d near line %d", i, line);
while (isspace((unsigned char)*s))
s++;
} while (*s == '\0');
if (sscanf(s, "%i%i%i%i%i%i%i%i",
code, code + 1, code + 2, code + 3, code + 4, code + 5, code + 6, code + 7) != 8)
errx(EX_DATAERR, "u2w table: missing item(s) in row %d, line %d", i, line);
for (j = 0; j < 8; j++)
pargs->u2w[i * 8 + j] = code[j];
}
for (i = 0; i < 16; i++) {
do {
free(p);
if ((p = s = fparseln(f, NULL, &line, NULL, 0)) == NULL)
errx(EX_DATAERR, "can't read d2u table row %d near line %d", i, line);
while (isspace((unsigned char)*s))
s++;
} while (*s == '\0');
if (sscanf(s, "%i%i%i%i%i%i%i%i",
code, code + 1, code + 2, code + 3, code + 4, code + 5, code + 6, code + 7) != 8)
errx(EX_DATAERR, "d2u table: missing item(s) in row %d, line %d", i, line);
for (j = 0; j < 8; j++)
pargs->d2u[i * 8 + j] = code[j];
}
for (i = 0; i < 16; i++) {
do {
free(p);
if ((p = s = fparseln(f, NULL, &line, NULL, 0)) == NULL)
errx(EX_DATAERR, "can't read u2d table row %d near line %d", i, line);
while (isspace((unsigned char)*s))
s++;
} while (*s == '\0');
if (sscanf(s, "%i%i%i%i%i%i%i%i",
code, code + 1, code + 2, code + 3, code + 4, code + 5, code + 6, code + 7) != 8)
errx(EX_DATAERR, "u2d table: missing item(s) in row %d, line %d", i, line);
for (j = 0; j < 8; j++)
pargs->u2d[i * 8 + j] = code[j];
}
free(p);
fclose(f);
}
void
load_ultable (pargs, name)
struct msdosfs_args *pargs;
char *name;
{
int i;
if (setlocale(LC_CTYPE, name) == NULL)
err(EX_CONFIG, "%s", name);
for (i = 0; i < 128; i++) {
pargs->ul[i] = tolower(i | 0x80);
pargs->lu[i] = toupper(i | 0x80);
}
}

View file

@ -2,9 +2,9 @@
# $FreeBSD$
#
PROG= mount_msdos
SRCS= mount_msdos.c getmntopts.c
MAN= mount_msdos.8
PROG= mount_msdosfs
SRCS= mount_msdosfs.c getmntopts.c
MAN= mount_msdosfs.8
DPADD= ${LIBUTIL}
LDADD= -lutil

View file

@ -31,10 +31,10 @@
.\" $FreeBSD$
.\"
.Dd April 7, 1994
.Dt MOUNT_MSDOS 8
.Dt MOUNT_MSDOSFS 8
.Os
.Sh NAME
.Nm mount_msdos
.Nm mount_msdosfs
.Nd mount an MS-DOS file system
.Sh SYNOPSIS
.Nm

View file

@ -173,12 +173,12 @@ main(argc, argv)
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
}
error = getvfsbyname("msdos", &vfc);
if (error && vfsisloadable("msdos")) {
if (vfsload("msdos"))
err(EX_OSERR, "vfsload(msdos)");
error = getvfsbyname("msdosfs", &vfc);
if (error && vfsisloadable("msdosfs")) {
if (vfsload("msdosfs"))
err(EX_OSERR, "vfsload(msdosfs)");
endvfsent(); /* clear cache */
error = getvfsbyname("msdos", &vfc);
error = getvfsbyname("msdosfs", &vfc);
}
if (error)
errx(EX_OSERR, "msdos filesystem is not available");
@ -251,8 +251,8 @@ void
usage()
{
fprintf(stderr, "%s\n%s\n",
"usage: mount_msdos [-o options] [-u user] [-g group] [-m mask]",
" [-s] [-l] [-9] [-L locale] [-W table] bdev dir");
"usage: mount_msdosfs [-o options] [-u user] [-g group] [-m mask]",
" [-s] [-l] [-9] [-L locale] [-W table] bdev dir");
exit(EX_USAGE);
}

View file

@ -942,7 +942,7 @@ get_exportlist()
} targs;
if (!strcmp(fsp->f_fstypename, "ufs") ||
!strcmp(fsp->f_fstypename, "msdos") ||
!strcmp(fsp->f_fstypename, "msdosfs") ||
!strcmp(fsp->f_fstypename, "ntfs") ||
!strcmp(fsp->f_fstypename, "cd9660")) {
targs.ua.fspec = NULL;

View file

@ -961,4 +961,4 @@ static struct vfsops msdosfs_vfsops = {
vfs_stdextattrctl,
};
VFS_SET(msdosfs_vfsops, msdos, 0);
VFS_SET(msdosfs_vfsops, msdosfs, 0);

View file

@ -2,7 +2,7 @@
.PATH: ${.CURDIR}/../../fs/msdosfs
KMOD= msdos
KMOD= msdosfs
SRCS= vnode_if.h \
msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c \
msdosfs_vfsops.c msdosfs_vnops.c

View file

@ -942,7 +942,7 @@ get_exportlist()
} targs;
if (!strcmp(fsp->f_fstypename, "ufs") ||
!strcmp(fsp->f_fstypename, "msdos") ||
!strcmp(fsp->f_fstypename, "msdosfs") ||
!strcmp(fsp->f_fstypename, "ntfs") ||
!strcmp(fsp->f_fstypename, "cd9660")) {
targs.ua.fspec = NULL;