Commit Graph

19 Commits

Author SHA1 Message Date
Philippe Charnier
adb378ce60 Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.
1998-08-03 06:44:46 +00:00
Peter Wemm
428fb2dd11 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
1998-05-11 07:38:42 +00:00
Bruce Evans
82000ec41c 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.
1998-02-03 17:23:26 +00:00
Bruce Evans
87f01287d2 Removed definition of _NEW_VFSCONF. The new vfsconf interface is now
the default.
1998-01-20 10:40:18 +00:00
Bruce Evans
bd4f43ff72 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
1998-01-19 18:48:36 +00:00
Warner Losh
b1a3bc5ea0 style(9) corrections
Submitted by:	bde
1997-12-26 23:28:17 +00:00
Warner Losh
5635438650 Be extra paranoid about trusting the length of the data returned by
gethostbyaddr.
Submitted by:	Julian Assange
1997-12-24 01:00:24 +00:00
Steve Price
cbc0b9d0e4 Fix a typo and while here cleanup the use of the .Nm macro.
PR:		docs/4339
Submitted by:	Matthew Hunt <mph@pobox.com>
1997-08-20 11:40:13 +00:00
Philippe Charnier
210a5dc89f Sync usage string according to man page. 1997-06-19 14:44:24 +00:00
Bruce Evans
d499a0ef65 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
1997-06-16 11:20:05 +00:00
Doug Rabson
43f67e2b2e 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>
1997-05-16 10:27:02 +00:00
Doug Rabson
a0bc68a48e Don't try to look up unionfs' <above>, <below> keywords as hostnames. 1997-04-29 09:10:11 +00:00
Warner Losh
8d64695c7c compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
Rodney W. Grimes
5ebc7e6281 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
Garrett Wollman
a5ce0490a4 Fix initialization error that caused `mount -vat' to behave unexpectedly
in certain circumstances.  Fixes PR #182.

Submitted by:	Andrew Atrens <atreand@statcan.ca>
1995-04-10 18:57:08 +00:00
David Greenman
5974081cea 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)
1994-11-04 17:51:37 +00:00
Garrett Wollman
76c72a54c2 Delete obsolete references to librpc.a. 1994-08-08 00:09:22 +00:00
Garrett Wollman
404c1a5fc1 Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.
1994-08-05 02:42:42 +00:00
Rodney W. Grimes
8fae3551ec BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00