summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Avoid clobbering root's ccache if possiblefixrootccacheSimo Sorce2017-11-165-4/+25
| | | | | | | | If the gssapi library is modern enough, store the ccache in a process scoped keyring by default. This will avoid clobbering root's default ccache, and keep the creds from littering the filesystem. Signed-off-by: Simo Sorce <simo@redhat.com>
* nfs-utils: Restore ABI compat with pre-merge libnfsidmapJustin Mitchell2017-11-0715-36/+55
| | | | | | | | | Prior to merge libnfsidmap leaked many private symbols that were not defined in its API, creating an accidental ABI. This patch renames and unhides symbols in order to match that ABI until a cleaned up API can be established and released. Signed-off-by: Steve Dickson <steved@redhat.com>
* gitignore: ignore files generated by libnfsidmap compilationSteve Dickson2017-11-022-11/+1
| | | | | | | libnfsidmap.pc is generated during the compiling of libnfsidmap which needed to be ignored. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Remove dependency on libnfsidmap-devel packageJustin Mitchell2017-11-021-0/+2
| | | | | | | | | With commit a867b45 (Release: 2.2.1) the libnfsidmap-devel package is now build from with the nfs-utils source tree. So the programs dependent on libnfsidmap-devel need to look inward verses outward for the nfsidmap.h header file. Signed-off-by: Steve Dickson <steved@redhat.com>
* Release: 2.2.1Steve Dickson2017-10-301-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: display NFS RPC queue time for mountstats and nfs-iostatRyan Doyle2017-10-303-5/+22
| | | | | | | | | Display the NFS queue statistics for mountstats and nfsiostat exported in /proc/self/mountstats. The RTT and total execution time is currently displayed but it's also useful displaying how long the task was queued for too Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: cleanup warnings from merged libnfsidmap codeJustin Mitchell2017-10-265-21/+33
| | | | | | | | | Clean up a bunch of warnings about unused parameters, signedness differences, etc that we inherited from the merged libnfsidmap code. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: integrate libnfsidmap code with rest of nfs-utilsJustin Mitchell2017-10-2612-24/+80
| | | | | | | | | | Modify libnfsidmap to use the now shared conffile code, adjust the build structure to generate everything correctly, and modify the other utils to use the merged version of libnfsidmap instead of testing for an external dependancy. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Import libnfsidmap codebaseJustin Mitchell2017-10-2616-0/+4827
| | | | | | | | | | Merge the libnfsidmap code tree into nfs-utils. These are the original unmodified files, cherry picked only the necessary files that dont duplicate code, so will not build correctly at this stage. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: split conffile to a separate convenience libJustin Mitchell2017-10-2616-20/+29
| | | | | | | | | To allow better reuse of the code we split conffile and xlog into their own separate convenience library, then merge it back so as to not create extra dependancies for everything Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* conffile: Add get_str with default valueJustin Mitchell2017-10-262-0/+13
| | | | | | | | | The similar config code in libnfsidmap had one additional feature of a get_str function with a default value option, include an equivalent function here to maintain compatibility. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* conffile: Merge conf_get_str and conf_get_sectionJustin Mitchell2017-10-261-22/+14
| | | | | | | | | | conf_get_section() started as conf_get_str() with one extra search parameter, subsequent patches have not maintained feature parity, combine the code to make a single more generic function and just call that differently where required. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* conffile: const-ify the config handling functionsJustin Mitchell2017-10-262-30/+30
| | | | | | | | Tighten up the conffile interface by switching to const arguments where appropriate. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify needs to call res_init() before each tryOrion Poplawski2017-10-251-0/+4
| | | | | | Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625531 Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcltrack: return an non-zero value for invalid optionsSteve Dickson2017-10-121-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* exports(5): minor exports man page typoJ. Bruce Fields2017-10-121-1/+1
| | | | | | From: "J. Bruce Fields" <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): update some version informationJ. Bruce Fields2017-10-121-15/+20
| | | | | | | | | | | | | | | | | | | | From: "J. Bruce Fields" <bfields@redhat.com> We've seen some confusion from people not understanding why newer clients may not support NFSv2. It might help a little to note in the man page that version support depends on how the kernel was built. While we're there: - update some references to NFS protocol versions. - update 4.0 RFC, and add references to 4.1 and 4.2 RFCs. - rename "BUGS" to "NOTES"; the section mostly isn't about bugs. (Might be time to remove some of the linux-2.4 notes too.) - remove some outdated references to optional NFSv4+ features. (Or should we try to keep this information up to date?) Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: Add RemainAfterExit to two servicesNeilBrown2017-10-122-0/+2
| | | | | | | | | | | | | | | | Both auth-rpcgss-module and rpc-statd-notify only ever need to be run once - the effect they have is permanent. We can give this information to systemd by setting RemainAfterExit=yes This avoids the minor cost of running them a second time if something "Wants" either service after it was first run, (e.g. both client and server startup can Want these), and avoids systemd complaining that it restarts to fast if multiple Wants happen at nearly the same time. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: merge in vers= and nfsvers= optionsJustin Mitchell2017-10-051-3/+5
| | | | | | | | | | When using mount.nfs if an nfsvers= option is set in a config file, and a vers= option is given on the commandline, then they are not always correctly combined and this can result in both being present in the resulting mount call. Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.nfsd: Do not fail when all address families are not support.Steve Dickson2017-10-051-2/+4
| | | | | | | | Commit 2f8a6020 introduce a regression causing rpc.nfsd to fail when IPv6 is not supported. rpc.nfsd should not fail when there is at least one bounded socket. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: add missing include of stdint.hMatthew Weber2017-10-051-0/+1
| | | | | | | | | | | | | | Glibc bump to 2.26 exposed this missing header when building with the following combination using an i386 internal toolchain. gcc5.4.0 bin2.28.1 linux4.1.43 Upstream: https://bugzilla.linux-nfs.org/show_bug.cgi?id=312 Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: avoid parsing "no device mounted ..." lineManjunath Patil2017-10-051-0/+2
| | | | | | | | | | Present nfsiostat includes the "no device mounted ..." line from /proc/self/mountstats as addition description of the preceding mount point. If the preceding mount point is NFS mountpoint, nfsiostat fails to parse this line eventually. This patch avoids parsing this line. Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: handle EACCES during version negotiationFrank Sorenson2017-09-141-0/+3
| | | | | | | | | | | | | mount() can return EACCES for servers which permit 4.0 but are configured not to allow 4.1 This is currently only handled by the default case, so these mounts fail without retrying a lower minor. Add handling for EACCES to be retried with a lower minor version. Signed-off-by: Frank Sorenson <sorenson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsman: document minorversionJianhong Yin2017-09-141-0/+17
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* idmapd: daemonize earlierScott Mayhew2017-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | daemon_init() calls closeall() to close any "unneeded" file descriptors. This causes the following issue with idmapd on systems that are configured to have SSSD handle local users and groups: 1. During startup, rpc.idmapd calls getpwnam("nobody") and getgrnam("nobody") 2. sss_nss_mc_get{pw,gr}nam from libnss_sss open the cache files for users and groups and store the fd's in a struct sss_cli_mc_ctx. The passwd cache is fd 3 and the group cache is fd 4. 3. idmapd calls daemon_init() which sets fd's 0, 1, and 2 to /dev/null and fd 3 to the write end of the pipe that the child uses to report it's startup status. It then closes all fd's >= 4. 4. idmapd then calls event_init() which leads to epoll_create1() which returns 4 as the epoll fd. 6. An NFSv4 mount request comes in from a client, triggering an nfsdcb callback. 7. idmapd calls getgrgid_r() which leads to a call to sss_nss_check_header() which determines that the cache needs to be reinitialized. sss_nss_mc_destroy_ctx() is called, which closes the ctx->fd which now corresponds to the epoll file rather than the group cache file. 8. event_dispatch() calls epoll_wait() with epfd=4, and -EBADF is returned. idmapd logs the following error and exits with a nonzero status: rpc.idmapd[650]: main: event_dispatch returns errno 9 (Bad file descriptor) Moving the deamon_init() call so that it happens before get{pw,gr}nam() fixes this. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* idmapd: fix object order in idmapd_LDADDScott Mayhew2017-08-231-1/+1
| | | | | | | | | | | | | | | | | nfs-utils and libnfsidmap have similar configuration parsing routines. They were the same up until nfs-utils commit 7b33590f (config: Remove the conf_path global), where conf_init() was changed to take a path as an argument. With the current idmap_LDADD ordering in Makefile.am, the conf_init() from libnfsidmap is called, resulting in the following error along with the failure to parse idmapd.conf: rpc.idmapd[391]: rpc.idmapd: conf_reinit: open ("(null)", O_RDONLY) failed Placing libnfs.a first in idmap_LDADD ensures that idmapd uses the config parsing routines from nfs-utils instead of libnfsidmap. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Remove a shebangSteve Dickson2017-07-271-1/+1
| | | | | | | There might be an issue that the script is executed with unwanted version of <lang>. Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: add a blurb about masking rpc-gssd to the man pageScott Mayhew2017-07-261-4/+14
| | | | | | | | | This is helpful for users that have a krb5.keytab but do not want to use secure NFS. Also fixed a typo that appears earlier on the page. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: Fix problems with parsing minorversion=NeilBrown2017-07-261-9/+13
| | | | | | | | | | | | | | | 1/ minorversion=0 is not recognized, as errors from strtol() are not correctly detected. 2/ when there is an error in the minorversion= value, no message is presented. 3/ Current code recognizes "minorversion" and sets V_SPECIFIC, but then because *cptr == '\0', the v_mode is reset to V_GENERAL. This results in minorversion negotiation, which is not wanted. This patch addresses all of these. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: move handling of "-t nfs4" into nfs_nfs_version()NeilBrown2017-07-266-19/+14
| | | | | | | | | | | | Current "-t nfs4" causes other mount options to be ignored and an NFSv4 version to be negotiated. This is even true when "-o vers=4.1" is given. To address this, we need to move the handled of "-t nfs4" into nfs_nfs_version, which means passing in the filesystem type. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: use version string that is supported by old kernelsNeilBrown2017-07-261-2/+18
| | | | | | | | | | | | | | All kernels which support NFSv4.2 understand "vers=4.2". Some kernels which support NFSv4.1 only understand "vers=4,minorversion=1". All later kernels also support this. Some kernels which support NFSv4.0 only understand "vers=4". All later kernels also support this. So use the string that is most appropriate for each version. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: support compiling with old glibcNeilBrown2017-07-261-1/+7
| | | | | | | | | | With glibc older than 2.24, it is always possible to include both linux/in6.h and netinet/in.h. So if the glibc is older, just hard-code the two values we need from linux/in6.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcltrack.c: remove a warningSteve Dickson2017-07-261-0/+1
| | | | | | | nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs4mount: removed a warningSteve Dickson2017-07-261-0/+1
| | | | | | nfs4mount.c:445:8: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsmount: remove a warningSteve Dickson2017-07-261-0/+1
| | | | | | nfsmount.c:684:8: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* network.c: removed some warningsSteve Dickson2017-07-261-0/+5
| | | | | | | | | | network.c:1234:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1382:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1477:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1508:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1574:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* device-discovery.c: removed a warningSteve Dickson2017-07-261-0/+1
| | | | | | | | | | | | | device-discovery.c:171:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. } else if (dm_is_dm_major(major(dev))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson <steved@redhat.com>
* bldev_read_serial: removed a couple warningsSteve Dickson2017-07-261-0/+2
| | | | | | | device-inq.c:216:7: warning: this statement may fall through [-Wimplicit-fallthrough=] device-inq.c:223:7: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd.c: removed a few warningsSteve Dickson2017-07-261-0/+3
| | | | | | | nfsd.c:187:8: warning: this statement may fall through [-Wimplicit-fallthrough=] nfsd.c:213:8: warning: this statement may fall through [-Wimplicit-fallthrough=]nfsd.c:263:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* cache.c: removed a couple warningSteve Dickson2017-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | cache.c:623:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. if (parsed->major != major(stb.st_dev) || ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cache.c:624:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. parsed->minor != minor(stb.st_dev)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson <steved@redhat.com>
* atomicio: removed a warningSteve Dickson2017-07-261-0/+1
| | | | | | atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* present_address: Fixed error pathSteve Dickson2017-07-261-0/+1
| | | | | | | When inet_ntop fails do not fall into the AF_INET6 case, instead break out and take the error path out. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcdebug.c: remove a warningSteve Dickson2017-07-261-1/+2
| | | | | | rpcdebug.c:77:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.c: added include file so UINT16_MAX is defined.Steve Dickson2017-06-221-0/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Use default minor version when -o v4 is specifiedSteve Dickson2017-06-211-10/+14
| | | | | | | When v4 is specified on the command line the default minor version needs to be used. Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Use default minor version when -t nfs4 is specifiedSteve Dickson2017-06-211-3/+12
| | | | | | | When the nfs4 filesystem specified, the default major and minor versions should be used. Signed-off-by: Steve Dickson <steved@redhat.com>
* Reimplement include functionality in nfs.confJustin Mitchell2017-06-211-22/+56
| | | | | | | | | | | | Re-implement include file functionality as documented. Existing implementation had various issues, one of which was it allowed a subordinate file to inadvertently change which section the subsequent tags back in the master config file got assigned to. Acked-by: NeilBrown <neilb@suse.com> Signed-off-by: Justin Mitchell <jumitche@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* umount.nfs: assume path name is canonical.NeilBrown2017-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | /usr/bin/umount will always pass a canonical name to umount.nfs, so it is safe to disable canonicalization. When umounting an NFS filesystem, it is generally safest to not "stat" the mountpoint at all as that can block indefinitely. umount() will not block, but lstat() etc can. By disabling canonicalization in libmount, we discourage it from ever calling 'stat' family operations, and thus reduce the chance of a hang. Note that to be fully effective, this requires changes to util-linux which have not yet been accepted. When both that change and this are in effect, automounters can use "umount -c $PATH" to safely unmount a filesystem without blocking. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs.conf: Removed buffer overrunsJustin Mitchell2017-06-061-84/+117
| | | | | | | | | Remove the line length parameter and associated code which led to buffer overruns in the line parsing code. Also drops the undocumented 'include' directive. Signed-off-by: Justin Mitchell <jumitche@rehat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs.conf: Add function to cleanup and free the loaded configJustin Mitchell2017-06-062-7/+45
| | | | | Signed-off-by: Justin Mitchell <jumitche@rehat.com> Signed-off-by: Steve Dickson <steved@redhat.com>