Commit Graph

50 Commits

Author SHA1 Message Date
Robert Watson
03d94b50e5 Teach mount(8) about MNT_ACLS for the purposes of mount options and
mount option printing.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-14 19:40:00 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Robert Watson
ba0fbe9637 Introduce support for Mandatory Access Control and extensible
kernel access control.

Teach mount(8) to understand the MNT_MULTILABEL flag, which is used
to determine whether a file system operates with individual per-vnode
labels, or treats the entire file system as a single object with a
single (mount) label.  The behavior here will probably evolve some
now that nmount(2) is available and can more flexibly support mount
options.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-02 07:02:51 +00:00
Tom Rhodes
3468b317cb more file system > filesystem 2002-05-16 04:10:46 +00:00
Maxime Henrion
da85c82b2a Unbreak NFS mounts when mount(8) is invoked as : mount path@server.
Reviewed by:	obrien
2002-04-23 17:24:02 +00:00
Maxime Henrion
003dbca6a6 Do our best to determine if the user is attempting an NFS mount when
the filesystem type isn't given in the command line.  In the case of
an IPv6 address containing ':', one must use the '@' separator for it
to be properly parsed (mount_nfs(8) still needs fixing at the moment
though).

PR:		bin/37230
Reviewed by:	obrien
MFC after:	1 week
2002-04-22 23:03:03 +00:00
Warner Losh
854299908c o __P removed
o main prototype removed
2002-03-21 13:14:21 +00:00
Ruslan Ermilov
4ccd754686 - VFS_SET(msdos) -> VFS_SET(msdosfs)
- msdos.ko -> msdosfs.ko
- mount_msdos(8) -> mount_msdosfs(8)
- "msdos" -> "msdosfs" compatibility glue in mount(8)
2001-06-01 10:57:26 +00:00
Dima Dorfman
ad0447715b Implement the -r and -w options as -o ro' and -o noro', respectively. At
least in -w's case, simply unsetting the correct bit in init_flags was not
enough.  The bit may be reset later if, say, the filesystem is marked `ro'
in fstab.  The command line option should override the fstab setting, but
did not.  The implementation of -r was changed for consistency.

PR:		26886
Reviewed by:	archie
2001-05-02 02:16:16 +00:00
Alexey Zelkin
5a4420e314 We do not support lfs. Remove it from list of remountable fs'es. 2000-11-22 17:54:56 +00:00
Sheldon Hearn
c62ffab640 Only print information about reads and writes when the -v flag (for
verbose mode) is specified.  This should really have been the case
when this extra cruft was first introduced in rev 1.23.

PR:		20710
Reported by:	Mike Meyer <mwm@mired.org>
2000-08-23 09:59:25 +00:00
Brian Feldman
ab80d6fabc This is another in Martin Blapp's N-series of mount-related cleanups :)
Changes are:
 - rpc.umntall is called at the right places now in /etc/rc*
 - rpc.umntall timeout has been lowered from two days (too high) to one
 - verbose messages in rpc.umntall have been clarified
 - kill double entries in /var/db/mounttab when rpc.umntall is invoked
 - ${early_nfs_mounts} has been removed from /etc/rc
 - patched mount(8) -p to print different pass/dump values for ufs filesystems.
   (last patch recieved from dan <bugg@bugg.strangled.net>)

Submitted by:	Martin Blapp <mbr@imp.ch>, dan <bugg@bugg.strangled.net>
2000-01-15 14:28:14 +00:00
Eivind Eklund
2b184c5087 Fix tab completion mounts (like /cdrom/)
Submitted by:	Martin Blapp <mb@imp.ch>
1999-12-26 16:34:53 +00:00
Kirk McKusick
461bb71e4f Print out the filesystem read counts now collected by the kernel.
Submitted by:	Craig A Soules <soules+@andrew.cmu.edu>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>
1999-12-01 02:16:51 +00:00
Brian Feldman
cf96af72d5 Fix a few things:
1. Get rid of the evilly bogus strdup(fstab) and  free if (fstab == "")
   as in umount.
2. Don't use /etc/fstab info if the mount instance does not exactly match
   the fstab entry.
3. Reversed the mountpoint checking order in getmntpt().
4. Clarify the "not mounted" error message in mount -u.  The previous
   "unknown special file or file system" wasn't quite right.
5. Get rid of a 1-byte memory leak;  this was reported by jhb.

Submitted by:	Martin Blapp <mb@imp.ch>
1999-10-30 17:40:10 +00:00
Brian Feldman
2eb072e493 Let a file with '@' or ':' in it take precedence over defaulting to
nfs.
1999-10-10 15:52:21 +00:00
Poul-Henning Kamp
73dd316734 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
1999-10-09 11:54:14 +00:00
Nick Hibma
af2ea5aae6 - Fixed some cases in which mount was segfaulting.
Original patch from Adrian. Martin added a check for free().

- Included the filesystem type in output of mount

PR:            bin/13143
Submitted-By:  Martin Blapp <mblapp@kassiopeja.lan.attic.ch>
1999-10-08 19:54:32 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Joseph Koshy
5880814dc3 Null commit.
>  PR:		bin/6399
>  Submitted by:	David Malone <dwmalone@maths.tcd.ie>

Also reviewed by:	bde
1999-05-07 05:31:01 +00:00
Joseph Koshy
18af604492 1. Enhanced syntax for mount(8). The -o option now supports two 'meta'
options:

    -o fstab	brings in filesystem options specified in /etc/fstab
    -o current	incorporates the current set of options for the file
		system

   The rightmost option wins in the case of conflicting options being
   specified.

   E.g.:-

   # mount -u -o current,nosuid /home

   will preserve the current mount options while adding the 'nosuid' flag.

2. Rewording of manual page to be hopefully clearer; small -Wall
   cleanups.

Thanks to David Malone for his patience and willingness to work
multiple patches on request.

PR:		bin/6399
Submitted by:	David Malone <dwmalone@maths.tcd.ie>
1999-05-07 05:22:08 +00:00
Bruce Evans
98201b0c60 Fixed `mount -a -u ...'. Rev.1.19 broke this by trying too hard to
avoid mounting filesystems multiple times.

PR:		10572
Submitted by:	Cy Schubert <cy@cschuber.net.gov.bc.ca>
1999-03-16 22:26:51 +00:00
Philippe Charnier
bcb1d8469d Remove unused #includes. Spelling. Add rcsid. Do not dot terminate err()
strings.
1998-07-06 07:12:38 +00:00
Bruce Evans
677b9b3f7c Print the write counts if they are nonzero even if we're mounted
readonly, since they tell us about previous write activity.

Use the correct format to print the write counts.
1998-06-08 14:08:54 +00:00
Dmitrij Tejblum
0580d32288 Remove extraneous ")" from output. 1998-05-17 21:57:17 +00:00
Wolfram Schneider
5ddc8ded1d New mount option nosymfollow. If enabled, the kernel lookup()
function will not follow symbolic links on the mounted
file system and return EACCES (Permission denied).
1998-04-08 18:31:59 +00:00
Peter Wemm
1cd2698705 Don't print the 'writes: sync & async' stuff if we're mounted readonly
or if the fs isn't keeping the stats..
1998-03-27 10:52:13 +00:00
Julian Elischer
b1897c197c Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by:	Kirk McKusick (mcKusick@mckusick.com)
Obtained from:  WHistle development tree
1998-03-08 09:59:44 +00:00
Bruce Evans
f1d7b4203c Converted putfsent() to Lite2 mount interface - don't use numeric
filesystem types.
1998-02-13 04:54:27 +00:00
Julian Elischer
52bf64c787 Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.
1997-11-13 00:28:51 +00:00
KATO Takenori
75b714ac11 Add noclusterr and noclusterw options. The noclusterr and noclusterw
disable clustered read and write, respectively.

Reviewed by:	bde
1997-09-27 13:44:17 +00:00
Steve Price
fba1c154b2 Try to avoid mounting filesystems multiple times. Also while
I'm here do some -Wall cleaning.

PR:		kern/1839
Reviewed and corrected by:	joerg
1997-08-24 21:02:51 +00:00
Andrey A. Chernov
7c506958f1 Change vfork to fork, too many memory-clobbering actions present in child 1997-04-23 23:04:58 +00:00
Bruce Evans
74cf460b66 Finished (?) merging with Lite2: cleaned up #include mess; fixed merging
errors (mis-sorted prototypes, duplicated MNT_NOATIME, duplicated NULL
mntopts fixup).

Updated getopt() usage.

Fixed style bugs in FreeBSD changes (one or two per line for putfsent()
stuff).
1997-03-12 18:35:10 +00:00
Peter Wemm
c06fe0a05e 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!
1997-03-11 12:28:00 +00:00
David Greenman
55e50ace1e Implemented user side of "noatime" mount option. This option disables
the file access time update on reads and can be useful in reducing
filesystem overhead in cases where the access time is not important (like
Usenet news spools).
1996-09-03 07:13:56 +00:00
Jordan K. Hubbard
a257a45ecd I have added a new option -p to the mount command. This was
inspired by SunOS version of mount which uses option -p to
indicate that the mount information should be printed in fstab
format.
This is a neat way to create a new fstab file to use later when
one has modified the mount points or mount options or added or
removed mount some mount points. You just type

	mount -p > /etc/fstab.new

and there is your new fstab file ready to be used though you
will of course have to add any necessary noauto flags manually.

[Committers note:  This also seems to do the wrong thing for AMD
 mounts, but in the more average case this is a nifty feature nonetheless
 and one can always edit the bogus entries out]

Submitted-By: Jukka Ukkonen <jau@jau.csc.fi>
1996-07-21 23:34:04 +00:00
Satoshi Asami
b6cf6bb275 Change the messages slightly when there is no "mount_type" executable
found when the user specifies "mount -t type".  Instead of printing
out one message for each path element (/sbin, /usr/sbin), it prints
out:

mount: exec mount_type not found in /sbin, /usr/sbin: No such file or directory

The code is quite long for such a stupid little piece of aesthesism
but it is very straghtforward so I guess it's ok.  Besides, I don't
want to do a "char foo[100];" and have malloc break down when someone
decides to add a few more paths to a variable that's far apart from
this code. :)

By the way, there is no malloc() off-by-one error for the '\0' at the
end of the string although I don't explicitly add 1 to the length.
The code allocates strlen(path element)+2 bytes for each path element,
and doesn't use the last two bytes (for the delimiting ", ").

Reviewed by:	the list (I hope)
1996-03-15 00:14:09 +00:00
Mike Pritchard
d5f6aa5f24 Backout my changes to disallow "mount /mnt /mnt" until I can verify
that nfs mounts work again (I locked up my home machine testing it and can't
see what happened until I get home from work tonight).
1996-03-11 20:01:17 +00:00
Mike Pritchard
bd70de3eaf Only restrict the user from doing something like "mount /mnt /mnt"
for file system types that actually cause a panic (ufs, msdos, cd9660).
This makes /proc mountable again.
1996-03-11 00:22:28 +00:00
Mike Pritchard
d48b626da3 Do not allow the caller to specify the same path for the special
device file and the mount point.  This prevents the "unexpected recursive
lock" panic from happening.

This is a temporary fix.  A kernel fix would be much much more ugly than
this, and still wouldn't be the "right" way to fix it.  After some
of Terry's file system rework is installed, it will be possible to
properly fix this problem in a clean manner.  Until then,
this change should prevent use from getting a problem report
on this every month or so (and I just noticed that someone in
one of the freebsd news groups was complaining about this problem, too).
1996-03-10 00:20:28 +00:00
Jordan K. Hubbard
66fa281751 Close PR#17. This may be a contraversal fix in that now mount will
spit out two error lines for a bogus filesystem type, e.g:

root@time-> mount -t foo /dev/sd0a /mnt
mount: exec /sbin/mount_foo for /mnt: No such file or directory
mount: exec /usr/sbin/mount_foo for /mnt: No such file or directory

But I would submit that if you're even going to scan multiple directories
for a mount_foo (which I actually think is somewhat bogus - if it's not
in /sbin, you're probably in big trouble anyway), you should emit an error
for each one.  I got multiple complaints (in addition to the PR) that the
existing behavior was very confusing.
1996-03-03 08:44:22 +00:00
David Greenman
89beb278f7 The changes for adding the "noauto" option were mostly wrong. MNT_NOAUTO
is a kernel flag, and the kernel definately doesn't need to know about
it.
1995-08-26 05:39:53 +00:00
Jordan K. Hubbard
81b9534dc5 Add a "noauto" flag so that you can do things like prevent your system
from not coming up multiuser just because you have a CD mount in fstab
but no CD in the drive.
Submitted by:	"Full Name Not Supplied" <simon@masi.ibp.fr>
1995-08-23 12:59:27 +00:00
Bruce Evans
48ab66a1f5 Fix another bogon in the change before the last. 1995-02-16 11:23:25 +00:00
David Greenman
792016e7a4 Woops, last change wasn't done quite right...fixed. 1995-02-15 14:45:08 +00:00
David Greenman
8a978495e7 Verify that the last component of the mount point path exists and is
a directory - allows for better error reporting.
1995-02-15 14:20:50 +00:00
Garrett Wollman
c974f9c6a6 Use getvfs* functions to map between VFS types and names.
Automatically load UFS if it is not present but is loadable.
(This won't happen now, but could happen if we fix NFS diskless support.)
1994-09-22 02:07:33 +00:00
David Greenman
e05db2e2a5 Fixed NULL pointer dereference that occured when any options were
specified.
1994-08-02 11:42:10 +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