History log of /freebsd-current/sbin/mount/getmntopts.c
Revision Date Author Comments
# 32e86a82 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 51e16cb8 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# ad055467 29-Jan-2023 Kirk McKusick <mckusick@FreeBSD.org>

Fix for getmntpoint(3) when checking for NFS mount points.

Only attempt to add /dev/ to f_mntfromname names that result in a
valid character device.

MFC after: 1 week
Reported by: Bjoern A. Zeeb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907


# 0bd4c448 25-Jan-2023 Kirk McKusick <mckusick@FreeBSD.org>

Rewrite to avoid Coverity false positive.

MFC after: 1 week
Reported by: Coverity (CID 1502669)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907


# 906c312b 15-Jan-2023 Kirk McKusick <mckusick@FreeBSD.org>

Document the mntopts(3) functions.

The mntopts(3) functions support operations associated with a mount
point. The main purpose of this commit is to document the mntopts(3)
functions that now appear in 18 utilities in the base system. See
mntopts(3) for the documentation details.

The getmntopts() function appeared in 4.4BSD. The build_iovec(),
build_iovec_argf(), free_iovec(), checkpath(), and rmslashes()
functions were added with nmount(8) in FreeBSD 5.0. The getmntpoint()
and chkdoreload() functions are being added in this commit.

These functions should be in a library but for historic reasons are
in a file in the sources for the mount(8) program. Thus, to access
them the following lines need to be added to the Makefile of the
program wanting to use them:

SRCS+= getmntopts.c
MOUNT= ${SRCTOP}/sbin/mount
CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}

Once these changes have been MFC'ed to 13 they may be made into
a library.

Reviewed by: kib, gbe
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907


# a3f714c4 07-Nov-2022 Doug Rabson <dfr@FreeBSD.org>

Add support for mounting single files in nullfs

My main use-case for this is to support mounting config files and secrets
into OCI containers. My current workaround copies the files into the
container which is messy and risks secrets leaking into container images
if the cleanup fails.

Reviewed by: mjg, kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D37478


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# b3272088 14-Dec-2016 Brooks Davis <brooks@FreeBSD.org>

Add a free_iovec() function to reset iovec's.

The primary purpose is to call nmount() in a loop with new iovec's so
free_iovec takes arguments by reference and resets their values.

Reviewed by: cem
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8513


# b8f532c5 20-Jan-2012 Jaakko Heinonen <jh@FreeBSD.org>

- Clean up checkpath().
- Remove unneeded sysexits.h include.

No functional change.

Submitted by: bde


# d3250014 16-Jan-2012 Jaakko Heinonen <jh@FreeBSD.org>

Change checkpath() to not exit on error. This is a prerequisite for
fixing the mount(8) "failok" option.

PR: 163668
Reviewed by: Garrett Cooper, delphij (previous version)


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# c9c6feb6 26-Dec-2008 David E. O'Brien <obrien@FreeBSD.org>

style(9)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 9fce8c89 14-Nov-2005 Craig Rodrigues <rodrigc@FreeBSD.org>

In build_iovec(), if passed in len is -1, check to see if
val is NULL before doing strlen() to calculate new len.

Submitted by: maxim


# b19e74ca 12-Nov-2005 Craig Rodrigues <rodrigc@FreeBSD.org>

- Make size parameter to build_iovec() a size_t, not an int
- Add build_iovec_argf() helper function, for help converting old
mount options which used the mount_argf() function for the mount() syscall.

Discussed with: phk


# 066b4c16 07-Oct-2005 Craig Rodrigues <rodrigc@FreeBSD.org>

Switch from K&R-style C prototypes to ISO/ANSI-style C prototypes.


# a4c40dd8 25-Nov-2004 Xin LI <delphij@FreeBSD.org>

Avoid comparing pointer against a numerical value by adding a * in
front of it.

Reviewed by: phk


# 3e7c7ae0 25-Nov-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Add a convenience function for building nmount iov arrays.


# 53805858 25-Nov-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Fix bug: don't let "synco" match "sync"


# 4c723140 09-Apr-2004 Mark Murray <markm@FreeBSD.org>

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


# adfdbe22 07-Dec-2003 Tom Rhodes <trhodes@FreeBSD.org>

Style change


# c69284ca 03-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID() to quiet GCC 3.3 warnings.


# 73dd3167 09-Oct-1999 Poul-Henning Kamp <phk@FreeBSD.org>

mount* fixes from Martin Blapp <mb@imp.ch>:

Made mount more userfriendly (bad slashes are now filtered out)
and we remove in mount_nfs trailing slashes if there are any.

Fixed mount_xxx binarys to resolve with realpath(3)
the mountpoint.

Translate the deprecated nfs-syntax with '@' to ':' .
The ':' syntax has now precedence, but '@' still works.
Notify the user that the '@' syntax should not be used.

PR: 7846
PR: 13692
Submitted by: Martin Blapp <mb@imp.ch>
Reviewed by: phk


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# bcb1d846 06-Jul-1998 Philippe Charnier <charnier@FreeBSD.org>

Remove unused #includes. Spelling. Add rcsid. Do not dot terminate err()
strings.


# fba1c154 24-Aug-1997 Steve Price <steve@FreeBSD.org>

Try to avoid mounting filesystems multiple times. Also while
I'm here do some -Wall cleaning.

PR: kern/1839
Reviewed and corrected by: joerg


# 0a9bd6b0 29-Apr-1997 Mike Smith <msmith@FreeBSD.org>

Fix parsing of mount options with '=' in their name.
PR: bin/3027
Submitted by: Louis Mamakos <louie@TransSys.COM>


# c06fe0a0 10-Mar-1997 Peter Wemm <peter@FreeBSD.org>

Merge from Lite2
- use new getvfsbyname() interface and mount(2) interface

**DANGER WILL ROBINSON!!** You must be running a -current kernel
from within a week or so in order for this to work!


# 92e2d9be 05-Mar-1997 Bruce Evans <bde@FreeBSD.org>

Attempt to import Lite2's mount.


# 3fa88dec 01-Nov-1994 Garrett Wollman <wollman@FreeBSD.org>

Add support for filesystem-specific `-o' options, and re-implement the
most common cd9660 and nfs options like God intended them. (It is now
possible to say

mount -o ro,soft,bg,intr there:/foo/bar /foo/bar

again.) This whole getmntopt() business is an incredible botch;
it never should have been anything more than a wrapper around
getsubopt(3). Because if the way the current hackaround is implemented,
options which take arguments (like the old `rsize' and `wsize') are still
unavailable, and must be accessed the new, broken way.

(It's unimaginable how Berkeley managed to screw up one of the few things
about NFS that Sun actually got right to begin with!)


# 0fd4e043 29-Sep-1994 Andrey A. Chernov <ache@FreeBSD.org>

Add code to skip "userquota"/"groupquota" options needed for
quotaon/quotacheck


# 8fae3551 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.