| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
If we are mounting nfsv2 or nfsv3 and statd isn't running and we
cannot start statd, then fail the mount request.
Also use an RPC ping to check on statd.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would seem to make sense for mount.nfs to impose the
"-o user" => "-o noexec,nodev,nosuid"
rule. However if you give "user,exec" to /sbin/mount,
it will pass down
nodev,nosuid,user
with the 'exec' flag :-(
So we have to leave that handling of that particular rule to
/sbin/mount.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 6facb22402a0bd8cd49be2ed1a0856b24fef42f4 changed the allocation
of len to no longer get 20 extra bytes. It needs to get at least one
extra byte for a null character, otherwise a single extra option such
as "sec=krb5" is never copied in parse_opt() and is dropped.
Commit 44a3727a3243e674a1f1fdad5cbbc639aa25d01c added a typo when
checking the program name.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
| |
Failure to tell mountd about the unmount should not be classes
and an error and DEFINTELY should not stop the filesystem
from being unmounted.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch avoid the collision between commas in security contexts and the
delimiter between mount options.
Try:
mount.nfs foo://mnt/bar /mnt/bar -o context=\"aaa,bbb,ccc\",ro
Signed-off-by: Cory Olmo <colmo@TrustedCS.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
| |
Also fix a few bugs that came up in initial testing.
|
|
|
|
|
|
| |
getopt_long uses argv[0] in error messages. So it it is given
argv+2 for example, we need to make sure that argv[2] has the
correct program name.
|
|
|
|
|
| |
Reject if there are non-flag args,
Reject if the filesystem is not an NFS filesystem.
|
|
|
|
|
| |
Make sure all possible invalid arguments are discovered and reported.
Make sure nothing gets by for uid!=0 that doesn't perfectly match fstab.
|
|
|
|
|
|
|
|
| |
On -o remount, we need to update the entry in mtab rather than
add a new one. update_mtab does this so use that.
However it might free some strings that shouldn't be freed, so
stop it from calling free - the program will exit soon anyway
so no exit is needed.
|
|
|
|
|
|
|
|
|
| |
The fake option has to write to mtab like a normal mount. Read mount(8) man
page for more details. It's very important for system init scripts that use
"-f" as a way how write info about mount points to /etc/mtab.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
| |
|
|
|
|
| |
Providing user=username or users is listed in mtab.
|
|
|
|
| |
They are identical and the later allows us to use hasmntent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If "user" or "users" is given, then allow mount.nfs to be run
by a non-root user providing that the mountpoint, filesystem, and options
exactly match what is found in fstab.
For "user", record the user name in mtab so they can unmount the
filesystem later.
Also alwasys ignore auto, owner, group and their negations as well
as "_netdev", "comment" and "loop".
|
|
|
|
|
| |
The version of the interface to the kernel for requesting a mount
it entirely different to the version of NFS that is being mounted.
|
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
| |
|
|
|
|
|
|
| |
Because, ofcourse, we haven't.
When we do finally let-go of the mount, the server won't get told,
but the same would happen on a crash, and the server just has to cope.
|
|
|
|
|
|
| |
nfsumount() returns 1 for success and 0 for failure.
Take proper account of this when producing an exit
status.
|
|
|
|
|
| |
Defaults are now tcp/v3.
Several bugs have been fixed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- remove non-used arguments from del_mtab.
- Don't try to pass a "host:/path" string to umount.
It used to be possible to umount("/dev/whatever"). It has never
been possible to umount("host:/path").
- Don't try to read /proc/mounts first. Some mount options (mount_vers)
are only stored in /etc/mtab, not in /proc/mounts. So we have to
prefer /etc/mtab as getmntXbackwards do.
- Only every call one of getmnt{dir,dev}backwards, depending on whether
'spec' looks like a path name or a host:/path.
- Don't call _nfsumount unless we have a host:/path, or del_mtab unless we
have a path name.
|
|
|
|
|
|
|
| |
add_mtab2 is used to remove an entry from mtab, rename it to del_mtab.
Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch do following things:
1. When unmounting, we should try /proc/mounts first. Only then in
/etc/mtab if it wasn't found.
2. Reject name passed to us which is not starts with a '/' or not
contains a ':'
3. Fix the method to get UMNT protocol
Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This fix umount.nfs4's BUG, patch cleanup some useless code.
1. Combine nfs3_umount() and nfs2_umount() to nfs_umount()
2. If it is a nfs4 remote file system or unkown mount version, do not
probe remote mount port and not send UMNT request wich is not necessary
Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
This patch lets umount to use correct UMNT version to do umount.
In latest kernel, the version format is "vers=3" etc., and in old kernel
the version format is "v3","v4" etc.
Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
| |
This patch is now hard-coded in the Makefile.am and cannot
be changed by configure. But as it needs to match what
util-linux does, that is probably a good thing.
|
|
|
|
|
|
|
|
|
|
|
| |
If statd is not running (/var/run/rpc.statd.pid) when an nfs filesystem
is mounted (v2 or v3, with remote locking enabled), and if
/usr/sbin/start-statd (or other program specified at config time) is
present, then run that program to start statd.
This means that statd does not need to be running "just in case".
It only needs to be started at boot time if the nfs server is
started.
|
|
|
|
|
|
|
|
|
| |
Solaris servers, when asked to share a filesystem with an anon-uid, will
report the only available authentication style as AUTH_NONE in the
reply from mountd (even though they actually accept AUTH_SYS and simply
ignore the credentiuals).
So if no sec= is specified we should really accept anything that can easily
be handled. ie. AUTH_SYS or AUTH_NONE.
|
|
|
|
|
|
|
|
| |
Only create a mount-time reserved port socket for kernels
which require it (pre-2.1.32/nfs_mount_version 1).
Signed-off-by: Tom Talpey <tmt@netapp.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When connecting to an NFSv4 server we need to find out IP address
as it would be seen by the server, to register an address for
callbacks.
This is most easily done by connecting the socket to the
servers address and then getting the address of our endpoint.
However with a connected UDP socket, replies that come from a
different IP address - as can happen with non-Linux multi-homed
servers - will be rejected.
So if we connected our UDP socket, we need to be sure to
disconnect it before using it.
This patch adds an option to get_socket to say if we want it
connected or not and, in the case where we do, we disconnect
a UDP socket after the connection information has been used.
Also clean up the error handling in clnt_ping which was getting
clumsy.
|
|
|
|
| |
For completeness... and who knows, someone might want it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi all,
I noticed some mtab corruption the other day when doing some autofs
testing but thought nothing of it.
When investigating another issue I came across utils/mount.c:add_mtab
which looks like it adds an entry to /etc/mtab without performing
correct locking. Perhaps this is not needed when adding entries but I
think it is.
|
|
|
|
|
|
|
| |
Merge utils/mount/nfsmount.x and support/export/mount.x into support/export/mount.x.
Signed-off-by: Amit Gud <agud@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to give an IP address to identify this client to the
server.
The current code does a gethostbyname of the hostname. One
some systems this returns 127.0.0.1 or similar, which is not useful.
Instead, use getsockname of the sock used to connect to the server
to confirm that the server is working. This gives the address on the
interface that was chosen to talk to that server, which is the
best address we can find (if there is a NAT in the way, it might
still not work, but in that case there is nothing we can do).
|
| |
|
|
Adds the mount directory and the code to mount and umount the NFS file system.
Signed-off-by: Amit Gud <agud@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|