summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* The kernel hasn't supported the underlying parts needed for changing theSteve Dickson2008-01-161-3/+0
| | | | | | | NFS program number for a very long time. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Address an inconsistency: the mount.nfs command uses the glibc routinesSteve Dickson2008-01-161-5/+7
| | | | | | | | | | | | to manipulate /etc/mtab (setmntent) but, everything else in nfs-utils uses a local private version (nfs_setmntent). The local version does some extra mangling of the mtab entries. We should check what util-linux does these days to be sure, but for now, let's make the mount.nfs command use the nfs_ variants of setmntent(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* add_mtab() calls unlock_mtab() twice in one of its error exit paths.Steve Dickson2008-01-161-1/+0
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* When mount.nfs reports that statd isn't running, it suggests using the "-oSteve Dickson2008-01-161-1/+1
| | | | | | | nolocks" option, which doesn't exist. It should say "-o nolock". Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Automatically set 'nohide' on referral exports.Steve Dickson2008-01-092-1/+16
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Redress some nits in the description of the timeo optionSteve Dickson2008-01-091-9/+13
| | | | | | | in the nfs(5) man page. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed typo in rpc.mountd's man pageSteve Dickson2008-01-071-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Get rid of the "-i" option for mount.nfs[4] and always use the text-Steve Dickson2008-01-041-17/+4
| | | | | | | based mount(2) system call for kernel version 2.6.23 and later. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Incorporated Chuck Lever's and Don Domingo's changes to theSteve Dickson2008-01-041-485/+1208
| | | | | | | | nfs(5) manual page. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Don Domingo <ddomingo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* When mountd gets a request to export a mountpoint which is notSteve Dickson2007-11-031-1/+1
| | | | | | | | | | | | | explicitly exported, but is below an export point that is flagged as "crossmnt", it passes the wrong path name to the kernel for the "filehandle -> directory" mapping. This can badly confuse the NFS client, and is certainly wrong. So use the correct path names. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* When following a list of mount versions to probe -Steve Dickson2007-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | e.g. probe_mnt1_first or probe_mnt3_first - probe_both will first probe the appropriate NFS version and then, if that succeeds, probe the actual mount version. However instead of probing the target mount version, it probes the "most appropriate" mount version for the given NFS version. This results in it probing: NFSv2, MOUNTv1 twice rather than NFSv2, MOUNTv1 NFSv2, MOUNTv2 as would be more correct. This patch removes the "choose most correct" step and just use the current mouint version for the probe_vers array. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* This means that if mountd is run with "--no-nfs-version 3",Steve Dickson2007-11-031-4/+0
| | | | | | | | | | | | | | | | It will first probe for NFS version 3, which will succeed (assuming the kernel supported NFSv3), then it will check the matching mountd version (3) and probe_port on discovering that isn't supported will try other versions, find "1" is supported will succeed. This leaves up using mount version 1 for an NFSv3 mount, which doesn't work and leads to a SIGSEGV There is no case where trying other versions is needed the request one is not supported, so simply remove that code. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* The wording in the exportfs man page can be a bit confusing, implyingSteve Dickson2007-11-031-2/+19
| | | | | | | | | | that "exportfs -u :/foo" will unexport /foo from all hosts, which it won't. This patch cleans that wording up and adds a couple examples on how to unexport directories Signed-off-by: Steinar H. Gunderson <sesse@debian.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Added -S/--since to the nfsstat(1) manpageSteve Dickson2007-10-261-1/+21
| | | | | Author: David Richter <richterd@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Release 1.1.1Neil Brown2007-10-191-1/+1
|
* Remove unnecessary code from idmapd.Kevin Coffman2007-10-153-118/+0
| | | | | | | | | | This patch removes unnecessary code from idmapd. setproctitle is not used anywhere and it can be removed. In addition the kernel section of the nfs_idmap.h header is not used and is out of date and thus is removed. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Remove old logging implementation for idmapd and rework gssd and idmapd to ↵Kevin Coffman2007-10-153-142/+46
| | | | | | | | | | | | | use the new xlog logging infrastructure. This patch removes all of the old idmap_* logging functions and replaced them with the corresponding xlog functions. In addition that that it also reworks the gssd logging wrappers to use the new xlog_backend. Finally it makes necessary changes to the build files to get the project compiling again. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Cleanup xlog logging code to be safe and usable for allKevin Coffman2007-10-152-21/+48
| | | | | | | | | | | | | | | This patch reworks the xlog logging code to avoid rebuilding the message into a fixed size buffer. It also adds two new logging functions xlog_warn and xlog_err which are replacements for idmap_warn and idmap_err. There use to be two different variates of these functions with the only difference being that one flavor tacked on the error string to the end of the message. This responsibility has been pushed to the called of the function since it needlessly complicated the function and required us to rebuild the message strings. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Remove svcgssd's private version of cacheio.cKevin Coffman2007-10-152-346/+0
| | | | | | | | Now that svcgssd is using the qword_* functions in the support library, remove the private version. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Use nfslib versions of cacheio functionsKevin Coffman2007-10-152-3/+1
| | | | | | | | | | Now that the nfslib library has all the necessary functions and they all operate as needed, use them instead of the private versions in utils/gssd/cacheio.c. The obsolete private versions are removed in the next patch. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Copy new cacheio functions used by svcgssd to nfslibKevin Coffman2007-10-152-7/+45
| | | | | | | | | | Copy private qword_ functions from the svcgssd version into the general nfslib library. Add prototypes as needed. Also, update readline to use a bigger buffer allocation as is needed in the svcgssd version. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Use printerr to print svcgssd downcall debugging infoKevin Coffman2007-10-152-12/+7
| | | | | | | | | | | Rather than depending on modified qword_* functions to print svcgssd debugging information, use printerr in the downcall function. And while we're at it, label things so we know what we're looking at! Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Make print_hexl function write to stdout rather than using printerrKevin Coffman2007-10-151-15/+18
| | | | | | | | | | print_hexl() currently uses printerr, but is really only necessary for local debugging and should simply write to stdout. Also change it to print the description internally. Wrap it and its use in #ifdef DEBUG. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix new warning after strict prototype checking enabledKevin Coffman2007-10-151-1/+1
| | | | | | | | Fix function declaration to eliminate compiler warning about it not being a prototype after -Wstrict-prototypes was added. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Fix po_rightmost() enum return valuesChuck Lever2007-10-122-32/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Neil observed that po_rightmost() now returns enum values from both enum { PO_NOT_FOUND = 0, PO_FOUND = 1, } and enum { PO_KEY2_RIGHTMOST = 1, PO_KEY1_RIGHTMOST = -1, } It would be cleaner to use a single enum for po_rightmost()'s return value. We take the next logical step and create specific types for the return values in order to ensure we don't mix the enum values, and to document explicitly what return values callers can expect. This could have been a simpler patch, but I think the end result is a cleaner overall parser API. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mountd: address a minor compiler warningChuck Lever2007-10-121-1/+1
| | | | | | | | | | | auth.c: In function ‘auth_authenticate’: auth.c:190: warning: ‘error’ may be used uninitialized in this function "error" is used as an output parameter, but the compiler has no way of knowing that. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mountd: eliminate a spurious compiler warningChuck Lever2007-10-121-1/+1
| | | | | | | auth.c:61: warning: function declaration isn’t a prototype Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix version fallback for unmount.Neil Brown2007-10-122-28/+16
| | | | | | | | | | | | | | | | Previously, if the mtab record didn't mention a version, unmount would assume a v3 umount and send an UNMOUNT request accordingly. This is wrong. So remove the 'v3' assumption, and allow probe_port to continue when it gets a version number mis-match. Also there was some overloading of the meaning of pm_vers==0 relating to v4 mounts. As do_nfs_umount is never called for v4, rename it to do_nfs_umount23, and remove v4 handling from there and from nfs_call_umount. Signed-off-by: Neil Brown <neilb@suse.de>
* Don't fail an unmount just because we couldn't contact the NFS server.Neil Brown2007-10-111-2/+1
| | | | | | | If we fail to talk to the NFS server when unmounted a v2 or v3 mount, still do the unmount, but allow the error to propagate up. Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Plug "fg" and "bg" processing into nfsmount_string()Chuck Lever2007-10-111-13/+13
| | | | | | | | We have all the pre-requisites now, so add "fg" and "bg" mount processing to text-based NFS mounts. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Add functions to handle background mountingChuck Lever2007-10-111-0/+89
| | | | | | | | | | Add helper functions that handle background mounts; one each for foreground processing (to try the request, and determine when to fork); and one for background processing (retry the request multiple times as a forked background daemon). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: add function to do foreground retriesChuck Lever2007-10-111-0/+51
| | | | | | | | | | | | Make the differences between the foreground and background mount logic explicit by creating separate functions to handle each -- think of them as separate scripts for doing a foreground or a background mount. NFS foreground mounts are supposed to retry for a little while before giving up. Add a function to handle this. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: sort between permanent and temporary errorsChuck Lever2007-10-111-0/+21
| | | | | | | | | | | | | The text-based mount.nfs program must distinguish between different types of errors returned from the kernel. Permanent errors, like bad mount options, should cause an immediate failure. Temporary errors, such as a connection timeout, should result in a retry of some type. Add a function that sorts between the two types of errors. The list of permanent errors can be adjusted later if needed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Use helpers for invoking mount(2) system callChuck Lever2007-10-111-14/+2
| | | | | | | | Expose support for NFS version and transport protocol fallback for NFSv2/3 mounts. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Implement falling back to NFSv2 and UDPChuck Lever2007-10-111-2/+64
| | | | | | | | | | | | | | | | | If the initial user-specified options fail (with EOPNOTSUPP or EPROTONOSUPPORT) then the server has rejected the requested NFS version or transport protocol. In that case, probe the server, then construct a fresh set of mount options that ask for the specific mountd and NFS version and transport protocol that the server supports. Rewrite the mount options based on the results of the probe, then try the request again. An additional kernel patch is required to cause the kernel to return EOPNOTSUPP when an rpcbind fails during a NULL request. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Add rewrite_mount_options() functionChuck Lever2007-10-111-0/+130
| | | | | | | | Introduce a function for probing the server for what it supports, and then rewriting the mount options using the probe results. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: add a few useful parser return codesChuck Lever2007-10-112-2/+7
| | | | | | | | I forgot to add symbolic return codes for po_rightmost(). Add return codes for PO_KEY1_RIGHTMOST and PO_KEY2_RIGHTMOST. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Create helpers for invoking mount(2) system callChuck Lever2007-10-091-0/+74
| | | | | | | | | | Add simple helper functions that invoke the mount(2) system call for text-based mounts. These look the same right now, but the NFSv2/v3 helper will become more complex over the following patches as we implement version and transport protocol fallback. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Remove unused top level functionsChuck Lever2007-10-091-129/+0
| | | | | | | nfsmount_s() and nfs4mount_s() are no longer used, so eliminate them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: combine nfsmount_s() and nfs4mount_s() pathsChuck Lever2007-10-093-10/+65
| | | | | | | | | The top-level logic that handles text-based mount options is mostly the same for NFS and NFSv4 mounts. To improve maintainability, let's combine the nfsmount_s() and nfs4mount_s() functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: refactor mandatory mount option processingChuck Lever2007-10-091-0/+23
| | | | | | | | We're about to combine nfsmount_s() and nfs4mount_s(). Refactor the version-specific mount option processing into a separate function. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: rename fix_up_mounthost_opt()Chuck Lever2007-10-091-4/+4
| | | | | | | Spell out _option, just like other mount-option specific functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Fix mounthost= processingChuck Lever2007-09-291-0/+27
| | | | | | | | | | | | | | | | | | | | | The 'mounthost=' option names a host where the mountd service is running. The option is used to direct clients to use a different host for the mountd procotol than the host where the NFS service is running. The nfs(5) man page shows that the 'mounthost=' option takes a name, not an address. The kernel's text-based mount option parsing logic expects an IPv4 address. This is necessary because the kernel cannot itself resolve hostnames to addresses. Resolve the hostname and pass in a new mount option that contains the resolved address, 'mountaddr=', to the kernel. This requires a patch to the kernel to recognize the new 'mountaddr=' option, and to change the 'mounthost=' parsing logic to treat the value of this option as a simple string. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Clean up helper functions that are no longer usedChuck Lever2007-09-291-99/+0
| | | | | | | | Remove older string parsing functions in the text-based mount.nfs implementation that are now no longer used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: start using new mount option parsing facilityChuck Lever2007-09-291-17/+3
| | | | | | | | Use the new mount option parsing functions to handle existing mount option string parsing needs in the text-based mount implementation. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: add parser init and destroy callsChuck Lever2007-09-291-0/+26
| | | | | | | | Introduce parser init and destroy calls in the main text-based mount handling routines. Don't actually use the parsed option object yet. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: prepare for more complex error exit handlingChuck Lever2007-09-291-15/+21
| | | | | | | | | I'm about to add an object or two that needs to be freed before the main functions exit. Prepare the logic by adding an 'out' label and some goto's. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: Use new parser to handle 'addr=' and 'clientaddr='Chuck Lever2007-09-291-0/+55
| | | | | | | | | | | Introduce, but don't yet use, functions that will eventually replace append_addr_opt() and append_clientaddr_opt(). Note the behavioral change in append_addr_opt() -- it simply removes any previous 'addr=' rather than throwing an error. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* text-based mount.nfs: parse option strings into listsChuck Lever2007-09-293-2/+478
| | | | | | | | | | | | | | | | | | | | | Adapt a parsing trick used by Python. Parse mount option strings into an abstract data type so we don't have to copy and/or tokenize the whole option string multiple times while trying to manipulate the mount options. Then, just before calling the mount(2) system call, convert the object back into a C string. One major advantage of this approach is that we can copy the final version of the mount options into /etc/mtab when we're done, instead of copying in the original mount options that the user specified. Any fallback from NFS v3 to NFS v2 or TCP to UDP that was done by mount.nfs will be reflected in /etc/mtab. This patch adds methods for creating and manipulating mount option data objects. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: add new string tokenizer facilityChuck Lever2007-09-293-2/+188
| | | | | | | | | | | | | | | | To quote the strtok(3) man page: "Avoid using these functions." OK. We've created our own. The main reason for this is that strtok(3) doesn't handle quoted delimiters at all. We need to handle this: context="foo,bar" where 'context' is a single mount option that sets a token string that possibly uses the same delimiter that the mount command uses to separate options (that is, a comma). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>