History log of /freebsd-current/sbin/umount/umount.c
Revision Date Author Comments
# e96d0d74 22-Apr-2024 Ricardo Branco <rbranco@suse.de>

umount: Support partitions & slices with -d option

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1183


# 840a8027 02-Feb-2024 Ricardo Branco <rbranco@suse.de>

umount: Add -d option to detach md devices

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/972


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

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


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# efb45ad0 09-Apr-2022 Gordon Bergling <gbe@FreeBSD.org>

umount(8): Remove a double word in a source code comment

- s/this this/this/

MFC after: 3 days


# 245bfd34 20-May-2020 Ryan Moeller <freqlabs@FreeBSD.org>

Deduplicate fsid comparisons

Comparing fsid_t objects requires internal knowledge of the fsid structure
and yet this is duplicated across a number of places in the code.

Simplify by creating a fsidcmp function (macro).

Reviewed by: mjg, rmacklem
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24749


# 9696ba7f 13-Sep-2018 Mateusz Guzik <mjg@FreeBSD.org>

umount: remove sync(2) call when used with -f

It completely unnecessarily iterates over all filesystems and happens
to be executed a lot e.g. by synth.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17143


# 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.


# 4261923e 29-Jul-2017 Rick Macklem <rmacklem@FreeBSD.org>

Add a new "-N" option to umount(8), that does a forced dismount of an NFS mount
point.

The new "-N" option does a forced dismount of an NFS mount point, but avoids
doing any checking of the mounted-on path, so that it will not get hung
when a vnode lock is held by another hung process on the mounted-on vnode.
The most common case of this is a "umount" with the "-f" option.
Other than avoiding checking the mounted-on path, it performs the same
forced dismount as a successful "umount -f" would do.

This commit includes a content change to the man page.

Tested by: pho
Reviewed by: kib
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11735


# 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


# 49a8bad7 19-Nov-2016 Rick Macklem <rmacklem@FreeBSD.org>

Modify umount so that it does not do an Unmount RPC for NFSv4 mounts
and uses TCP for the Unmount RPC if the mount is over TCP.
Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.

Suggested by: cperciva
Reviewed by: cperciva
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8503


# debc480e 07-Jul-2016 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by: kib@
Approved by: re (gjb@)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7047


# e96092e8 29-Dec-2015 Ulrich Spörlein <uqs@FreeBSD.org>

Fix type mismatches for malloc(3) and Co.

Found by: clang static analyzer
Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D4722


# 1b31334c 16-Aug-2014 Peter Wemm <peter@FreeBSD.org>

Use mount protocol version 3 by default for showmount and umount.
mount_nfs effectively uses mount protocol v3 by default already.
v1 mount protocol is being removed along with nfsv2 by a high profile NFS
appliance vendor and our legacy v1 mount protocol usage causes rpc errors.


# c27063b9 15-Nov-2012 Eitan Adler <eadler@FreeBSD.org>

Fix memory leak in umount.c

PR: bin/172553
Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Approved by: cperciva
MFC after: 3 days


# 1efe3c6b 04-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


# 80bbaeb5 14-Jul-2011 Kirk McKusick <mckusick@FreeBSD.org>

When using -A option (unmount all mounted filesystems), do not attempt
to unmount /dev as it will always fail.


# b37ce154 29-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Modify the umount(8) command so that it doesn't do
a sync(2) syscall before unmount(2) for the "-f" case.
This avoids a forced dismount from getting stuck for
an NFS mountpoint in sync() when the server is not
responsive. With this commit, forced dismounts should
normally work for the NFS clients, but can take up to
about 1minute to complete.

PR: kern/157365
Reviewed by: kib
MFC after: 2 weeks


# 34ae1bb6 23-Mar-2011 Ruslan Ermilov <ru@FreeBSD.org>

It's possible to unmount multiple items at once, make it clear.


# 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.


# de482c79 27-Feb-2010 Hajimu UMEMOTO <ume@FreeBSD.org>

MFC r203490: Introduce '[ipaddr]:path' notation.
Since the existing implementation searches ':' backward, a path which
includes ':' could not be mounted. You can now mount such path by
enclosing an IP address by '[]'.
Though we should change to search ':' forward, it will break
'ipv6addr:path' which is currently working. So, it still searches ':'
backward, at least for now.


# a505d435 04-Feb-2010 Hajimu UMEMOTO <ume@FreeBSD.org>

Introduce '[ipaddr]:path' notation.
Since the existing implementation searches ':' backward, a path which
includes ':' could not be mounted. You can now mount such path by
enclosing an IP address by '[]'.
Though we should change to search ':' forward, it will break
'ipv6addr:path' which is currently working. So, it still searches ':'
backward, at least for now.

MFC after: 2 weeks


# ef096f9d 27-Jan-2010 Xin LI <delphij@FreeBSD.org>

MFC r200135:

Make umount(8) WARNS=6 clean:
- Cast delimiter width to integer [1]
- Solve name conflicts against system header
- Constify parameters to avoid qualifier conflict

PR: bin/140017 [1]
Submitted by: Ulrich Spörlein <uqs spoerlein net> [1]
Sponsored by: iXsystems, Inc


# ca25fa25 29-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Let umount build with -Wold-style-definition.


# 7f471a32 28-Dec-2009 Xin LI <delphij@FreeBSD.org>

Make umount(8) WARNS=6 clean:
- Cast delimiter width to integer [1]
- Solve name conflicts against system header
- Constify parameters to avoid qualifier conflict

PR: bin/140017 [1]
Submitted by: Ulrich Spörlein <uqs spoerlein net> [1]
MFC after: 1 month
Sponsored by: iXsystems, Inc


# 0775314b 24-Jun-2009 Doug Rabson <dfr@FreeBSD.org>

Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.


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

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


# 8d646af5 10-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# 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


# 8b918187 05-Dec-2003 Ian Dowse <iedowse@FreeBSD.org>

Don't include the file system ID in the output of `mount -v' if it
is all zeros. The kernel now consistently zeroes FSIDs for non-root
users, so there's no point in printing these. Also fix a misspelling
in a comment.

Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by: re (scottl)


# 0ed25a9a 16-Nov-2003 Ian Dowse <iedowse@FreeBSD.org>

If the unmount by file system ID fails, don't warn before retrying
a non-fsid unmount if the file system ID is all zeros. This is a
temporary workaround for warnings that occur in the vfs.usermount=1
case because non-root users get a zeroed filesystem ID. I have a
more complete fix in the works, but I won't get it done for 5.2.


# 5fff0914 29-Oct-2003 Ian Dowse <iedowse@FreeBSD.org>

When removing trailing slashes, don't remove the first character
of the name if it is '/'. Also fix a comparison between signed and
unsigned quantities (pointed out by trhodes).


# eddb4805 19-Jul-2003 Ian Dowse <iedowse@FreeBSD.org>

Take advantage of the use of file system IDs to simplify umount(8)
and make it work more reliably in a number of cases that have
traditionally been troublesome. The new behaviour is:
1) If the filesystem can be determined by the fsid or device,
or uniquely identified by the mountpoint, then just go ahead
and call unmount(2) using the file system ID.
2) Otherwise use fstatfs(2) to resolve the path into a file system
ID (checking with stat(2) that it is a filesystem root directory).

Case 2 can potentially block if an NFS server is down, but it can
always be avoided by using an unambiguous specification. It handles
all the hard cases such as symlinks and mismatches between the mount
list and reality. For example, if a filesystem was mounted as /mnt
inside a chroot, it will show up in the mount list as /mnt, but now
you can unmount it from outside the chroot with "umount /chroot_path/mnt".


# 38f102c2 18-Jul-2003 Ian Dowse <iedowse@FreeBSD.org>

When mount(8) is invoked with the `-v' flag, display the filesystem
ID for each file system in addition to the normal information.

In umount(8), accept filesystem IDs as well as the usual device and
path names. This makes it possible to unambiguously specify which
file system is to be unmounted even when two or more file systems
share the same device and mountpoint names (e.g. NFS mounts from
the same export into different chroots).

Suggested by: Dan Nelson <dnelson@allantgroup.com>


# 1add162c 18-Jul-2003 Ian Dowse <iedowse@FreeBSD.org>

Since checkmntlist() and getmntentry() return a struct statfs that
includes the filesystem type name, remove the "type" output parameter.


# f73d495f 17-Jul-2003 Ian Dowse <iedowse@FreeBSD.org>

When the file system to unmount is specified by device name instead
of by mount point, umount had to take care not to unmount the wrong
file system if another file system was covering the requested one.
Now that the file system to unmount is specified to the kernel using
the filesystem ID, this confusion cannot occur, so remove the code
that checked for it.


# 318f2fb4 01-Jul-2003 Ian Dowse <iedowse@FreeBSD.org>

Add a new mount flag MNT_BYFSID that can be used to unmount a file
system by specifying the file system ID instead of a path. Use this
by default in umount(8). This avoids the need to perform any vnode
operations to look up the mount point, so it makes it possible to
unmount a file system whose root vnode cannot be looked up (e.g.
due to a dead NFS server, or a file system that has become detached
from the hierarchy because an underlying file system was unmounted).
It also provides an unambiguous way to specify which file system is
to be unmunted.

Since the ability to unmount using a path name is retained only for
compatibility, that case now just uses a simple string comparison
of the supplied path against f_mntonname of each mounted file system.

Discussed on: freebsd-arch
mdoc help from: ru


# ef258dd9 06-Apr-2003 Matthew N. Dodd <mdodd@FreeBSD.org>

Implement the '-F' option for mount & umount which allows the user to
specify an alternate fstab file.


# 5c514aee 07-Apr-2003 Matthew N. Dodd <mdodd@FreeBSD.org>

Quiet warning.


# 9d5abbdd 01-Jan-2003 Jens Schweikhardt <schweikh@FreeBSD.org>

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


# ce66ddb7 21-Aug-2002 Tom Rhodes <trhodes@FreeBSD.org>

s/filesystem/file system/g as discussed on -developers


# 5965373e 10-Aug-2002 Maxime Henrion <mux@FreeBSD.org>

- Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
kernel, and rewrite getvfsbyname() to use this instead of the weird
existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility. Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.


# 3468b317 15-May-2002 Tom Rhodes <trhodes@FreeBSD.org>

more file system > filesystem


# 21eff82f 12-Oct-2001 Ian Dowse <iedowse@FreeBSD.org>

Oops, fix a missing condition that broke umount's `-h' option. I
had somehow removed an error check in revision 1.26, causing errx()
to be called unconditionally in the -h case.


# afe1ef24 21-Jul-2001 Ian Dowse <iedowse@FreeBSD.org>

Fix some bugs and general brain damage in mounttab:
- Declare mtabhead as an extern in mounttab.h and define it only in
mounttab.c.
- Remove shared global `verbose' and instead pass it as a parameter.
- Remove the `mtabp' argument to read_mtab(). It served no purpose
whatsoever, although read_mtab() did use it as a temporary local
variable.
- Don't check for impossible conditions when parsing mounttab, and
do detect zero-length fields.
- Correctly test for strtoul() failures - just testing ERANGE is wrong.
- Include a field name in syslog errors, and avoid passing NULL to
a syslog %s field.
- Don't test if arrays are NULL.
- If there are duplicates when writing out mounttab, keep the last
entry instead of the first, as it will have a later timestamp.
- Fix a few formatting issues.

Update rpc.umntall and umount to match the mounttab interface changes.


# 13e2e1af 21-Jul-2001 Ian Dowse <iedowse@FreeBSD.org>

Include the remote hostname in RPC-related warning messages. Exit
immediately if a host specified by the -h flag cannot be parsed
instead of attempting to unmount all NFS filesystems, which was
bad.

Add a missing return statement at the end of checkname(); this
could result in a non-zero exit status in some cases even if the
unmount succeeded.

Group two separate NFS-related operations into one block to make
it more obvious that a variable (hostp) is not dereferenced when
uninitialised. Initialise it to NULL anyway to avoid a warning.

Pass in the read_mtab()'s bogus argument as NULL instead of messing
with a local variable to achieve the same effect. A later commit
will clean up this mounttab interface.


# 8360efbd 18-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul


# b6e55a05 07-Sep-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix comment to match previous commit, as per bde.


# 81667275 06-Sep-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't warn about unknown mount types, since they most likely simply mean
that the right module hasn't been loaded yet (and mount(8) will do so
when necessary).


# a69497d7 21-Nov-1999 Matthew Dillon <dillon@FreeBSD.org>

Finish up umntall support. init now passed an argument to the
rundown script 'reboot' or 'single'. ISO support (which never
worked) has been removed from mount_nfs. mount_nfs and umount
now use mounttab, which allows umntall to work properly. The
rc scripts now call umntall as appropriate.

Submitted by: Martin Blapp <mb@imp.ch>


# 91a81678 29-Oct-1999 Brian Feldman <green@FreeBSD.org>

Fix a logic problem that broke umount -a.

Reported by: Martin Blapp <mb@imp.ch>


# 0fe9a7da 22-Oct-1999 Brian Feldman <green@FreeBSD.org>

Small bugfixes (point not getting marked in one case, string not NUL and
wrong size in the other.)

Submitted by: Martin Blapp <mb@imp.ch>


# 0602ee7c 17-Oct-1999 Brian Feldman <green@FreeBSD.org>

Fix a few things. Unbogosify a free(), {,UN}MARK with correct args, and
fix count checks.

Submitted by: Martin Blapp <mb@imp.ch>


# bc70c172 17-Oct-1999 Brian Feldman <green@FreeBSD.org>

quoting << Martin_Blapp

- Completly changed the internals of umount(8). We do three
checks now to see if 'argv' is in the mounttable. It they
all fail, we return to main and print a warning.

- fixed the umount mount-order. The checks are rather complex
to do this. Cause umount(8) should also be able to unmount
several devices at once ('umount -a', 'umount -A',
'umount /mnt /mnt2'), the mount-order get's important.
I added checks to mark and unmark already unmounted devices.

- Various fixes with nfs-unmounts (no rpc-calls were done,
or they were done although there was an existing mount).
Since we allow overlay-mounts, we should also handle them
properly.

- Translate the deprecated nfs-syntax with '@' to ':' like
mount_nfs does. The ':' syntax has now precedence, but '@'
still works.

- 'umount -v' is now fixed for all cases and doesn't print
garbage like two times the mountpoint etc.

- removed non documented and useless umount '-F'.

- hanged nfsmounts can now unmounted 'without' any problems.
I've removed stat() and realpath() checks on the mountpoint.
Instead we just do a realpath() on the basedir of the
mountpath and add the dirname again.
Implemented this as an idea from phk. But there are still
vfs-restrictions if the nfs_mount is busy. If there are
unwritten metadata on a hanged nfs-mount, and we modify
nfs_vfsops.c to not return EBUSY, we get a deadlock :(
The problem has now moved from userland to kernel.

- removed the BUGS part from the umount(8) manpage.

- Converted it to ANSI C (more than 60% of the code have
changed).

Martin_Blapp

Fixed PR's
----------

o [1999/02/03] bin/9893 NFS umount of regular file impossible

s [1995/11/27] bin/841 stale nfs mounts cannot be umounted

o [1999/08/01] bin/12911 alfred NFS umounts are not properly done
if just the mountpoint gets umounted

Only partially solved:
----------------------

The problem is now in kernel:

o [1999/04/07] bin/11005 `umount -f' does not work if the
NFS-server is down.

PR: bin/9893 bin/841 bin/12911 bin/11005
Submitted by: Martin Blapp <mb@imp.ch>


# ae0c2c78 08-Oct-1999 Nick Hibma <n_hibma@FreeBSD.org>

Fix -Wall warnings

Submitted-By: Martin Blapp <mblapp@kassiopeja.lan.attic.ch>


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

$Id$ -> $FreeBSD$


# adb378ce 03-Aug-1998 Philippe Charnier <charnier@FreeBSD.org>

Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.


# 428fb2dd 11-May-1998 Peter Wemm <peter@FreeBSD.org>

Fix PR 1607, hopefully without breaking the PR 5208 fixes.

umount() was trying to stat() the mountpoint, this would fail if the
mountpoint was a NFS mountpoint, and the fallback code would try and pass
a hostname:/dir path as the mountpoint to unmount(2), which would fail.

This whole stat() of the name supplied on the command line business is
trouble as it'll wedge on a hung NFS mount.

I'm not entirely sure why we are not simply looking up both arguments
in the mount table and doing the right thing without accessing the
filesystem. It seems that we're going to a lot of trouble to allow
mountpoints on symlinks and other wierd things.

PR: 1607


# 82000ec4 03-Feb-1998 Bruce Evans <bde@FreeBSD.org>

Fixed the previous fix. The original path was annulled when it
was a directory, so the error message for attempting to unmount
an unmounted-on directory was more broken than before.


# bd4f43ff 19-Jan-1998 Bruce Evans <bde@FreeBSD.org>

mount(8) only uses realpath() for the mountpoint, so don't look up the
real path here for the mount device (or path). This fixes difficulties
unmounting devices that are actually symlinks to real devices.

Also, print the original path instead of the real path in early error
messages. nfs path handling and later error messages may still be wrong,
probably only in silly cases where the original path is both a symlink
and a remote path.

PR: 5208


# b1a3bc5e 26-Dec-1997 Warner Losh <imp@FreeBSD.org>

style(9) corrections
Submitted by: bde


# 56354386 23-Dec-1997 Warner Losh <imp@FreeBSD.org>

Be extra paranoid about trusting the length of the data returned by
gethostbyaddr.
Submitted by: Julian Assange


# 210a5dc8 19-Jun-1997 Philippe Charnier <charnier@FreeBSD.org>

Sync usage string according to man page.


# d499a0ef 16-Jun-1997 Bruce Evans <bde@FreeBSD.org>

Merge from Lite2.
- use new getvfsbyname() interface.
- new -A option, like -a except only mounted file systems are unmounted.

All non-cosmetic FreeBSD changes in umount.c, except ignoring of
realpath() failures, went away because they are done better in Lite2.
realpath() failures must be ignored so that non-pathnames like
"<above>:/foo" and "host:/bar" get as far as mount(2).

Reviewed by: dfr


# 43f67e2b 16-May-1997 Doug Rabson <dfr@FreeBSD.org>

Generalise the previous change so that only NFS hostnames are looked up.

PR: bin/3588
Suggested by: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>


# a0bc68a4 29-Apr-1997 Doug Rabson <dfr@FreeBSD.org>

Don't try to look up unionfs' <above>, <below> keywords as hostnames.


# 8d64695c 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 1811bdf3 11-Mar-1997 Peter Wemm <peter@FreeBSD.org>

Import some CSRG 4.4BSD-Lite2 components for sbin onto vendor branch.
(note that some of these have already been imported, this is a no-op)


# 5ebc7e62 30-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# a5ce0490 10-Apr-1995 Garrett Wollman <wollman@FreeBSD.org>

Fix initialization error that caused `mount -vat' to behave unexpectedly
in certain circumstances. Fixes PR #182.

Submitted by: Andrew Atrens <atreand@statcan.ca>


# 5974081c 04-Nov-1994 David Greenman <dg@FreeBSD.org>

From njw@cs.city.ac.uk (Nick Williams):

/sbin/umount does not return the correct exit status due to incorrect
logic in its internals.

Further, because of the nature of the code, you *cannot* use it to
umount a directory from a union mountpoint. Well, you can sometimes,
it depends on if the directory is at the top of the union stack or not :)

Submitted by: njw@cs.city.ac.uk (Nick Williams)


# 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.