CVS commit: src/sbin/mount
Module Name:src Committed By: simonb Date: Fri Jun 4 11:55:45 UTC 2021 Modified Files: src/sbin/mount: mount.8 mount.c Log Message: Remove the warning about autoselecting nfs based on : or @. Ok jmcneill@, mrg@. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sbin/mount/mount.8 cvs rdiff -u -r1.103 -r1.104 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.88 src/sbin/mount/mount.8:1.89 --- src/sbin/mount/mount.8:1.88 Sat Oct 24 10:51:34 2020 +++ src/sbin/mount/mount.8 Fri Jun 4 11:55:45 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.88 2020/10/24 10:51:34 nia Exp $ +.\" $NetBSD: mount.8,v 1.89 2021/06/04 11:55:45 simonb Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd October 24, 2020 +.Dd June 4, 2021 .Dt MOUNT 8 .Os .Sh NAME @@ -137,10 +137,7 @@ or at sign .Pq Ql \&@ , then the .Li nfs -type is inferred, but this behaviour is deprecated, and will be -removed in a future version of -.Nm . -.Pp +type is inferred. In .Nx , the file-system mounting policy is dictated by the running security models. Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.103 src/sbin/mount/mount.c:1.104 --- src/sbin/mount/mount.c:1.103 Sun Oct 18 10:57:30 2020 +++ src/sbin/mount/mount.c Fri Jun 4 11:55:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $ */ +/* $NetBSD: mount.c,v 1.104 2021/06/04 11:55:45 simonb Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $"); +__RCSID("$NetBSD: mount.c,v 1.104 2021/06/04 11:55:45 simonb Exp $"); #endif #endif /* not lint */ @@ -294,11 +294,6 @@ out: err(EXIT_FAILURE, "%s", buf); if (vfslist == NULL) { if (strpbrk(argv[0], ":@") != NULL) { -fprintf(stderr, "WARNING: autoselecting nfs " -"based on : or @ in the device name is " -"deprecated!\n" -"WARNING: This behaviour will be removed " -"in a future release\n"); vfstype = "nfs"; } else { vfstype = getfslab(mntfromname);
CVS commit: src/sbin/mount
Module Name:src Committed By: nia Date: Sat Oct 24 10:51:34 UTC 2020 Modified Files: src/sbin/mount: mount.8 Log Message: file systems that are used as what spools? To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.87 src/sbin/mount/mount.8:1.88 --- src/sbin/mount/mount.8:1.87 Tue Jan 9 09:15:57 2018 +++ src/sbin/mount/mount.8 Sat Oct 24 10:51:34 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.87 2018/01/09 09:15:57 wiz Exp $ +.\" $NetBSD: mount.8,v 1.88 2020/10/24 10:51:34 nia Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd January 8, 2018 +.Dd October 24, 2020 .Dt MOUNT 8 .Os .Sh NAME @@ -239,8 +239,8 @@ list of file systems shown by default wi .Xr df 1 . .It Cm noatime Never update the access time field for files. -This option is useful for optimizing read performance on file systems -that are used as news spools. +This option is useful for optimizing read performance on file systems, +and avoiding excess writes on flash-based file systems. .It Cm noauto This file system should be skipped when mount is run with the .Fl a
CVS commit: src/sbin/mount
Module Name:src Committed By: mlelstv Date: Sun Oct 18 10:57:30 UTC 2020 Modified Files: src/sbin/mount: mount.c Log Message: Make command line arguments -r and -w actually override defaults from fstab, previously -w would only cancel a preceeding -r. No longer strip -o rw. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.102 src/sbin/mount/mount.c:1.103 --- src/sbin/mount/mount.c:1.102 Sun Oct 9 21:03:43 2016 +++ src/sbin/mount/mount.c Sun Oct 18 10:57:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $ */ +/* $NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $"); +__RCSID("$NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $"); #endif #endif /* not lint */ @@ -94,6 +94,11 @@ static const struct opt { __MNT_FLAGS }; +#define FLG_UPDATE 1 +#define FLG_RDONLY 2 +#define FLG_RDWRITE 4 +#define FLG_FORCE 8 + static const char ffs_fstype[] = "ffs"; int @@ -128,14 +133,14 @@ main(int argc, char *argv[]) debug = 1; break; case 'f': - init_flags |= MNT_FORCE; + init_flags |= FLG_FORCE; break; case 'o': if (*optarg) catopt(, optarg); break; case 'r': - init_flags |= MNT_RDONLY; + init_flags |= FLG_RDONLY; break; case 't': if (vfslist != NULL) @@ -145,13 +150,13 @@ main(int argc, char *argv[]) vfstype = optarg; break; case 'u': - init_flags |= MNT_UPDATE; + init_flags |= FLG_UPDATE; break; case 'v': verbose++; break; case 'w': - init_flags &= ~MNT_RDONLY; + init_flags |= FLG_RDWRITE; break; case '?': default: @@ -218,7 +223,7 @@ main(int argc, char *argv[]) */ canonical_path = realpath(*argv, canonical_path_buf); - if (init_flags & MNT_UPDATE) { + if (init_flags & FLG_UPDATE) { /* * Try looking up the canonical path first, * then try exactly what the user entered. @@ -395,7 +400,7 @@ mountfs(const char *vfstype, const char catopt(, "rw"); if (getargs == 0 && strcmp(name, "/") == 0 && !hasopt(optbuf, "union")) - flags |= MNT_UPDATE; + flags |= FLG_UPDATE; else if (skipmounted) { if ((numfs = getmntinfo(, MNT_WAIT)) == 0) { warn("getmntinfo"); @@ -431,12 +436,15 @@ mountfs(const char *vfstype, const char } } } - if (flags & MNT_FORCE) + if (flags & FLG_FORCE) catopt(, "force"); - if (flags & MNT_RDONLY) + if (flags & FLG_RDONLY) catopt(, "ro"); + /* make -w override -r */ + if (flags & FLG_RDWRITE) + catopt(, "rw"); - if (flags & MNT_UPDATE) { + if (flags & FLG_UPDATE) { catopt(, "update"); /* Figure out the fstype only if we defaulted to ffs */ if (vfstype == ffs_fstype && statvfs(name, ) != -1) @@ -690,7 +698,7 @@ mangle(char *options, int *argcp, const *p = '\0'; argv[argc++] = p+1; } - } else if (strcmp(p, "rw") != 0) { + } else { argv[argc++] = "-o"; argv[argc++] = p; }
CVS commit: src/sbin/mount
Module Name:src Committed By: wiz Date: Tue Jan 9 09:15:57 UTC 2018 Modified Files: src/sbin/mount: mount.8 Log Message: Sort SEE ALSO. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.86 src/sbin/mount/mount.8:1.87 --- src/sbin/mount/mount.8:1.86 Tue Jan 9 03:31:12 2018 +++ src/sbin/mount/mount.8 Tue Jan 9 09:15:57 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.86 2018/01/09 03:31:12 christos Exp $ +.\" $NetBSD: mount.8,v 1.87 2018/01/09 09:15:57 wiz Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -540,6 +540,9 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 .Xr options 4 , .Xr wapbl 4 , .Xr fstab 5 , +.Xr automount 8 , +.Xr automountd 8 , +.Xr autounmountd 8 , .Xr disklabel 8 , .Xr fsck 8 , .Xr mount_ados 8 , @@ -576,10 +579,7 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 .Xr rump_sysvbfs 8 , .Xr rump_tmpfs 8 , .Xr rump_udf 8 , -.Xr umount 8 , -.Xr automount 8 , -.Xr automountd 8 , -.Xr autounmountd 8 +.Xr umount 8 .Sh HISTORY A .Nm
CVS commit: src/sbin/mount
Module Name:src Committed By: wiz Date: Mon Nov 20 21:59:30 UTC 2017 Modified Files: src/sbin/mount: mount.8 Log Message: Remove Tn. Remove undefined .Sp. Use tagged list instead of hanging one with .brs. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.84 src/sbin/mount/mount.8:1.85 --- src/sbin/mount/mount.8:1.84 Mon Nov 20 16:41:55 2017 +++ src/sbin/mount/mount.8 Mon Nov 20 21:59:30 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.84 2017/11/20 16:41:55 christos Exp $ +.\" $NetBSD: mount.8,v 1.85 2017/11/20 21:59:30 wiz Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -191,9 +191,7 @@ flag followed by a comma separated strin The following options are available: .Bl -tag -width nocoredump .It Cm async -All -.Tn I/O -to the file system should be done asynchronously. +All I/O to the file system should be done asynchronously. In the event of a crash, .Em "it is impossible for the system to verify the integrity of data on a file system mounted with this option" . You should only use this option if you have an application-specific data @@ -281,7 +279,7 @@ All cached meta-data are invalidated, su is re-read from disk, all cached inactive vnodes and file data are invalidated and all inode data are re-read for all active vnodes. .It Cm rump -Instead of running +Instead of running .Dq mount_ to mount the file system, run .Dq rump_ . @@ -314,7 +312,6 @@ use the option of .Xr fsck_ffs 8 . .Pp -.Sp .Cm log cannot be used together with .Cm discard . @@ -330,9 +327,7 @@ is still guaranteed. .It Cm symperm Recognize permission of symbolic link when reading or traversing link. .It Cm sync -All -.Tn I/O -to the file system should be done synchronously. +All I/O to the file system should be done synchronously. This is not equivalent to the normal mode in which only metadata is written synchronously. .It Cm nosync @@ -423,10 +418,7 @@ command: mount -a -t nonfs,mfs .Ed .Pp -mounts all file systems except those of type -.Tn NFS -and -.Tn MFS . +mounts all file systems except those of type NFS and MFS. .Pp .Nm will attempt to execute a program in @@ -491,18 +483,14 @@ file system table .El .Sh EXAMPLES Some useful examples: -.Bl -hang -offset indent -width "MS-DOS" -.It Tn CD-ROM -.br +.Bl -tag -offset indent -width "MS-DOS" +.It CD-ROM mount -t cd9660 -r /dev/cd0a /cdrom -.It Tn MS-DOS -.br +.It MS-DOS mount -t msdos /dev/fd0a /floppy -.It Tn NFS -.br +.It NFS mount -t nfs nfs-server-host:/directory/path /mount-point -.It Tn MFS (32 megabyte) -.br +.It MFS (32 megabyte) mount -t mfs -o nosuid,-s=32m swap /tmp .El .Pp @@ -519,11 +507,8 @@ That would allow a simple command like .Qq mount /cdrom or .Qq umount /cdrom -for media using the -.Tn ISO-9660 -file system format in the first -.Tn CD-ROM -drive. +for media using the ISO-9660 file system format in the first +CD-ROM drive. .Sh DIAGNOSTICS The error .Dq Operation not supported by device
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Mon Nov 20 16:41:55 UTC 2017 Modified Files: src/sbin/mount: mount.8 Log Message: Clarify the program naming convention, and use consistently instead of XXX. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.83 src/sbin/mount/mount.8:1.84 --- src/sbin/mount/mount.8:1.83 Wed Mar 22 17:14:11 2017 +++ src/sbin/mount/mount.8 Mon Nov 20 11:41:55 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.83 2017/03/22 21:14:11 jdolecek Exp $ +.\" $NetBSD: mount.8,v 1.84 2017/11/20 16:41:55 christos Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd March 22, 2017 +.Dd November 20, 2017 .Dt MOUNT 8 .Os .Sh NAME @@ -56,6 +56,14 @@ device on to the file system tree at the .Ar node , or to update options for an already-mounted file system. .Pp +These programs are named +.Dq mount_ +where +.Dq +refers to the file system-specific type; for example +for NFS the mount program is called +.Xr mount_nfs 8 . +.Pp The .Ar node argument is always interpreted as a directory in the name space of @@ -273,7 +281,10 @@ All cached meta-data are invalidated, su is re-read from disk, all cached inactive vnodes and file data are invalidated and all inode data are re-read for all active vnodes. .It Cm rump -Instead of running mount_type to mount the file system, run rump_type. +Instead of running +.Dq mount_ +to mount the file system, run +.Dq rump_ . This uses a userspace server to mount the file system and does not require kernel support for the specific file system type. See the @@ -462,7 +473,7 @@ The file system object is to be read and .Pp The options specific to the various file system types are described in the manual pages for those file systems' -.Nm mount_XXX +.Dq mount_ commands; for instance, the options specific to Berkeley Fast File System (FFS) are described in the
CVS commit: src/sbin/mount
Module Name:src Committed By: jdolecek Date: Wed Mar 22 21:14:11 UTC 2017 Modified Files: src/sbin/mount: mount.8 Log Message: expand a little the explanation about discard describe behaviour of combination of log+async (i.e. same as just log) To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.82 src/sbin/mount/mount.8:1.83 --- src/sbin/mount/mount.8:1.82 Thu Nov 10 22:28:00 2016 +++ src/sbin/mount/mount.8 Wed Mar 22 21:14:11 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.82 2016/11/10 22:28:00 jdolecek Exp $ +.\" $NetBSD: mount.8,v 1.83 2017/03/22 21:14:11 jdolecek Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd November 10, 2016 +.Dd March 22, 2017 .Dt MOUNT 8 .Os .Sh NAME @@ -198,10 +198,15 @@ mode. Use DISCARD/TRIM commands if disk and driver support it. .Pp .Em EXPERIMENTAL -- negatively influences filesystem performance, +- negatively influences filesystem performance by increasing fragmentation, causes free block map inconsistency on unclean shutdown, and is incompatible with .Cm log . +If +.Cm log +option is also used, +.Cm discard +is automatically disabled. .It Cm extattr Enable extended attributes, if the filesystem supports them and does not enable them by default. @@ -281,10 +286,6 @@ Mount the file system with meta-data journaling, also known simply as logging. It provides rapid metadata updates and eliminates the need to check file system consistency after a system outage. -A file system mounted with -.Cm log -can not be mounted with -.Cm async . It requires the .Dv WAPBL option to be enabled in the running kernel. @@ -301,6 +302,20 @@ use the .Fl c option of .Xr fsck_ffs 8 . +.Pp +.Sp +.Cm log +cannot be used together with +.Cm discard . +.Pp +A file system mounted with +.Cm log +can be mounted also with +.Cm async , +but such filesystem behaves the same as if +.Cm async +was not specified - meta-data writes use the log, hence its integrity +is still guaranteed. .It Cm symperm Recognize permission of symbolic link when reading or traversing link. .It Cm sync
CVS commit: src/sbin/mount
Module Name:src Committed By: jdolecek Date: Thu Nov 10 22:28:00 UTC 2016 Modified Files: src/sbin/mount: mount.8 Log Message: stress more that discard is experimental, and explain why; also note that it's not compatible with log To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.81 src/sbin/mount/mount.8:1.82 --- src/sbin/mount/mount.8:1.81 Mon Sep 12 00:25:23 2016 +++ src/sbin/mount/mount.8 Thu Nov 10 22:28:00 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.81 2016/09/12 00:25:23 sevan Exp $ +.\" $NetBSD: mount.8,v 1.82 2016/11/10 22:28:00 jdolecek Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd September 12, 2016 +.Dd November 10, 2016 .Dt MOUNT 8 .Os .Sh NAME @@ -196,7 +196,12 @@ Clear mode. .It Cm discard Use DISCARD/TRIM commands if disk and driver support it. -EXPERIMENTAL! +.Pp +.Em EXPERIMENTAL +- negatively influences filesystem performance, +causes free block map inconsistency on unclean shutdown, +and is incompatible with +.Cm log . .It Cm extattr Enable extended attributes, if the filesystem supports them and does not enable them by default.
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Sun Oct 9 21:03:43 UTC 2016 Modified Files: src/sbin/mount: mount.c Log Message: try to be more clear about what is not found. To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.101 src/sbin/mount/mount.c:1.102 --- src/sbin/mount/mount.c:1.101 Sat Oct 8 02:47:59 2016 +++ src/sbin/mount/mount.c Sun Oct 9 17:03:43 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.101 2016/10/08 06:47:59 maya Exp $ */ +/* $NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.101 2016/10/08 06:47:59 maya Exp $"); +__RCSID("$NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $"); #endif #endif /* not lint */ @@ -503,7 +503,7 @@ mountfs(const char *vfstype, const char } while (*++edir != NULL); if (errno == ENOENT) - warnx("%s not found", execbase); + warn("exec %s for %s: %s", execbase, name, execbase); _exit(1); /* NOTREACHED */
CVS commit: src/sbin/mount
Module Name:src Committed By: maya Date: Sat Oct 8 06:47:59 UTC 2016 Modified Files: src/sbin/mount: mount.c Log Message: change warning message previously attempting to use mount -t ext2 like myself would result in the warning "mount: mount_ext2 not found for /mnt", which (if you're me) can be misunderstood as "/mnt is not an ext2 filesystem"... change it to "mount: mount_ext2 not found" To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.100 src/sbin/mount/mount.c:1.101 --- src/sbin/mount/mount.c:1.100 Sun Jan 4 22:05:37 2015 +++ src/sbin/mount/mount.c Sat Oct 8 06:47:59 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.100 2015/01/04 22:05:37 pooka Exp $ */ +/* $NetBSD: mount.c,v 1.101 2016/10/08 06:47:59 maya Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.100 2015/01/04 22:05:37 pooka Exp $"); +__RCSID("$NetBSD: mount.c,v 1.101 2016/10/08 06:47:59 maya Exp $"); #endif #endif /* not lint */ @@ -503,7 +503,7 @@ mountfs(const char *vfstype, const char } while (*++edir != NULL); if (errno == ENOENT) - warnx("%s not found for %s", execbase, name); + warnx("%s not found", execbase); _exit(1); /* NOTREACHED */
CVS commit: src/sbin/mount
Module Name:src Committed By: sevan Date: Mon Sep 12 00:25:23 UTC 2016 Modified Files: src/sbin/mount: mount.8 Log Message: mount appeared in V1 http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/mount.1 Replace contraction. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.80 src/sbin/mount/mount.8:1.81 --- src/sbin/mount/mount.8:1.80 Sat Dec 6 12:12:17 2014 +++ src/sbin/mount/mount.8 Mon Sep 12 00:25:23 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.80 2014/12/06 12:12:17 mbalmer Exp $ +.\" $NetBSD: mount.8,v 1.81 2016/09/12 00:25:23 sevan Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd December 6, 2014 +.Dd September 12, 2016 .Dt MOUNT 8 .Os .Sh NAME @@ -504,7 +504,7 @@ See The error .Dq Operation not permitted may indicate that the mount options include privileged options and/or -don't include options that exclude privileged options. +do not include options that exclude privileged options. One should try using at least .Dq nodev and @@ -560,4 +560,4 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 A .Nm command appeared in -.At v6 . +.At v1 .
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Sun Jan 4 22:05:37 UTC 2015 Modified Files: src/sbin/mount: mount.c Log Message: gcc 4.9 produces vfork clobberation warnings for name and buflen. Since there's no performance reason to use vfork here, just replace it with fork and be done with warnings once and for all. To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.99 src/sbin/mount/mount.c:1.100 --- src/sbin/mount/mount.c:1.99 Sat Oct 5 08:06:35 2013 +++ src/sbin/mount/mount.c Sun Jan 4 22:05:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $ */ +/* $NetBSD: mount.c,v 1.100 2015/01/04 22:05:37 pooka Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $); +__RCSID($NetBSD: mount.c,v 1.100 2015/01/04 22:05:37 pooka Exp $); #endif #endif /* not lint */ @@ -473,9 +473,9 @@ mountfs(const char *vfstype, const char warn(Cannot create pipe); } - switch (pid = vfork()) { + switch (pid = fork()) { case -1:/* Error. */ - warn(vfork); + warn(fork); if (optbuf) free(optbuf); free(argv);
CVS commit: src/sbin/mount
Module Name:src Committed By: mbalmer Date: Sat Dec 6 12:12:17 UTC 2014 Modified Files: src/sbin/mount: mount.8 Log Message: Add reference to mount_chfs, bump date. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.79 src/sbin/mount/mount.8:1.80 --- src/sbin/mount/mount.8:1.79 Thu Oct 31 07:37:06 2013 +++ src/sbin/mount/mount.8 Sat Dec 6 12:12:17 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.79 2013/10/31 07:37:06 apb Exp $ +.\ $NetBSD: mount.8,v 1.80 2014/12/06 12:12:17 mbalmer Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ @(#)mount.8 8.8 (Berkeley) 6/16/94 .\ -.Dd October 31, 2013 +.Dd December 6, 2014 .Dt MOUNT 8 .Os .Sh NAME @@ -523,6 +523,7 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 .Xr fsck 8 , .Xr mount_ados 8 , .Xr mount_cd9660 8 , +.Xr mount_chfs 8 , .Xr mount_ext2fs 8 , .Xr mount_fdesc 8 , .Xr mount_ffs 8 ,
CVS commit: src/sbin/mount
Module Name:src Committed By: apb Date: Thu Oct 31 07:37:06 UTC 2013 Modified Files: src/sbin/mount: mount.8 Log Message: Add a reference to secmodel_extensions(9), to make it a little easier to figure out how to enable mounts for unprivileged users. (Why don't we just explain vfs.generic.usermount in the mount(8) man page?) Also add another example of different ways in which the special argument is interpreted by different file systems: mount_tmpfs(8) ignores it. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.78 src/sbin/mount/mount.8:1.79 --- src/sbin/mount/mount.8:1.78 Fri Oct 19 17:09:07 2012 +++ src/sbin/mount/mount.8 Thu Oct 31 07:37:06 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.78 2012/10/19 17:09:07 drochner Exp $ +.\ $NetBSD: mount.8,v 1.79 2013/10/31 07:37:06 apb Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ @(#)mount.8 8.8 (Berkeley) 6/16/94 .\ -.Dd June 23, 2012 +.Dd October 31, 2013 .Dt MOUNT 8 .Os .Sh NAME @@ -69,9 +69,11 @@ for example, interprets it as a device node, .Xr mount_null 8 interprets it as a directory name, -and .Xr mount_nfs 8 -interprets it as reference to a remote host and a directory on that host. +interprets it as reference to a remote host and a directory on that host, +and +.Xr mount_tmpfs 8 +ignores it. .Pp The system maintains a list of currently mounted file systems. This list is printed if @@ -136,6 +138,8 @@ In the file-system mounting policy is dictated by the running security models. The default security model may allow unprivileged mounting; see .Xr secmodel_suser 9 +and +.Xr secmodel_extensions 9 for details. .Pp The options are as follows:
CVS commit: src/sbin/mount
Module Name:src Committed By: ast Date: Sat Oct 5 08:06:35 UTC 2013 Modified Files: src/sbin/mount: mount.c Log Message: No code change: corrected spelling in comment, removed trailing white spaces. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.98 src/sbin/mount/mount.c:1.99 --- src/sbin/mount/mount.c:1.98 Thu Jan 24 17:53:49 2013 +++ src/sbin/mount/mount.c Sat Oct 5 08:06:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $ */ +/* $NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $); +__RCSID($NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $); #endif #endif /* not lint */ @@ -85,7 +85,7 @@ static void prmount(struct statvfs *); __dead static void usage(void); -/* Map from mount otions to printable formats. */ +/* Map from mount options to printable formats. */ static const struct opt { int o_opt; int o_silent; @@ -352,7 +352,7 @@ hasopt(const char *mntopts, const char * } static int -mountfs(const char *vfstype, const char *spec, const char *name, +mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts, int skipmounted, char *buf, size_t buflen) { @@ -579,7 +579,7 @@ prmount(struct statvfs *sfp) sfp-f_fstypename); flags = sfp-f_flag MNT_VISFLAGMASK; - for (f = 0, o = optnames; flags o + for (f = 0, o = optnames; flags o optnames[sizeof(optnames)/sizeof(optnames[0])]; o++) if (flags o-o_opt) { if (!o-o_silent || verbose)
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Thu Jan 24 17:53:49 UTC 2013 Modified Files: src/sbin/mount: mount.c Log Message: use return instead of exit. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.97 src/sbin/mount/mount.c:1.98 --- src/sbin/mount/mount.c:1.97 Wed Jun 13 20:39:33 2012 +++ src/sbin/mount/mount.c Thu Jan 24 12:53:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.97 2012/06/14 00:39:33 christos Exp $ */ +/* $NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.97 2012/06/14 00:39:33 christos Exp $); +__RCSID($NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $); #endif #endif /* not lint */ @@ -204,8 +204,7 @@ main(int argc, char *argv[]) prmount(mntbuf[i]); } } - exit(rval); - /* NOTREACHED */ + return rval; case 1: if (vfslist != NULL) { usage(); @@ -325,8 +324,7 @@ out: } #endif - exit(rval); - /* NOTREACHED */ + return rval; } int
CVS commit: src/sbin/mount
Module Name:src Committed By: wiz Date: Wed Oct 3 19:36:11 UTC 2012 Modified Files: src/sbin/mount: mount.8 Log Message: - Improve wording; - remove superfluous `.Pp' macro (fixes mandoc(1) warning). From Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.76 src/sbin/mount/mount.8:1.77 --- src/sbin/mount/mount.8:1.76 Sat Jun 23 23:41:25 2012 +++ src/sbin/mount/mount.8 Wed Oct 3 19:36:11 2012 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.76 2012/06/23 23:41:25 wiz Exp $ +.\ $NetBSD: mount.8,v 1.77 2012/10/03 19:36:11 wiz Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -436,8 +436,8 @@ The file system object is to be read and The options specific to the various file system types are described in the manual pages for those file systems' .Nm mount_XXX -commands. -For instance the options specific to Berkeley +commands; +for instance, the options specific to Berkeley Fast File System (FFS) are described in the .Xr mount_ffs 8 manual page. @@ -453,7 +453,6 @@ file system table .El .Sh EXAMPLES Some useful examples: -.Pp .Bl -hang -offset indent -width MS-DOS .It Tn CD-ROM .br
CVS commit: src/sbin/mount
Module Name:src Committed By: jdf Date: Sat Jun 23 23:17:46 UTC 2012 Modified Files: src/sbin/mount: mount.8 Log Message: Clarify use of the union option for mount, as proposed in PR 45919. Text proposed by apb. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.74 src/sbin/mount/mount.8:1.75 --- src/sbin/mount/mount.8:1.74 Fri Jul 22 15:53:21 2011 +++ src/sbin/mount/mount.8 Sat Jun 23 23:17:46 2012 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.74 2011/07/22 15:53:21 dholland Exp $ +.\ $NetBSD: mount.8,v 1.75 2012/06/23 23:17:46 jdf Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -303,12 +303,32 @@ Clear mode. .It Cm union Causes the namespace at the mount point to appear as the union -of the mounted file system root and the existing directory. -Lookups will be done in the mounted file system first. -If those operations fail due to a non-existent file the underlying -directory is then accessed. -All creates are done in the mounted file system, except for the fdesc -file system. +of the mounted file system root +(referred to as the +.Em upper +layer), and the existing directory +(referred to as the +.Em lower +layer). +Name lookups will be done in the upper layer first. +If a name does not exist in the upper layer, then the name +will be looked up in the lower layer. +If a name exists in both the upper and lower layers, then only +the upper instance is accessible. +Creation of new files is done in the upper layer, +except in the case of the fdesc file system (see +.Xr mount_fdesc 8 ) . +.Pp +Note that the +.Cm union +option can be applied to any type of file system, +and is fundamentally different from +.Xr mount_union 8 , +which is a particular type of file system. +Also note that the +.Cm union +option affects the file system name space only at the mount point +itself; it does not apply recursively to subdirectories. .It Cm update The same as .Fl u ;
CVS commit: src/sbin/mount
Module Name:src Committed By: wiz Date: Sat Jun 23 23:41:25 UTC 2012 Modified Files: src/sbin/mount: mount.8 Log Message: Bump date for previous. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.75 src/sbin/mount/mount.8:1.76 --- src/sbin/mount/mount.8:1.75 Sat Jun 23 23:17:46 2012 +++ src/sbin/mount/mount.8 Sat Jun 23 23:41:25 2012 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.75 2012/06/23 23:17:46 jdf Exp $ +.\ $NetBSD: mount.8,v 1.76 2012/06/23 23:41:25 wiz Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ @(#)mount.8 8.8 (Berkeley) 6/16/94 .\ -.Dd July 22, 2011 +.Dd June 23, 2012 .Dt MOUNT 8 .Os .Sh NAME
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Thu Jun 14 00:39:34 UTC 2012 Modified Files: src/sbin/mount: mount.c Log Message: don't print the NULL, but the error To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.96 src/sbin/mount/mount.c:1.97 --- src/sbin/mount/mount.c:1.96 Mon Apr 9 11:50:20 2012 +++ src/sbin/mount/mount.c Wed Jun 13 20:39:33 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.96 2012/04/09 15:50:20 mlelstv Exp $ */ +/* $NetBSD: mount.c,v 1.97 2012/06/14 00:39:33 christos Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.96 2012/04/09 15:50:20 mlelstv Exp $); +__RCSID($NetBSD: mount.c,v 1.97 2012/06/14 00:39:33 christos Exp $); #endif #endif /* not lint */ @@ -188,7 +188,7 @@ main(int argc, char *argv[]) mntfromname = getfsspecname(buf, sizeof(buf), mntfromname); if (mntfromname == NULL) - err(EXIT_FAILURE, %s, mntfromname); + err(EXIT_FAILURE, %s, buf); if (mountfs(fs-fs_vfstype, mntfromname, fs-fs_file, init_flags, options, fs-fs_mntops, !forceall, NULL, 0))
CVS commit: src/sbin/mount
Module Name:src Committed By: mlelstv Date: Mon Apr 9 15:50:20 UTC 2012 Modified Files: src/sbin/mount: mount.c Log Message: return exit code from mount_ again To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.95 src/sbin/mount/mount.c:1.96 --- src/sbin/mount/mount.c:1.95 Sat Apr 7 04:13:06 2012 +++ src/sbin/mount/mount.c Mon Apr 9 15:50:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.95 2012/04/07 04:13:06 christos Exp $ */ +/* $NetBSD: mount.c,v 1.96 2012/04/09 15:50:20 mlelstv Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.95 2012/04/07 04:13:06 christos Exp $); +__RCSID($NetBSD: mount.c,v 1.96 2012/04/09 15:50:20 mlelstv Exp $); #endif #endif /* not lint */ @@ -325,7 +325,8 @@ out: } #endif - return 0; + exit(rval); + /* NOTREACHED */ } int
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Sat Apr 7 03:13:32 UTC 2012 Modified Files: src/sbin/mount: Makefile mount.c Log Message: Accept NAME=label for special so that we can wire down our wedges. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sbin/mount/Makefile cvs rdiff -u -r1.93 -r1.94 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/Makefile diff -u src/sbin/mount/Makefile:1.29 src/sbin/mount/Makefile:1.30 --- src/sbin/mount/Makefile:1.29 Thu Aug 19 19:02:27 2004 +++ src/sbin/mount/Makefile Fri Apr 6 23:13:32 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.29 2004/08/19 23:02:27 christos Exp $ +# $NetBSD: Makefile,v 1.30 2012/04/07 03:13:32 christos Exp $ # @(#)Makefile 8.6 (Berkeley) 5/8/95 .include bsd.own.mk @@ -6,5 +6,6 @@ PROG= mount MAN= mount.8 SRCS= mount.c vfslist.c +LDADD+= -lutil .include bsd.prog.mk Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.93 src/sbin/mount/mount.c:1.94 --- src/sbin/mount/mount.c:1.93 Mon Aug 29 10:35:00 2011 +++ src/sbin/mount/mount.c Fri Apr 6 23:13:32 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.93 2011/08/29 14:35:00 joerg Exp $ */ +/* $NetBSD: mount.c,v 1.94 2012/04/07 03:13:32 christos Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,13 +39,15 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.93 2011/08/29 14:35:00 joerg Exp $); +__RCSID($NetBSD: mount.c,v 1.94 2012/04/07 03:13:32 christos Exp $); #endif #endif /* not lint */ #include sys/param.h #include sys/mount.h #include sys/wait.h +#include sys/disk.h +#include sys/sysctl.h #include fs/puffs/puffs_msgif.h @@ -58,6 +60,8 @@ __RCSID($NetBSD: mount.c,v 1.93 2011/08 #include stdlib.h #include string.h #include unistd.h +#include util.h +#include vis.h #define MOUNTNAMES #include fcntl.h @@ -76,6 +80,8 @@ static const char * static struct statvfs * getmntpt(const char *); static int getmntargs(struct statvfs *, char *, size_t); +static const char * + getspec(char *, size_t, const char *); static int hasopt(const char *, const char *); static void mangle(char *, int *, const char ** volatile *, int *); static int mountfs(const char *, const char *, const char *, @@ -93,7 +99,7 @@ static const struct opt { __MNT_FLAGS }; -static char ffs_fstype[] = ffs; +static const char ffs_fstype[] = ffs; int main(int argc, char *argv[]) @@ -107,7 +113,7 @@ main(int argc, char *argv[]) int all, ch, forceall, i, init_flags, mntsize, rval; char *options; const char *mountopts, *fstypename; - char canonical_path_buf[MAXPATHLEN]; + char canonical_path_buf[MAXPATHLEN], buf[MAXPATHLEN]; char *canonical_path; /* started as mount */ @@ -138,8 +144,8 @@ main(int argc, char *argv[]) break; case 't': if (vfslist != NULL) -errx(1, -only one -t option may be specified.); +errx(EXIT_FAILURE, +Only one -t option may be specified.); vfslist = makevfslist(optarg); vfstype = optarg; break; @@ -176,13 +182,16 @@ main(int argc, char *argv[]) if (hasopt(fs-fs_mntops, noauto)) continue; if (strcmp(fs-fs_spec, from_mount) == 0) { - if ((mntbuf = getmntpt(fs-fs_file)) == NULL) - errx(1, - unknown file system %s., + if ((mntbuf = getmntpt(fs-fs_file)) + == NULL) + errx(EXIT_FAILURE, + Unknown file system %s, fs-fs_file); mntfromname = mntbuf-f_mntfromname; } else mntfromname = fs-fs_spec; +mntfromname = +getspec(buf, sizeof(buf), mntfromname); if (mountfs(fs-fs_vfstype, mntfromname, fs-fs_file, init_flags, options, fs-fs_mntops, !forceall, NULL, 0)) @@ -190,7 +199,7 @@ main(int argc, char *argv[]) } else { if ((mntsize = getmntinfo(mntbuf, MNT_NOWAIT)) == 0) -err(1, getmntinfo); +err(EXIT_FAILURE, getmntinfo); for (i = 0; i mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) @@ -219,12 +228,11 @@ main(int argc, char *argv[]) * then try exactly what the user entered. */ if ((canonical_path == NULL || - (mntbuf = getmntpt(canonical_path)) == NULL) - (mntbuf = getmntpt(*argv)) == NULL - ) - { -errx(1, -unknown special file or file system %s., + (mntbuf = getmntpt(canonical_path)) == NULL) + (mntbuf = getmntpt(*argv)) == NULL) { +out: +errx(EXIT_FAILURE, +Unknown special file or file system `%s', *argv); } mntfromname = mntbuf-f_mntfromname; @@ -247,26 +255,20 @@ main(int argc, char *argv[]) (fs = getfsspec(canonical_path)) == NULL)) { if ((fs = getfsfile(*argv)) == NULL -(fs = getfsspec(*argv)) == NULL) -{ - errx(1, - %s: unknown special file
CVS commit: src/sbin/mount
Module Name:src Committed By: christos Date: Sat Apr 7 05:58:55 UTC 2012 Modified Files: src/sbin/mount: Makefile Log Message: add missing DPADD To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sbin/mount/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/Makefile diff -u src/sbin/mount/Makefile:1.30 src/sbin/mount/Makefile:1.31 --- src/sbin/mount/Makefile:1.30 Fri Apr 6 23:13:32 2012 +++ src/sbin/mount/Makefile Sat Apr 7 01:58:55 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.30 2012/04/07 03:13:32 christos Exp $ +# $NetBSD: Makefile,v 1.31 2012/04/07 05:58:55 christos Exp $ # @(#)Makefile 8.6 (Berkeley) 5/8/95 .include bsd.own.mk @@ -7,5 +7,6 @@ PROG= mount MAN= mount.8 SRCS= mount.c vfslist.c LDADD+= -lutil +DPADD+= ${LIBUTIL} .include bsd.prog.mk
CVS commit: src/sbin/mount
Module Name:src Committed By: dholland Date: Fri Jul 22 15:47:46 UTC 2011 Modified Files: src/sbin/mount: mount.8 Log Message: Clarify UFS2 superblock format stuff. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.72 src/sbin/mount/mount.8:1.73 --- src/sbin/mount/mount.8:1.72 Fri Jun 17 18:13:14 2011 +++ src/sbin/mount/mount.8 Fri Jul 22 15:47:46 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.72 2011/06/17 18:13:14 wiz Exp $ +.\ $NetBSD: mount.8,v 1.73 2011/07/22 15:47:46 dholland Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ @(#)mount.8 8.8 (Berkeley) 6/16/94 .\ -.Dd June 17, 2011 +.Dd July 22, 2011 .Dt MOUNT 8 .Os .Sh NAME @@ -263,7 +263,7 @@ .Fl t flag and respective rump_type manual page for more information. .It Cm log -(FFS only with UFS2 superblock layout) +(FFS only) Mount the file system with .Xr wapbl 4 meta-data journaling, also known simply as logging. @@ -279,6 +279,13 @@ See .Xr wapbl 4 for more information. +This option requires the +.Dq UFS2 +superblock layout, which is the default for newly created FFSv1 and +FFSv2 file systems. +.\ To update an old file system with an earlier superblock format, + \ use +.\ .Xr tunefs 8 . .It Cm symperm Recognize permission of symbolic link when reading or traversing link. .It Cm sync
CVS commit: src/sbin/mount
Module Name:src Committed By: dholland Date: Fri Jul 22 15:53:21 UTC 2011 Modified Files: src/sbin/mount: mount.8 Log Message: Improve previous; thanks to tsutsui-san for reminding me of the proper reference. PR 45166 To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.73 src/sbin/mount/mount.8:1.74 --- src/sbin/mount/mount.8:1.73 Fri Jul 22 15:47:46 2011 +++ src/sbin/mount/mount.8 Fri Jul 22 15:53:21 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.73 2011/07/22 15:47:46 dholland Exp $ +.\ $NetBSD: mount.8,v 1.74 2011/07/22 15:53:21 dholland Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -281,11 +281,14 @@ for more information. This option requires the .Dq UFS2 +.Pq level 4 superblock layout, which is the default for newly created FFSv1 and FFSv2 file systems. -.\ To update an old file system with an earlier superblock format, - \ use -.\ .Xr tunefs 8 . +To update an old file system with an earlier superblock format, +use the +.Fl c +option of +.Xr fsck_ffs 8 . .It Cm symperm Recognize permission of symbolic link when reading or traversing link. .It Cm sync
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Thu Feb 17 16:57:46 UTC 2011 Modified Files: src/sbin/mount: pathadj.c Log Message: when in doubt, let the kernel decide To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sbin/mount/pathadj.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/pathadj.c diff -u src/sbin/mount/pathadj.c:1.1 src/sbin/mount/pathadj.c:1.2 --- src/sbin/mount/pathadj.c:1.1 Tue Aug 5 20:57:45 2008 +++ src/sbin/mount/pathadj.c Thu Feb 17 16:57:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pathadj.c,v 1.1 2008/08/05 20:57:45 pooka Exp $ */ +/* $NetBSD: pathadj.c,v 1.2 2011/02/17 16:57:46 pooka Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. All Rights Reserved. @@ -38,7 +38,7 @@ { if (realpath(input, adjusted) == NULL) - err(1, realpath %s, input); + warn(Warning: realpath %s, input); if (strncmp(input, adjusted, MAXPATHLEN)) { warnx(\%s\ is a non-resolved or relative path., input); warnx(using \%s\ instead., adjusted);
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Thu Jan 13 11:57:02 UTC 2011 Modified Files: src/sbin/mount: mount.c Log Message: In case we are union-mounting /, don't force MNT_UPDATE. This makes the following work: mount -t tmpfs -o union tmpfs / (some caveats are implied, such as if you mkdir /usr you're screwed, but then again you'll get there with rm -rf /usr even without union -- we supply rope) per discussion with zafer, use case for jibbed To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.91 src/sbin/mount/mount.c:1.92 --- src/sbin/mount/mount.c:1.91 Thu Jan 14 21:46:24 2010 +++ src/sbin/mount/mount.c Thu Jan 13 11:57:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $ */ +/* $NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $); +__RCSID($NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $); #endif #endif /* not lint */ @@ -392,7 +392,7 @@ if (!mntopts !options) catopt(optbuf, rw); - if (getargs == 0 strcmp(name, /) == 0) + if (getargs == 0 strcmp(name, /) == 0 !hasopt(optbuf, union)) flags |= MNT_UPDATE; else if (skipmounted) { if ((numfs = getmntinfo(sfp, MNT_WAIT)) == 0) {
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Sun Nov 21 18:33:09 UTC 2010 Modified Files: src/sbin/mount: mount.8 Log Message: xref rump_smbfs To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.69 src/sbin/mount/mount.8:1.70 --- src/sbin/mount/mount.8:1.69 Sat Oct 3 07:38:22 2009 +++ src/sbin/mount/mount.8 Sun Nov 21 18:33:08 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.69 2009/10/03 07:38:22 wiz Exp $ +.\ $NetBSD: mount.8,v 1.70 2010/11/21 18:33:08 pooka Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -510,6 +510,7 @@ .Xr rump_msdos 8 , .Xr rump_nfs 8 , .Xr rump_ntfs 8 , +.Xr rump_smbfs 8 , .Xr rump_sysvbfs 8 , .Xr rump_tmpfs 8 , .Xr rump_udf 8 ,
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Thu Jan 14 21:30:17 UTC 2010 Modified Files: src/sbin/mount: mount.c Log Message: If getargs and vfs has PUFFS_TYPEPREFIX, use mount_puffs to query args. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.89 src/sbin/mount/mount.c:1.90 --- src/sbin/mount/mount.c:1.89 Mon May 4 11:41:48 2009 +++ src/sbin/mount/mount.c Thu Jan 14 21:30:17 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.89 2009/05/04 11:41:48 yamt Exp $ */ +/* $NetBSD: mount.c,v 1.90 2010/01/14 21:30:17 pooka Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.89 2009/05/04 11:41:48 yamt Exp $); +__RCSID($NetBSD: mount.c,v 1.90 2010/01/14 21:30:17 pooka Exp $); #endif #endif /* not lint */ @@ -47,6 +47,8 @@ #include sys/mount.h #include sys/wait.h +#include fs/puffs/puffs_msgif.h + #include err.h #include errno.h #include fstab.h @@ -434,7 +436,10 @@ if (argv == NULL) err(1, malloc); - if (hasopt(optbuf, rump)) + if (getargs + strncmp(vfstype, PUFFS_TYPEPREFIX, sizeof(PUFFS_TYPEPREFIX)-1) == 0) + (void)snprintf(execbase, sizeof(execbase), mount_puffs); + else if (hasopt(optbuf, rump)) (void)snprintf(execbase, sizeof(execbase), rump_%s, vfstype); else (void)snprintf(execbase, sizeof(execbase), mount_%s, vfstype);
CVS commit: src/sbin/mount
Module Name:src Committed By: pooka Date: Thu Jan 14 21:46:24 UTC 2010 Modified Files: src/sbin/mount: mount.c Log Message: Remove puffs| from vfstype before making comparison to determine if fs is mounted. Fixes slightly-miscategorized kern/37626. To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.90 src/sbin/mount/mount.c:1.91 --- src/sbin/mount/mount.c:1.90 Thu Jan 14 21:30:17 2010 +++ src/sbin/mount/mount.c Thu Jan 14 21:46:24 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.90 2010/01/14 21:30:17 pooka Exp $ */ +/* $NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.90 2010/01/14 21:30:17 pooka Exp $); +__RCSID($NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $); #endif #endif /* not lint */ @@ -400,13 +400,23 @@ return (1); } for(i = 0; i numfs; i++) { + const char *mountedtype = sfp[i].f_fstypename; + size_t cmplen = sizeof(sfp[i].f_fstypename); + + /* remove puffs| from comparisons, if present */ +#define TYPESIZE (sizeof(PUFFS_TYPEPREFIX)-1) + if (strncmp(mountedtype, + PUFFS_TYPEPREFIX, TYPESIZE) == 0) { +mountedtype += TYPESIZE; +cmplen -= TYPESIZE; + } + /* * XXX can't check f_mntfromname, * thanks to mfs, union, etc. */ if (strncmp(name, sfp[i].f_mntonname, MNAMELEN) == 0 - strncmp(vfstype, sfp[i].f_fstypename, -sizeof(sfp[i].f_fstypename)) == 0) { + strncmp(vfstype, mountedtype, cmplen) == 0) { if (verbose) (void)printf(%s on %s type %.*s: %s\n,
CVS commit: src/sbin/mount
Module Name:src Committed By: wiz Date: Sat Oct 3 07:38:23 UTC 2009 Modified Files: src/sbin/mount: mount.8 Log Message: Drop trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.68 src/sbin/mount/mount.8:1.69 --- src/sbin/mount/mount.8:1.68 Fri Oct 2 20:31:19 2009 +++ src/sbin/mount/mount.8 Sat Oct 3 07:38:22 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: mount.8,v 1.68 2009/10/02 20:31:19 elad Exp $ +.\ $NetBSD: mount.8,v 1.69 2009/10/03 07:38:22 wiz Exp $ .\ .\ Copyright (c) 1980, 1989, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -136,7 +136,7 @@ the file-system mounting policy is dictated by the running security models. The default security model may allow unprivileged mounting; see .Xr secmodel_suser 9 -for details. +for details. .Pp The options are as follows: .Bl -tag -width indent
CVS commit: src/sbin/mount
Module Name:src Committed By: yamt Date: Mon May 4 11:41:48 UTC 2009 Modified Files: src/sbin/mount: mount.c Log Message: disable automatic mountd reloading for now because it makes the service temporary unavailable. PR/41331 from FUKAUMI Naoki. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.88 src/sbin/mount/mount.c:1.89 --- src/sbin/mount/mount.c:1.88 Sun Jan 11 20:39:34 2009 +++ src/sbin/mount/mount.c Mon May 4 11:41:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.88 2009/01/11 20:39:34 pooka Exp $ */ +/* $NetBSD: mount.c,v 1.89 2009/05/04 11:41:48 yamt Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)mount.c 8.25 (Berkeley) 5/8/95; #else -__RCSID($NetBSD: mount.c,v 1.88 2009/01/11 20:39:34 pooka Exp $); +__RCSID($NetBSD: mount.c,v 1.89 2009/05/04 11:41:48 yamt Exp $); #endif #endif /* not lint */ @@ -99,7 +99,9 @@ const char *mntfromname, *mntonname, **vfslist, *vfstype; struct fstab *fs; struct statvfs *mntbuf; +#if 0 FILE *mountdfp; +#endif int all, ch, forceall, i, init_flags, mntsize, rval; char *options; const char *mountopts, *fstypename; @@ -301,6 +303,7 @@ /* NOTREACHED */ } +#if 0 /* disabled because it interferes the service. */ /* * If the mount was successfully, and done by root, tell mountd the * good news. Pid checks are probably unnecessary, but don't hurt. @@ -314,6 +317,7 @@ err(1, signal mountd); (void)fclose(mountdfp); } +#endif exit(rval); /* NOTREACHED */