diff --git a/sbin/Makefile b/sbin/Makefile index bedcd449af74..5c4a89137edb 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -9,6 +9,7 @@ SUBDIR= adjkerntz \ camcontrol \ ccdconfig \ clri \ + comcontrol \ dhclient \ disklabel \ dmesg \ @@ -34,6 +35,7 @@ SUBDIR= adjkerntz \ mount \ mount_cd9660 \ mount_ext2fs \ + mount_msdos \ mount_nfs \ mount_ntfs \ mount_null \ diff --git a/sbin/i386/Makefile b/sbin/i386/Makefile index e61ecf35d5e0..3335157b30ee 100644 --- a/sbin/i386/Makefile +++ b/sbin/i386/Makefile @@ -1,8 +1,6 @@ # $FreeBSD$ -SUBDIR= comcontrol \ - fdisk \ - mount_msdos \ +SUBDIR= fdisk \ nextboot #NOTYET: cxconfig diff --git a/sbin/i386/comcontrol/Makefile b/sbin/i386/comcontrol/Makefile deleted file mode 100644 index abc8d0a7f81f..000000000000 --- a/sbin/i386/comcontrol/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# @(#)Makefile 5.4 (Berkeley) 6/5/91 - -PROG= comcontrol -MAN8= comcontrol.8 - -.include diff --git a/sbin/i386/comcontrol/comcontrol.8 b/sbin/i386/comcontrol/comcontrol.8 deleted file mode 100644 index 4b12b6e0be0c..000000000000 --- a/sbin/i386/comcontrol/comcontrol.8 +++ /dev/null @@ -1,62 +0,0 @@ -.\" $FreeBSD$ -.Dd May 15, 1994 -.Dt COMCONTROL 8 -.Os FreeBSD -.Sh NAME -.Nm comcontrol -.Nd control an sio device. -.Sh SYNOPSIS -.Nm comcontrol -.Ar sio_special_device -.Op options -.Sh DESCRIPTION -.Nm Comcontrol -is used to examine and modify some of the special characteristics -of the specified sio device. -If no arguments other than the device are specified, -it prints the settings of all controllable characteristics. -This usage requires only read access on the device. -Only the superuser can change the settings. -.Pp -The following options are available: -.Bl -tag -width indent -.It Cm dtrwait Ar number -Set the time to wait after dropping DTR -to the given number. -The units are hundredths of a second. -The default is 300 hundredths, i.e., 3 seconds. -This option needed mainly to set proper recover time after -modem reset. -.It Cm drainwait Ar number -Set the time to wait for output drain -to the given number. -The units are seconds. -The default is 0, i.e. wait forever. -This option needed mainly to specify upper limit of minutes -to prevent modem hanging. -.El -.Pp -The standard way to use -.Nm -is to put invocations of it in the -.Pa /etc/rc.serial -startup script. -.Sh SEE ALSO -.Xr stty 1 , -.Xr sio 4 -.Sh FILES -.Bl -tag -width /dev/ttyd? -compact -.It Pa /dev/ttyd? -dialin devices, hardwired terminals -.It Pa /dev/cuaa? -dialout devices -.Sh AUTHORS -.An Christopher G. Demetriou -.Sh BUGS -.Nm Comcontrol -should be named -.Nm siocontrol . -.Sh HISTORY -Originally part of cgd's com package patches, version 0.2.1, to 386BSD 0.1. -Once controlled bidirectional capabilities. Little is left to control now -that these capabilities are standard. diff --git a/sbin/i386/comcontrol/comcontrol.c b/sbin/i386/comcontrol/comcontrol.c deleted file mode 100644 index 671551e07d60..000000000000 --- a/sbin/i386/comcontrol/comcontrol.c +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * Copyright (c) 1992 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. The name of the author may not be used to endorse or promote - * products derived from this software without specific 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 REGENTS OR CONTRIBUTORS 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 -#include -#include -#include -#include -#include -#include -#include - -static void -usage() -{ - fprintf(stderr, - "usage: comcontrol [dtrwait ] [drainwait ]\n"); - exit(1); -} - -int -main(int argc, char *argv[]) -{ - int fd; - int res = 0; - int dtrwait = -1, drainwait = -1; - - if (argc < 2) - usage(); - - fd = open(argv[1], O_RDONLY|O_NONBLOCK, 0); - if (fd < 0) { - warn("couldn't open file %s", argv[1]); - return 1; - } - - if (argc == 2) { - if (ioctl(fd, TIOCMGDTRWAIT, &dtrwait) < 0) { - res = 1; - warn("TIOCMGDTRWAIT"); - } - if (ioctl(fd, TIOCGDRAINWAIT, &drainwait) < 0) { - res = 1; - warn("TIOCGDRAINWAIT"); - } - printf("dtrwait %d drainwait %d\n", dtrwait, drainwait); - } else { - while (argv[2] != NULL) { - if (!strcmp(argv[2],"dtrwait")) { - if (dtrwait >= 0) - usage(); - if (argv[3] == NULL || !isdigit(argv[3][0])) - usage(); - dtrwait = atoi(argv[3]); - argv += 2; - } else if (!strcmp(argv[2],"drainwait")) { - if (drainwait >= 0) - usage(); - if (argv[3] == NULL || !isdigit(argv[3][0])) - usage(); - drainwait = atoi(argv[3]); - argv += 2; - } else - usage(); - } - if (dtrwait >= 0) { - if (ioctl(fd, TIOCMSDTRWAIT, &dtrwait) < 0) { - res = 1; - warn("TIOCMSDTRWAIT"); - } - } - if (drainwait >= 0) { - if (ioctl(fd, TIOCSDRAINWAIT, &drainwait) < 0) { - res = 1; - warn("TIOCSDRAINWAIT"); - } - } - } - - close(fd); - return res; -} diff --git a/sbin/i386/mount_msdos/Makefile b/sbin/i386/mount_msdos/Makefile deleted file mode 100644 index 59c337ed9b6a..000000000000 --- a/sbin/i386/mount_msdos/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# -# $FreeBSD$ -# - -PROG= mount_msdos -SRCS= mount_msdos.c getmntopts.c -MAN8= mount_msdos.8 -DPADD= ${LIBUTIL} -LDADD= -lutil - -MOUNT= ${.CURDIR}/../../mount -CFLAGS+= -I${MOUNT} -.PATH: ${MOUNT} - -TABDIR= ${DESTDIR}/usr/libdata/msdosfs -TABLES= iso22dos koi2dos - -afterinstall: - cd ${.CURDIR} && \ - ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE} \ - ${TABLES} ${TABDIR} - -.include diff --git a/sbin/i386/mount_msdos/iso22dos b/sbin/i386/mount_msdos/iso22dos deleted file mode 100644 index 1f48193e473e..000000000000 --- a/sbin/i386/mount_msdos/iso22dos +++ /dev/null @@ -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 diff --git a/sbin/i386/mount_msdos/koi2dos b/sbin/i386/mount_msdos/koi2dos deleted file mode 100644 index 4adb4259a26c..000000000000 --- a/sbin/i386/mount_msdos/koi2dos +++ /dev/null @@ -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 diff --git a/sbin/i386/mount_msdos/mount_msdos.8 b/sbin/i386/mount_msdos/mount_msdos.8 deleted file mode 100644 index 8e36e22d9a17..000000000000 --- a/sbin/i386/mount_msdos/mount_msdos.8 +++ /dev/null @@ -1,213 +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 mount_msdos -.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 Ns . diff --git a/sbin/i386/mount_msdos/mount_msdos.c b/sbin/i386/mount_msdos/mount_msdos.c deleted file mode 100644 index d2bcb2632e8b..000000000000 --- a/sbin/i386/mount_msdos/mount_msdos.c +++ /dev/null @@ -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 -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -/* must be after stdio to declare fparseln */ -#include -#include -#include -#include -#include - -#include "mntopts.h" - -/* - * XXX - no way to specify "foo="-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, name); - for (i = 0; i < 128; i++) { - pargs->ul[i] = tolower(i | 0x80); - pargs->lu[i] = toupper(i | 0x80); - } -}