summaryrefslogtreecommitdiffstats
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix handling of explicit uuidDavid Woodhouse2008-08-281-1/+3
| | | | | | | | | | | Fix a couple of bugs which show up if you try to explicitly set a 16-byte UUID when exporting a file system. First, exportfs cuts the first two bytes off the UUID and writes something invalid to etab. Second, mountd writes the _ascii_ form of the UUID to the kernel, instead of converting it to hex. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount issue with Mac OSX and --manage-gids, client hangsNeil Brown2008-08-271-1/+3
| | | | | | | | | Make sure are zero len group list is sent down to the kernel when the gids do not exist on the server. Tested-by: Alex Samad <alex@samad.com.au> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs command: old glibc missing some flagsChuck Lever2008-07-311-0/+18
| | | | | | | | | | | | | | | | Old versions of glibc (< 2.4) have a getaddrinfo(3) implementation, but do not include public definitions of the AI_V4MAPPED, AI_ALL, and AI_ADDRCONFIG flags because it was believed that these flags were not standardized. However, these flags have standard definitions both in POSIX 1003 and in RFCs, and were thus included in later releases of glibc. To allow the mount.nfs command to build on systems with these older versions of glibc, add conditional definitions for these flags in utils/mount/network.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount issuesMartin Leisner2008-07-251-2/+4
| | | | | | | | The connect_nb() routne returns zero for success and a negative value for failure which was not being interpreted correctly by the getport() routine. This patch fixes that problem. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5) man page: Add documentation for the "mountproto=" optionChuck Lever2008-07-251-0/+19
| | | | | | | | Looks like mountproto= was never documented in nfs(5). Add a paragraph that describes it in the "nfs mount options" section. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify: perform DNS lookup in the background.Steve Dickson2008-07-251-20/+40
| | | | | | | | | | | | | If an NFS server has no network connectivity when it reboots, it will block in sm-notify waiting for DNS lookup for a potentially large number of hosts. This is not helpful and just annoys the sysadmin. So do the DNS lookup in the backgrounded phase of sm-notify, before sending off the NOTIFY requests. Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* If portmap is not listening on UDP (as apparently happens withNeil Brown2008-07-161-4/+15
| | | | | | | | | | | | | | | | | | | MS-Windows-Server2003R2SP2), then nfs mounts have to be mounted with -o mountproto=tcp to succeed. In this case a umount will still try UDP and will fail to contact the server. It will still succeed with the local unmount (after a timeout) but exits with a non-zero exit status. This causes /bin/mount to retry so we get a strange error about the filesystem not being mounted. So: get umount to use tcp if "mountproto=tcp" appears in mtab ignore any failure message from the server that would overwrite a success message from the local umount syscall. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* If an NFS server is only listening on TCP for portmap (as apparentlyNeil Brown2008-07-162-2/+29
| | | | | | | | | | | | | | | MS-Windows-Server2003R2SP2 does), mount doesn't cope. There is retry logic in case the initial choice of version/etc doesn't work, but it doesn't cope with mountd needing tcp. So: Fix probe_port so that a TIMEDOUT error doesn't simply abort but probes with other protocols (e.g. tcp). Fix rewrite_mount_options to extract the mountproto option before doing a probe, then set mountproto (and mount prot) based on the result. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: Include the bare minimum of legacy RPC headers inChuck Lever2008-07-156-24/+9
| | | | | | | utils/mount/network.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: remove unneeded headers from utils/mount/stropts.c.Chuck Lever2008-07-151-11/+3
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: rename a couple of functions in utils/mount/stropts.c to matchChuck Lever2008-07-151-9/+9
| | | | | | | the naming convention of the others. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: remove unused IPv4-only functions used by the text-based mountChuck Lever2008-07-153-54/+0
| | | | | | | command. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Traditionally the mount command has looked for a ":" to separate theChuck Lever2008-07-155-82/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | server's hostname from the export path in the mounted on device name, like this: mount server:/export /mounted/on/dir The server's hostname is "server" and the export path is "/export". You can also substitute a specific IPv4 network address for the server hostname, like this: mount 192.168.0.55:/export /mounted/on/dir Raw IPv6 addresses present a problem, however, because they look something like this: fe80::200:5aff:fe00:30b Note the use of colons. To get around the presence of colons, copy the Solaris convention used for raw NFS server IPv6 addresses, which is to wrap the raw IPv6 address with square brackets. This is also suggested in RFC 4038. Introduce a new device name parser that can support traditional device names and square brackets. Place the parser in a separate source file so both the mount and umount paths can derive the server's hostname and export pathname the same way. Bonus points: add a check for NFS URLs and display an appropriate error message in that case. This is cleaner than failing with "unknown host: nfs". Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Change the fix_mounthost_option() function to support resolving IPv6Chuck Lever2008-07-151-12/+21
| | | | | | | addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Change the append_clientaddr_option() function to support sending eitherChuck Lever2008-07-151-14/+12
| | | | | | | | | | | IPv4 or IPv6 addresses to the kernel via the "clientaddr=" option. If the mount.nfs4 command can't determine an appropriate callback address, it used to fail the mount request. This new function simply sends an ANY address instead, so the mount request succeeds, but delegation is disabled. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Change the append_addr_option() function to support sending either IPv4Chuck Lever2008-07-151-15/+6
| | | | | | | or IPv6 addresses to the kernel via the "addr=" option. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* There are three helpers that convert sockaddr-style addresses to textChuck Lever2008-07-151-0/+31
| | | | | | | | | | | addresses, then construct mount options to pass these addresses to the kernel. The tail of each of these helpers does exactly the same thing, so introduce a helper that handles the common code. Magically, the new helper supports IPv6 as well as IPv4. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce IPv6-enabled version of get_client_address. The legacy mountChuck Lever2008-07-152-0/+120
| | | | | | | | | | | | | | command could use this eventually as well. If this new function fails to discover an appropriate callback address, it fills in an ANY address to indicate to the server that it should not call the client back (ie delegations are disabled in this case). The user can specify a callback address via the clientaddr= mount option in this case to enable delegation. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce two new functions to convert a sockaddr to a presentation formatChuck Lever2008-07-152-0/+96
| | | | | | | string and back. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add #include directives for additional header files needed to support IPv6Chuck Lever2008-07-152-1/+7
| | | | | | | | networking. This is a separate patch so subsequent patches can be reordered without collision. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Currently the "-s" option is ignored by the text-based mount interface. ToChuck Lever2008-07-151-0/+15
| | | | | | | | | | | | notify the kernel that sloppy mount option parsing is needed, add "sloppy" to the string of mount options passed to the kernel. The 2.6.23 - 2.6.26 kernels will fail the mount if "sloppy" is present, as they won't recognize it. To prevent them from ever seeing this option, have the mount command check the kernel version before appending the option. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: add the traditional pre-processor safety check in headers underChuck Lever2008-07-158-10/+34
| | | | | | | | | | utils/mount to prevent them from being included multiple times. For headers that already have this, use a more unique macro name to reduce the probability that some other header may use the same macro. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Moved the kernel version-ing code into a new version.hChuck Lever2008-07-154-21/+55
| | | | | | | header file which allows the code to be shared Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce a new DNS resolver function in utils/mount/network.c that usesChuck Lever2008-07-152-19/+61
| | | | | | | | | getaddrinfo(3), which supports AF_INET6, to resolve host names. Replace the guts of nfs_gethostbyname() with a call to the new function. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* The text-based mount command displays the rather inexplicable "mount:Chuck Lever2008-07-152-4/+10
| | | | | | | | | | | | | internal error" whenever it encounters a problem that is entirely unexpected by its designers. Let's beef that error message up to include instructions about reporting the problem, and fix the error code returned by the mount option rewriting logic so that also will no longer report "internal error". An error in there should generally only occur if there was an invalid mount option specified. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Ported the create_mtab() routine from util-linux-ng as wellChristiaan Welvaart2008-07-153-34/+86
| | | | | | | | some add_mtab() updates to better hand the instances where /etc/mtab does not exist or is not writable Signed-off-by: Christiaan Welvaart <cjw@daneel.dyndns.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* The rpc.gssd scans for any suitable kerberos ticket. In cross-realmLukas Hejtmanek2008-07-155-15/+165
| | | | | | | | | | environment this may not be the desired behaviour. Therefore a new option, -R preferred realm, is presented so that the rpc.gssd prefers tickets from this realm. By default, the default realm is preferred. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* The default expiration of kernel gss contexts is the expirationLukas Hejtmanek2008-07-154-4/+16
| | | | | | | | | | | | | | | | | of the Kerberos ticket used in its creation. (For contexts created using the Kerberos mechanism.) Thus kdestroy has no effect in nullifying the kernel context. This patch adds -t <timeout> option to rpc.gssd so that the client's administrator may specify a timeout for expiration of contexts in kernel. After this timeout, rpc.gssd is consulted to create a new context. By default, timeout is 0 (i.e., no timeout at all) which follows the previous behavior. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd_setup_krb5_user_gss_ccache must return an error if no usable cache isLukas Hejtmanek2008-07-153-8/+8
| | | | | | | | found. Trying to use invalid default cache and continue is not good idea at all. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* The nfsstat program reads /proc/net/rpc/* files to gets info aboutJeff Layton2008-06-231-4/+5
| | | | | | | | | | | | | | | | calls. This info is output as unsigned numbers (at least on any relatively recent kernel). When nfsstat prints these numbers, they are printed as signed integers. When the call counters reach 2^31, things start being printed as negative numbers. This patch changes nfsstat to read and print all counters as unsigned integers. Tested by hacking up a kernel to initialize call counters to 2^31+1. Thanks to Takafumi Miki for the initial version of this patch. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsstat -m lists all current nfs mounts, with the mount options.Neil Brown2008-06-061-1/+1
| | | | | | | | | | It does this by reading /proc/mounts and looking for mounts of type "nfs". It really should check for "nfs4" as well. For simplicity, just check the first 3 characters of the type. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix error reporting when probe_bothports() fails while rewriting mountChuck Lever2008-06-062-4/+8
| | | | | | | options. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: instead of passing so many arguments to all the helpers, haveChuck Lever2008-06-061-111/+132
| | | | | | | | nfsmount_string build a data structure that contains all the arguments, and pass a pointer to that instead. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Steinar Gunderson reports:Chuck Lever2008-06-061-13/+38
| | | | | | | | | | | | | | | | | "It seems retry= is now additive with the text-based mount interface. In particular, "mount -o retry=0" still gives a two-minute timeout." Correct the bug and make retry= option parsing more robust. If parsing the retry option fails, the option is ignored and a default timeout is used. Note that currently the kernel parser ignores the "retry=" option if the value is a number. If the value contains other characters, the kernel will choke. A subsequent patch to the kernel will allow any characters as the value of the retry option (excepting of course ","). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Make the text-based mount path check whether statd is running if the "lock"Neil Brown2008-06-061-4/+27
| | | | | | | | option is in effect. This echoes similar logic in the legacy mount path. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed smail typo in exportfs man pageOren Held2008-05-081-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* If mount.nfs is not installed setuid, an attempt to perform a "user"NeilBrown2008-05-081-0/+6
| | | | | | | | | | or "users" mount will fail with a fairly obscure error message, typically about getting "permission denied" from the server. This patch gives a more helpful message in that case. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Kerberos credentials may be stored in multiple places. Make itVince Busam2008-05-076-20/+43
| | | | | | | | | | possible to search several directories for valid credentials when making NFS requests. Original patch from Vince Busam <vbusam@google.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>. Signed-off-by: Steve Dickson <steved@redhat.com>
* Add a new function to retrieve the current verbosity levelKevin Coffman2008-05-072-0/+6
| | | | | | | | so that some messages that would otherwise always print may be silenced. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add the other two DES encryption types to the default list ofKevin Coffman2008-05-071-1/+3
| | | | | | | Kerberos encryption types that may be negotiated. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Check the info file nfs/rpc_pipefs/nfs/clnt?/info toOlga Kornievskaia2008-05-072-2/+13
| | | | | | | | | see if a port number was supplied. If so, use it rather than the default port number. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* The prev_bg_host stuff made sense when NFS didn't have its own mountJeff Layton2008-05-071-14/+0
| | | | | | | | | handler. Now though, each mount.nfs invocation is really a one-shot affair, and this check no longer works. It also leaked memory. Remove it. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* The bg option is essentially ignored with nfs4 currently. nfs4mount()Jeff Layton2008-05-071-2/+8
| | | | | | | | | will never exit with EX_BG, so the mount will never be backgrounded. Fix it so that when bg is specified that we error out with EX_BG as soon as possible after the first failed mount attempt. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Currently nfs4mount() sets the retry value to 10000 on both fg and bgJeff Layton2008-05-072-5/+17
| | | | | | | | | | | | mounts. It should be 2 for fg and 10000 for bg. nfsmount() sets it properly, but there is a potential corner case. If someone explicitly sets retry=10000 on a fg mount, then it will be reset to 2. Fix this by having retry default to -1 for both flavors, and then reset if needed after the mount options have been parsed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Change how mount.nfs handles EACCES errors. Currently,Jeff Layton2008-04-141-1/+0
| | | | | | | | | | | EACCES is a non-fatal error which means the mount will be retied. This caused mounts to hang for 2mins when the client does not have permission to access the export. In a strict interpretation, the error that should be returned is EPERM, but this is not always the case. So due to the fuzzy interpretation, of EPERM and EACCES, EACCESS is now a fatal error Signed-off-by: Steve Dickson <steved@redhat.com>
* Correct a spelling error in a mount.nfs error messageLi Yewang2008-04-091-1/+1
| | | | | Signed-off-by: Li Yewang <lyw@cn.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Make sure showmount fails when rpc.mountd is not registeredSteve Dickson2008-03-181-1/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Updated exportfs man to talk about /var/lib/nfs/etabSteve Dickson2008-03-181-10/+10
| | | | | | instead of /var/lib/nfs/xtab Signed-off-by: Steve Dickson <steved@redhat.com>
* There were 2 things wrong with auth flavour ordering:bc Wong2008-03-182-6/+16
| | | | | | | | | | | | | | | | | | | | | | - Mountd used to advertise AUTH_NULL as the first flavour on the list, which means that it prefers AUTH_NULL to anything else (as per RFC 2623 section 2.7). - Mount.nfs used to scan the returned list in reverse order, and stopping at the first AUTH_NULL or AUTH_SYS encountered. If a server advertises (AUTH_SYS, AUTH_NULL), it will by default choose AUTH_NULL and have degraded access. I've fixed mount.nfs to scan from the beginning. For mountd, it does not advertise AUTH_NULL anymore. This is necessary to avoid backward compatibility issue. If AUTH_NULL appears in the list, either the new or the old client will choose that over AUTH_SYS. Tested the server/client combination against the previous versions, as well as Solaris and FreeBSD. Signed-off-by: bc Wong <bcwong@cisco.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Turn down gssd's syslog verbosityTimo Aaltonen2008-03-132-2/+5
| | | | | Modified-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>