summaryrefslogtreecommitdiffstats
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* gssd: Error out when rpc_pipefs directory is emptySteve Dickson2014-07-091-3/+8
| | | | | | | | | | | When there is no kernel modules loaded the rpc_pipefs directory is empty, which cause rpc.gssd to silently exit. This patch adds a check to see if the topdirs_list is empty. If so error out without dropping a core. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd.man: Added missing arguments in man pageJianhong Yin2014-06-171-6/+6
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: add support for case-insensitive file namesSteve Dickson2014-06-171-2/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Case insensitive filesystems support textually distinct names for the same directory. i.e. you can access it with a name other than the canonical name. For example if you mkdir /mnt/export then add /mnt/EXPORT to /etc/exports, and on a client mount server:/mnt/EXPORT /import then the mount will work, but if the kernel on the server needs to refresh the export information, it will ask about "/mnt/export", which is not listed in /etc/exports and so will fail. To fix this we need mountd to perform case-insensitive name comparisons, but only when the filesystem would, and in exactly the same way that the filesystem would. So, when comparing paths for equality first try some simple heuristics which will not be fooled by case and then ask the kernel if they are the same. By preference we use name_to_handle_at() as it reports the mntid which can distinguish between bind mounts. If that is not available, use lstat() and compare rdev and ino. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fix allocated buffer size for the scraped acceptor name in do_downcallVeli-Matti Lintu2014-06-011-1/+1
| | | | | | | | | | In commit 51fda07a "gssd: scrape the acceptor name out of the context" the allocated buffer size is not large enough to hold the actual data that is written to the buffer. This fixes the allocated buffer size. Reviewed-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Veli-Matti Lintu <veli-matti.lintu@opinsys.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: Adding callback on sm_notifyRong Zeng2014-06-012-9/+25
| | | | | | | | | | | | | | | | | This patch adds a callback for incoming sm_notify to better handle stale lock issue in client crash recovery in HA-NFS environment 1. "sm-notify" - callout name 2. monitored client name as in the SM_NOTIFY request 3. IP of the sender of the SM_NOITFY request. 4. state value in the SM_NOTIFY request This new interface can be used by different HA-NFS product in its specific configuration and environment to recover from the client crash and stale lock scenarios. Signed-off-by: Rong Zeng <rongzeng@us.ibm.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: print more useful error messageKinglong Mee2014-06-011-2/+6
| | | | | | | | | | | | | | | | When mounting spec of a regular file, mount.nfs print error message as, mount.nfs: mount point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory This patch lets mount.nfs print more useful message, mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: rpc.statd's systemd unit changed names.Steve Dickson2014-05-011-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdctltrack: ensure binary is installed in /sbinNeilBrown2014-04-301-0/+4
| | | | | | | | | The kernel "knows" this lives in /sbin, so just like mount.nfs and osd_login, it must unconditionally be installed there. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: Remove some warnings nfsd.cSteve Dickson2014-04-301-1/+1
| | | | | | | | | nfsd.c:347:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] nfsd.c:385:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: scrape the acceptor name out of the contextJeff Layton2014-04-301-10/+27
| | | | | | | | | | ...and pass it to the kernel in the downcall. Legacy kernels will just ignore the extra data, but with a proposed kernel patch the kernel will grab this info and use it to verify requests on the v4.0 callback channel. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: explicitly set lifetime_rec to 0 when gss_inquire_context failsJeff Layton2014-04-301-3/+4
| | | | | | | | | | Contrary to the comment here, the lifetime_rec is not necessarily set to zero on failure. That's only guaranteed to be the case if the context has expired. Cc: Andy Adamson <androsadamson@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: add new routine for generating a hostbased principal in a gss_buffer_tJeff Layton2014-04-302-0/+17
| | | | | | | We'll need a gss_buffer_t to pass to the downcall marshalling code. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: move hostbased name routines into separate fileJeff Layton2014-04-304-65/+160
| | | | | | | | In a later patch, we'll need gssd to call into this code as well as svcgssd. Move it into a common file that both can link in. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: make do_downcall a void returnJeff Layton2014-04-301-3/+3
| | | | | | | ...since its return code is ignored anyway. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: handle malloc failure appropriately in do_downcallJeff Layton2014-04-301-2/+5
| | | | | | | ...and get rid of some pointless NULL ptr checks. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Added more (commented out) options to nfsmount.confSteve Dickson2014-04-291-0/+9
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: add PATH for finding systemctlKinglong Mee2014-04-251-1/+1
| | | | | | | | | | | | The 1.3.0 release adds a call to systemctl fails for it's in /usr/bin. [root@localhost nfs-utils]# start-statd /usr/sbin/start-statd: line 9: systemctl: command not found Statd service already running! Reported-by: Allan Duncan <amd1234@fastmail.com.au> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsidmap: Keys need to be invalidated instead of revokedSteve Dickson2014-03-251-6/+6
| | | | | | | | With some recent kernel changes to the key ring for a key to be removed they need to be invalidated instead of revoked. Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: converted to use systemdNeilBrown2014-03-241-2/+5
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: chk_mountpoint should only check for execute perms for unpriveleged usersScott Mayhew2014-03-221-1/+1
| | | | | | | | Otherwise 'mount -o remount' fails on mounts that have root squashing enabled and world execute perms disabled. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Support raw IPv6 addresses with "client:/path"Chuck Lever2014-03-172-2/+78
| | | | | | | | | | | Wrap IPv6 presentation addresses in square brackets. This echoes the same syntax used when specifying IPv6 server addresses with the mount.nfs command. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=817557 Tested-by: Steve Dickson <steved@redaht.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Refactor exportfs() and unexportfs()Chuck Lever2014-03-171-23/+51
| | | | | | | | | | Separate parsing the "client:/path" argument from the actual processing. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=817557 Tested-by: Steve Dickson <steved@redaht.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): intr/nointr are ignored nowJim Rees2014-03-131-47/+4
| | | | | Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* [PATCH - v3] mount.nfs: Fix fallback from tcp to udpNeilBrown2014-03-133-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Protocol negotiation in mount.nfs does not correctly negotiate with a server which only supports NFSv3 and UDP. When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED it does not fall back to NFSv3, as this is not recognised as a "does not support NFSv4" error. However ECONNREFUSED is a clear indication that the server doesn't support TCP, and ipso facto does not support NFSv4. So ECONNREFUSED should trigger a fallback from v4 to v2/3. However ECONNREFUSED may simply indicate that NFSv4 isn't supported *yet*. i.e. the server is still booting and isn't responding to NFS requests yet. So if we subsequently find that NFSv3 is supported, we need to check with the server to confirm that NFSv4 really isn't supported. If server reports that v4 is not supported after reporting that v3 is, we can safely use v4. If it reports that v4 is supported, we need to retry v4. Signed-off-by: Steve Dickson <steved@redhat.com> Reported-by: Carsten Ziepke <kieltux@gmail.com>
* mountd: use SONAME fir libnfsjunct when loading with dlopenNeilBrown2014-03-111-2/+7
| | | | | | | | | | | | | | | | | | | | | | | The standard for loading shared libraries is to identify them by their "soname" (Which "objdump -x $BINARY | grep SONAME" will report). However mountd currently loads using the "linker name" which should only be used when building new code. Future releases of fedfs-utils will define the soname in the include file, so if that is defined, use it. If not, use the soname of the first version: "libnfsjunct.so.0". This is a slight behavioural change. However all distros known to package fedfs-utils will install "libnfsjunct.so.0" whenever they install the old name of "libnfsjunct.so", and "make install" will install both. So it should not be a noticeable change. Also only test the JP_API_VERSION if it is defined. As the version is embedded in the soname, a secondary test is not needed. Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: permit to use multiple time the -H optionMichael Scherer2014-03-112-17/+35
| | | | | | | | This permit to have 1 nfsd listening on more than 1 interface for multihomed systems, without having to listen on all interfaces and filtering later. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsidmap: fix error reporting for nfs4_* family of functionsMateusz Guzik2014-03-111-5/+6
| | | | | | | | | | Errors were logged with xlog_err function relying on errno, but these functions don't set it. Fix the problem by introducing xlog_errno which set errno Signed-off-by: Mateusz Guzik <mguzik@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: add options to set port number of lockdNeilBrown2014-03-112-5/+76
| | | | | | | | | | | Even though lockd is a totally separate process to statd, they depended on each other: statd much be running for lockd to be useful. So an easy way to set the port numbers used by lockd is to get statd to set them. This patch add --nlm-port and --nlm-tcp-port to that end. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: set nlm grace time to make NFSv4 grace timeNeilBrown2014-03-112-1/+10
| | | | | | | | These two values are conceptually very similar, so it probably makes sense to set them to the same value at the same time. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: allow nfsv4leasetime and nfsv4gracetime to be setNeilBrown2014-03-114-6/+60
| | | | | | | New arguments --gracetime (-G) and --leasetime (-L) Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: add -r and --rdma options to request rdma serviceNeilBrown2014-03-114-4/+63
| | | | | | | As nfsd establishes UDP and TCP ports, it should establish RDMA too. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Drop full domain when constructing the Ad hostname.Simo Sorce2014-03-101-1/+3
| | | | | | | | | | | When trying to use the special MS Windows hostanme we need to stop at the first '.' if we got a FQDN from gethostname() Tee HOST$@REALM form in fact uses the AD samAccountName attribute to represent 'HOST', and that attribute is always the host's shortname. Characters like '.' are actually illegal for a shortname in AD. Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: support NFS4_MAXMINOR up to the number an unsigned int can keepSteve Dickson2014-02-133-12/+17
| | | | | | | | | | | | | | | | | | | This implementation allows specifying NFS4 minor version numbers up to the number of bits available in int data type (typically 32 on Linux) This is based on an idea mentioned by J. Bruce Fields <bfields@fieldses.org> mentioned on the linux-nfs mailing list. I changed the data type back from an array to two bit fields, one for storing whether the minor version was specified on the command line and the second one for storing whether it was set or unset. This change was done to prevent blowing up the allocated stack space in an unnecessary fashion. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: set $HOME to prevent recursion when home dirs are on kerberized NFS mountJeff Layton2014-01-221-0/+13
| | | | | | | | | | | | | | | | | | Some krb5 routines will attempt to access files in the user's home directory. This is problematic for gssd when the user's homedir is on a kerberized NFS mount as it will end up deadlocked. Fix this by setting $HOME unconditionally to "/". Fixes this Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1052902 Reported-by: Enrico Scholz <rh-bugzilla@ensc.de> Reported-by: nmorey <nmorey@kalray.eu> Tested-by: Michael Young <m.a.young@durham.ac.uk> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Removed supported flag from usage stringSteve Dickson2014-01-201-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.idmapd: Remove no longer supported flags from man page.Steve Dickson2014-01-201-20/+2
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.statd: Allow usage messages to be displayed when statd is running.Steve Dickson2014-01-201-6/+6
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): Clarify DATA AND METADATA COHERENCE sectionChuck Lever2014-01-201-10/+27
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Remove unused argumentsSimo Sorce2014-01-203-7/+7
| | | | | | | | | The name variable is always set to NULL now in all callers, so just sto passing it around needlessly. The uid_t variable is not used at all, so chuck it out too. Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Improve first attempt at acquiring GSS credentialsSimo Sorce2014-01-201-22/+2
| | | | | | | | | | | | | | | Since now rpc.gssd is switching uid before attempting to acquire credentials, we do not need to pass in the special uid-as-a-string name to gssapi, because the process is already running under the user's credentials. By removing this code we can fix a class of false negatives where the user name does not match the actual ccache credentials and the ccache type used is not one of the only 2 supported explicitly by rpc.gssd by the fallback trolling done later. Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Don't buffer overflow on exports that are too big.Steve Dickson2014-01-201-0/+2
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: optimize libblkid usageKarel Zak2014-01-071-3/+35
| | | | | | | | | | | | | * use get_uuid_blkdev() only first time for the path (it means that uuid_by_path() is called with type==0) * don't use libblkid for btrfs, network or pseudo filesystems Note that the patch defines the fs type ID rather than include <linux/magic.h> as this file seems incomplete and libc specific). Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs.c: Escape path for '-s' optionTony Asleson2014-01-071-1/+12
| | | | | | | | When outputing the paths and the user has specified the option -s, escape the path. Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs.c: Remove trailing whitespaceTony Asleson2014-01-071-15/+15
| | | | | Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs.c: escape path for function test_exportTony Asleson2014-01-071-3/+7
| | | | | | | | | | Verbatim patch proposal from J. Bruce Fields except calling snprintf instead of sprintf. Tested and appears to work with path names that have a space. Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: fix minorversion-choosing interfaceJ. Bruce Fields2014-01-073-7/+7
| | | | | | | | | | | | | | | | | | | | From: "J. Bruce Fields" <bfields@redhat.com> By unconditionally adding ?4.2 to the version string written to the kernel we make nfs-utils incompatible with pre-4.2-supporting kernels. Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option", which also change nfsd to unconditionally pass ?4.2. Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off. Tested-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Reported-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Don't silently ignore invalid protocol versions.Steve Dickson2014-01-071-0/+4
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: modify can_test() to use LONG_MAX when appropriateHarshula Jayasuriya2013-11-201-4/+24
| | | | | | | | | | | | | | This patch is the nfs-utils patch corresponding to the kernel patch commit 2f74f972 "sunrpc: prepare NFS for 2038". The kernel sunrpc code needs to handle seconds since epoch greater than 2147483647. This means functions that parse time as an int need to handle it as time_t." When appropriate exportfs should use LONG_MAX in can_test() instead of INT_MAX. Signed-off-by: Harshula Jayasuriya <harshula@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): Treatment of *atime mount optionsChuck Lever2013-11-201-0/+59
| | | | | | | | | | | | | I was reminded recently that NFS treats file atime time stamps differently than other filesystems. It also ignores the generic *atime mount options because it cannot support the atime semantics of local filesystems. We should document that somewhere. nfs(5) seems like a logical place for it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: don't let parent exit until child has a chance to scan directory onceJeff Layton2013-11-203-2/+9
| | | | | | | | | | | | | With some proposed kernel changes, it won't even attempt to upcall sometimes if it doesn't appear that gssd is running. This means that we have a theoretical race between gssd starting up at boot time and the init process attempting to mount kerberized filesystems. Fix this by switching gssd to use mydaemon() and having the child only release the parent after it has processed the directory once. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>