summaryrefslogtreecommitdiff
path: root/sbin/umount
Commit message (Collapse)AuthorAgeFilesLines
* Remove advertising clause from University of California Regent's license,Mark Murray2004-04-092-8/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core, imp Notes: svn path=/head/; revision=128073
* s/considred/considered/Christian Brueffer2004-03-041-1/+1
| | | | Notes: svn path=/head/; revision=126569
* style.Makefile(5):Johan Karlsson2004-02-231-1/+1
| | | | | | | Use WARNS?= instead of WARNS=. Notes: svn path=/head/; revision=126178
* Don't include the file system ID in the output of `mount -v' if itIan Dowse2003-12-051-3/+4
| | | | | | | | | | | | 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) Notes: svn path=/head/; revision=123160
* If the unmount by file system ID fails, don't warn before retryingIan Dowse2003-11-161-1/+4
| | | | | | | | | | 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. Notes: svn path=/head/; revision=122804
* When removing trailing slashes, don't remove the first characterIan Dowse2003-10-291-3/+3
| | | | | | | | of the name if it is '/'. Also fix a comparison between signed and unsigned quantities (pointed out by trhodes). Notes: svn path=/head/; revision=121692
* Take advantage of the use of file system IDs to simplify umount(8)Ian Dowse2003-07-201-298/+144
| | | | | | | | | | | | | | | | | | | | 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". Notes: svn path=/head/; revision=117794
* When mount(8) is invoked with the `-v' flag, display the filesystemIan Dowse2003-07-182-16/+50
| | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=117742
* Since checkmntlist() and getmntentry() return a struct statfs thatIan Dowse2003-07-181-24/+17
| | | | | | | includes the filesystem type name, remove the "type" output parameter. Notes: svn path=/head/; revision=117720
* When the file system to unmount is specified by device name insteadIan Dowse2003-07-181-45/+7
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=117712
* Add a new mount flag MNT_BYFSID that can be used to unmount a fileIan Dowse2003-07-011-70/+71
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=117132
* mdoc(7) fixes: Fix the markup in the recently added ENVIRONMENT section.Ruslan Ermilov2003-05-191-6/+6
| | | | Notes: svn path=/head/; revision=115162
* Bump the date for recent commits.Matthew N. Dodd2003-04-071-1/+1
| | | | Notes: svn path=/head/; revision=113234
* Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.Matthew N. Dodd2003-04-071-0/+7
| | | | | | | Requested by: ru Notes: svn path=/head/; revision=113224
* Implement the '-F' option for mount & umount which allows the user toMatthew N. Dodd2003-04-072-3/+18
| | | | | | | specify an alternate fstab file. Notes: svn path=/head/; revision=113220
* Quiet warning.Matthew N. Dodd2003-04-071-2/+2
| | | | Notes: svn path=/head/; revision=113216
* Remove one of two WARNS=0.Johan Karlsson2003-02-231-1/+0
| | | | Notes: svn path=/head/; revision=111307
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-2/+2
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-212-19/+19
| | | | Notes: svn path=/head/; revision=102231
* - Introduce a new struct xvfsconf, the userland version of struct vfsconf.Maxime Henrion2002-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=101651
* The .Nm utility.Philippe Charnier2002-07-061-3/+2
| | | | Notes: svn path=/head/; revision=99503
* more file system > filesystemTom Rhodes2002-05-161-3/+3
| | | | Notes: svn path=/head/; revision=96707
* Default to WARNS=2.David E. O'Brien2001-12-041-0/+3
| | | | | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87325
* Oops, fix a missing condition that broke umount's `-h' option. IIan Dowse2001-10-131-1/+2
| | | | | | | | had somehow removed an error check in revision 1.26, causing errx() to be called unconditionally in the -h case. Notes: svn path=/head/; revision=84868
* Fix some bugs and general brain damage in mounttab:Ian Dowse2001-07-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=80146
* Include the remote hostname in RPC-related warning messages. ExitIan Dowse2001-07-221-25/+24
| | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=80118
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79530
* Remove vestiges of MFS.Ruslan Ermilov2001-06-011-2/+2
| | | | Notes: svn path=/head/; revision=77575
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-0/+1
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74815
* Set the default manual section for sbin/ to 8.Ruslan Ermilov2001-03-201-1/+0
| | | | Notes: svn path=/head/; revision=74531
* Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) andAlfred Perlstein2001-03-191-66/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=74462
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-2/+2
| | | | Notes: svn path=/head/; revision=68960
* Fix comment to match previous commit, as per bde.Dag-Erling Smørgrav2000-09-071-1/+1
| | | | Notes: svn path=/head/; revision=65564
* Don't warn about unknown mount types, since they most likely simply meanDag-Erling Smørgrav2000-09-061-3/+1
| | | | | | | | that the right module hasn't been loaded yet (and mount(8) will do so when necessary). Notes: svn path=/head/; revision=65525
* Clarify "mount -a -t" example - it only unmounts stuff in /etc/fstab.David Malone2000-07-131-2/+5
| | | | | | | | | | | Fix a typo. PR: 19438 Submitted by: Eoin Lawless <eoin@maths.tcd.ie> Reviewed by: sheldon Notes: svn path=/head/; revision=63073
* Finish up umntall support. init now passed an argument to theMatthew Dillon1999-11-222-5/+24
| | | | | | | | | | | | 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> Notes: svn path=/head/; revision=53550
* Fix a logic problem that broke umount -a.Brian Feldman1999-10-291-4/+5
| | | | | | | Reported by: Martin Blapp <mb@imp.ch> Notes: svn path=/head/; revision=52622
* Small bugfixes (point not getting marked in one case, string not NUL andBrian Feldman1999-10-231-14/+14
| | | | | | | | | wrong size in the other.) Submitted by: Martin Blapp <mb@imp.ch> Notes: svn path=/head/; revision=52440
* Fix a few things. Unbogosify a free(), {,UN}MARK with correct args, andBrian Feldman1999-10-181-22/+22
| | | | | | | | | fix count checks. Submitted by: Martin Blapp <mb@imp.ch> Notes: svn path=/head/; revision=52374
* quoting << Martin_BlappBrian Feldman1999-10-172-147/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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> Notes: svn path=/head/; revision=52340
* Fix -Wall warningsNick Hibma1999-10-081-2/+3
| | | | | | | Submitted-By: Martin Blapp <mblapp@kassiopeja.lan.attic.ch> Notes: svn path=/head/; revision=52037
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50476
* Use errx() instead of err() for malloc failures. -Wall. Do not dotPhilippe Charnier1998-08-032-13/+14
| | | | | | | terminate errx() string. Remove unused #includes. Use .Tn for NFS. Notes: svn path=/head/; revision=38041
* Fix PR 1607, hopefully without breaking the PR 5208 fixes.Peter Wemm1998-05-111-7/+7
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=35939
* Fixed the previous fix. The original path was annulled when itBruce Evans1998-02-031-3/+4
| | | | | | | | was a directory, so the error message for attempting to unmount an unmounted-on directory was more broken than before. Notes: svn path=/head/; revision=33038
* Removed definition of _NEW_VFSCONF. The new vfsconf interface is nowBruce Evans1998-01-201-2/+0
| | | | | | | the default. Notes: svn path=/head/; revision=32645
* mount(8) only uses realpath() for the mountpoint, so don't look up theBruce Evans1998-01-191-6/+6
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=32626
* style(9) correctionsWarner Losh1997-12-261-1/+2
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=32008
* Be extra paranoid about trusting the length of the data returned byWarner Losh1997-12-241-1/+1
| | | | | | | | gethostbyaddr. Submitted by: Julian Assange Notes: svn path=/head/; revision=31959
* Fix a typo and while here cleanup the use of the .Nm macro.Steve Price1997-08-201-6/+7
| | | | | | | | PR: docs/4339 Submitted by: Matthew Hunt <mph@pobox.com> Notes: svn path=/head/; revision=28458