diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/Makefile | 4 | ||||
-rw-r--r-- | sbin/mount/mount.8 | 5 | ||||
-rw-r--r-- | sbin/mount/mount.c | 13 | ||||
-rw-r--r-- | sbin/mount_ados/Makefile | 11 | ||||
-rw-r--r-- | sbin/mount_ados/mount_ados.8 | 124 | ||||
-rw-r--r-- | sbin/mount_ados/mount_ados.c | 194 | ||||
-rw-r--r-- | sbin/mountd/mountd.c | 5 |
7 files changed, 7 insertions, 349 deletions
diff --git a/sbin/Makefile b/sbin/Makefile index f207c62757c..17d41bc5dc8 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.83 2007/05/26 21:39:45 grunk Exp $ +# $OpenBSD: Makefile,v 1.84 2007/06/01 05:37:14 deraadt Exp $ SUBDIR= atactl badsect bioctl brconfig ccdconfig clri dhclient \ disklabel dmesg dump dumpfs fdisk fsck fsck_ext2fs fsck_ffs \ fsck_msdos fsdb fsirand growfs ifconfig init iopctl ipsecctl \ isakmpd kbd lmccontrol mknod modload modunload mount \ - mount_ados mount_cd9660 mount_ext2fs mount_ffs mount_msdos \ + mount_cd9660 mount_ext2fs mount_ffs mount_msdos \ mount_nfs mount_ntfs mount_portal mount_procfs mount_udf \ mount_vnd mount_xfs mountd ncheck_ffs newfs newfs_msdos \ nfsd nmeaattach nologin pdisk pfctl pflogd ping ping6 quotacheck \ diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index b870c0c94c0..53146950a1a 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount.8,v 1.61 2007/05/31 19:19:45 jmc Exp $ +.\" $OpenBSD: mount.8,v 1.62 2007/06/01 05:37:14 deraadt Exp $ .\" $NetBSD: mount.8,v 1.11 1995/07/12 06:23:21 cgd Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)mount.8 8.7 (Berkeley) 3/27/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: June 1 2007 $ .Dt MOUNT 8 .Os .Sh NAME @@ -360,7 +360,6 @@ with option .Xr mount 2 , .Xr fstab 5 , .Xr disklabel 8 , -.Xr mount_ados 8 , .Xr mount_cd9660 8 , .Xr mount_ext2fs 8 , .Xr mount_ffs 8 , diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 77b95f4f6aa..a64b98b50b6 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.c,v 1.44 2006/12/15 03:04:24 krw Exp $ */ +/* $OpenBSD: mount.c,v 1.45 2007/06/01 05:37:14 deraadt Exp $ */ /* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94"; #else -static char rcsid[] = "$OpenBSD: mount.c,v 1.44 2006/12/15 03:04:24 krw Exp $"; +static char rcsid[] = "$OpenBSD: mount.c,v 1.45 2007/06/01 05:37:14 deraadt Exp $"; #endif #endif /* not lint */ @@ -560,15 +560,6 @@ prmount(struct statfs *sf) header = getbsize(&headerlen, &blocksize); (void)printf("%s%s=%lu %s", !f++ ? " (" : ", ", "size", sf->mount_info.mfs_args.size / blocksize, header); - } else if (strcmp(sf->f_fstypename, MOUNT_ADOSFS) == 0) { - struct adosfs_args *adosfs_args = &sf->mount_info.adosfs_args; - - if (verbose || adosfs_args->uid || adosfs_args->gid) - (void)printf("%s%s=%u, %s=%u", !f++ ? " (" : ", ", - "uid", adosfs_args->uid, "gid", adosfs_args->gid); - if (verbose || adosfs_args->mask != 0755) - (void)printf("%s%s=0%o", !f++ ? " (" : ", ", - "mask", adosfs_args->mask); } else if (strcmp(sf->f_fstypename, MOUNT_MSDOS) == 0) { struct msdosfs_args *msdosfs_args = &sf->mount_info.msdosfs_args; diff --git a/sbin/mount_ados/Makefile b/sbin/mount_ados/Makefile index a185a6a77e4..e69de29bb2d 100644 --- a/sbin/mount_ados/Makefile +++ b/sbin/mount_ados/Makefile @@ -1,11 +0,0 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:37:06 deraadt Exp $ - -PROG= mount_ados -SRCS= mount_ados.c getmntopts.c -MAN= mount_ados.8 - -MOUNT= ${.CURDIR}/../mount -CFLAGS+= -I${MOUNT} -.PATH: ${MOUNT} - -.include <bsd.prog.mk> diff --git a/sbin/mount_ados/mount_ados.8 b/sbin/mount_ados/mount_ados.8 index 3f505625a52..e69de29bb2d 100644 --- a/sbin/mount_ados/mount_ados.8 +++ b/sbin/mount_ados/mount_ados.8 @@ -1,124 +0,0 @@ -.\" $OpenBSD: mount_ados.8,v 1.13 2007/05/31 19:19:45 jmc Exp $ -.\" $NetBSD: mount_ados.8,v 1.3 1995/03/18 14:57:09 cgd 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 acknowledgement: -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt MOUNT_ADOS 8 -.Os -.Sh NAME -.Nm mount_ados -.Nd mount an AmigaDOS file system -.Sh SYNOPSIS -.Nm mount_ados -.Op Fl g Ar gid -.Op Fl m Ar mask -.Op Fl o Ar options -.Op Fl u Ar uid -.Ar special -.Ar node -.Sh DESCRIPTION -The -.Nm -command attaches the AmigaDOS filesystem residing on -the device -.Ar special -to the global filesystem namespace at the location -indicated by -.Ar node . -This command is invoked by -.Xr mount 8 -when using the syntax -.Bd -ragged -offset 4n -.Nm mount Op options --t ados -.Ar special Ar node -.Ed -.Pp -The -.Ar special -device must correspond to a partition registered in the -.Xr disklabel 5 . -.Pp -.Xr mount 8 -is normally run at boot time, but can be used by any user to mount an -AmigaDOS 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 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 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 mask is taken from the -directory on which the file system is being mounted. -.It Fl o Ar options -Use the specified mount -.Ar options , -as described in -.Xr mount 8 . -.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. -.El -.Sh SEE ALSO -.Xr mount 2 , -.Xr disklabel 5 , -.Xr fstab 5 , -.Xr disklabel 8 , -.Xr mount 8 , -.Xr umount 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Nx 0.9 b. -.Sh CAVEATS -The -.Li ados -filesystem currently supports the Amiga fast file system. diff --git a/sbin/mount_ados/mount_ados.c b/sbin/mount_ados/mount_ados.c index 04ddef6924c..e69de29bb2d 100644 --- a/sbin/mount_ados/mount_ados.c +++ b/sbin/mount_ados/mount_ados.c @@ -1,194 +0,0 @@ -/* $OpenBSD: mount_ados.c,v 1.15 2007/03/20 03:45:54 tedu Exp $ */ -/* $NetBSD: mount_ados.c,v 1.5 1996/04/13 01:30:59 jtc 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 char rcsid[] = "$OpenBSD: mount_ados.c,v 1.15 2007/03/20 03:45:54 tedu Exp $"; -#endif /* not lint */ - -#include <sys/cdefs.h> -#include <sys/param.h> -#include <sys/mount.h> -#include <sys/stat.h> -#include <ctype.h> -#include <err.h> -#include <errno.h> -#include <grp.h> -#include <pwd.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include "mntopts.h" - -const struct mntopt mopts[] = { - MOPT_STDOPTS, - { NULL } -}; - -gid_t a_gid(char *); -uid_t a_uid(char *); -mode_t a_mask(char *); -void usage(void); - -int -main(int argc, char *argv[]) -{ - struct adosfs_args args; - struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask; - char *dev, dir[MAXPATHLEN]; - - mntflags = set_gid = set_uid = set_mask = 0; - (void)memset(&args, '\0', sizeof(args)); - - while ((c = getopt(argc, argv, "u:g:m:o:")) != -1) { - switch (c) { - 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 'o': - getmntopts(optarg, mopts, &mntflags); - break; - case '?': - default: - usage(); - break; - } - } - - if (optind + 2 != argc) - usage(); - - dev = argv[optind]; - if (realpath(argv[optind + 1], dir) == NULL) - err(1, "realpath %s", argv[optind + 1]); - - args.fspec = dev; - args.export_info.ex_root = -2; /* unchecked anyway on DOS fs */ - if (mntflags & MNT_RDONLY) - args.export_info.ex_flags = MNT_EXRDONLY; - else - args.export_info.ex_flags = 0; - if (!set_gid || !set_uid || !set_mask) { - if (stat(dir, &sb) == -1) - err(1, "stat %s", dir); - - 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); - } - - if (mount(MOUNT_ADOSFS, dir, mntflags, &args) < 0) { - if (errno == EOPNOTSUPP) - errx(1, "%s: Filesystem not supported by kernel", dir); - else - err(1, "%s", dir); - } - exit (0); -} - -gid_t -a_gid(char *s) -{ - struct group *gr; - char *gname; - gid_t gid; - - if ((gr = getgrnam(s)) != NULL) - gid = gr->gr_gid; - else { - for (gname = s; isdigit(*s); ++s); - if (!*s) - gid = atoi(gname); - else - errx(1, "unknown group id: %s", gname); - } - return (gid); -} - -uid_t -a_uid(char *s) -{ - struct passwd *pw; - char *uname; - uid_t uid; - - if ((pw = getpwnam(s)) != NULL) - uid = pw->pw_uid; - else { - for (uname = s; isdigit(*s); ++s); - if (!*s) - uid = atoi(uname); - else - errx(1, "unknown user id: %s", uname); - } - return (uid); -} - -mode_t -a_mask(char *s) -{ - int done, rv; - char *ep; - - done = 0; - if (*s >= '0' && *s <= '7') { - done = 1; - rv = strtol(optarg, &ep, 8); - } - if (!done || rv < 0 || *ep) - errx(1, "invalid file mode: %s", s); - return (rv); -} - -void -usage(void) -{ - - fprintf(stderr, - "usage: mount_ados [-g gid] [-m mask] [-o options] [-u uid] special node\n"); - exit(1); -} diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 383a0683f3c..01513c0d93a 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.67 2006/05/29 16:49:42 avsm Exp $ */ +/* $OpenBSD: mountd.c,v 1.68 2007/06/01 05:37:14 deraadt Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -710,7 +710,6 @@ get_exportlist(void) struct iso_args ia; struct mfs_args ma; struct msdosfs_args da; - struct adosfs_args aa; } targs; struct fsarray { int exflags; @@ -758,7 +757,6 @@ get_exportlist(void) !strncmp(fsp->f_fstypename, MOUNT_FFS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_EXT2FS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_MSDOS, MFSNAMELEN) || - !strncmp(fsp->f_fstypename, MOUNT_ADOSFS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_CD9660, MFSNAMELEN)) { fstbl[i].exflags = MNT_DELEXPORT; fstbl[i].mntonname = fsp->f_mntonname; @@ -1583,7 +1581,6 @@ do_mount(struct exportlist *ep, struct grouplist *grp, int exflags, struct iso_args ia; struct mfs_args ma; struct msdosfs_args da; - struct adosfs_args aa; } args; char savedc = '\0'; u_int32_t **addrp; |