commit 91873f84521a17648927f0db3470583c29adbd0f Author: Steve Dickson Date: Mon Jun 10 10:34:37 2019 -0400 tests: make check fixes Turnoff the a couple -W flags since the rpc code is generated badly Add a libmisc.a link Signed-off-by: Steve Dickson commit 21a2202be3876f0f379a266e4a6c4a1ed0dd54fb Author: Steve Dickson Date: Tue Jun 4 15:37:13 2019 -0400 Make chroot() failures more verbose When chroot() in xthread_workqueue_do_chroot fails show both the error and the path in the error message. Signed-off-by: Steve Dickson commit ebb9e146f8a25bb1beabdae3b70b98bf545746ec Author: Trond Myklebust Date: Tue Jun 4 15:34:55 2019 -0400 mountd: Canonicalise the rootdir in exportent_mkrealpath() Ensure that we canonicalise the export path when generating the real path. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit bdd07a6c852514f4d0a39d5bb312b8f3d0df36f6 Author: Trond Myklebust Date: Tue Jun 4 15:31:37 2019 -0400 mountd: Ensure nfsd_path_strip_root() uses the canonicalised path When attempting to strip the root path, we should first canonicalise the root pathname. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 4ef89ebb514183aed6292f83227ddf57078d6d3b Author: Trond Myklebust Date: Tue Jun 4 09:59:37 2019 -0400 mountd: Fix up incorrect comparison in next_mnt() We want to ensure that we compare the full name of the last component. Reported-by: "J. Bruce Fields" Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 546afbbd9f3dfd597b25f95d6354ecca60413dc0 Author: Trond Myklebust Date: Wed May 29 13:50:34 2019 -0400 Fix up symlinked mount path resolution when "[exports] rootdir" is set Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit fcc28687c196628cee253e2b62d2030c385ea634 Author: Trond Myklebust Date: Wed May 29 13:48:20 2019 -0400 Add a helper for resolving symlinked nfsd paths via realpath() Add a helper to resolve symlinked nfsd paths when the user has set the "[exports] rootdir" nfs.conf option. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 9d9bc6f4498903be2ac3b78f5576416e0e1c0507 Author: Trond Myklebust Date: Wed May 29 13:46:00 2019 -0400 Add support for the "[exports] rootdir" nfs.conf option to exportfs Ensure that exportfs also resolves paths relative to the nfsd root directory Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 9235db96285ec8d09e8ca5f6836b0c25b0384373 Author: Trond Myklebust Date: Wed May 29 13:22:59 2019 -0400 Add support for the "[exports] rootdir" nfs.conf option to rpc.mountd Ensure that I/O to those pseudo files that resolve filehandles and exports go through the chrooted threads, so that we can use paths that are relative to the nfsd root directory. Ensure that any stat() or lstat() calls go through their nfsd_path_* equivalent so that they too can be resolved correctly. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 41bd29fc5250f43f989b22eb5f2bf86b3db6c9b0 Author: Trond Myklebust Date: Wed May 29 13:19:03 2019 -0400 Add a helper to return the real path given an export entry Add a helper that can prepend the nfsd root directory path in order to allow mountd to perform its comparisons with mtab etc. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit dcd2c5fb686c22838fa8b07da66a7df7729388b4 Author: Trond Myklebust Date: Wed May 29 09:57:25 2019 -0400 Add helpers to read/write to a file through the chrooted thread Add helper functions to do synchronous I/O to a nfsd filesystem pseudofile from inside the chrooted environment. This ensures that calls to kern_path() in knfsd resolves to paths that are relative to the nfsd root directory. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit b513bdc31c526abcd2922ebad90209b7f9cfd310 Author: Trond Myklebust Date: Wed May 29 09:55:44 2019 -0400 Use xstat() with no synchronisation if available We normally expect the exported system to be stable, so don't revalidate attributes. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit d5d967e805d167e1c290f1ea50542151fbbaf84a Author: Trond Myklebust Date: Wed May 29 09:49:39 2019 -0400 Add utilities for resolving nfsd paths and stat()ing them Add helper functions that can resolve nfsd paths by prepending the necessary prefix if the admin has specified a root path in the nfs.conf file. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 26baf05966fafc00dd18b8041a92a856706f9b0e Author: Trond Myklebust Date: Wed May 29 09:45:05 2019 -0400 Allow callers to check mountpoint status using a custom lstat function Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 09b0a365d7ce094817159066b2fd1925e99d3ab7 Author: Trond Myklebust Date: Wed May 29 09:43:32 2019 -0400 Add a simple workqueue mechanism Add a simple workqueue mechanism to allow us to run threads that are subject to chroot(), and have them operate on the knfsd kernel daemon. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 5fc3bac9e0c30e966cf7d8869b3f1b7ae9b91a08 Author: Trond Myklebust Date: Tue May 28 10:40:25 2019 -0400 mountd: Ensure we don't share cache file descriptors among processes. Sharing cache descriptors without using locking can be very bad. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit 73491ef272f9131888ef9f45207abbc2055d6aae Author: Dave Wysochanski Date: Mon Jun 3 10:31:09 2019 -0400 mountstats: add per-op error counts for mountstats command Display the count of ops completing with error status (status < 0) on kernels that support it. Signed-off-by: Dave Wysochanski Signed-off-by: Steve Dickson commit eb86265555e469c3dbeddba0968fd1cff36fc8df Author: Jeff Layton Date: Mon Jun 3 10:26:26 2019 -0400 manpage: explain why showmount doesn't really work against a v4-only server From: Jeff Layton I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server. Cc: Jan Fajerski Signed-off-by: Jeff Layton Signed-off-by: Steve Dickson commit 6ec295428a5f50c184891a57566b8667844f8af6 Author: Chuck Lever Date: Tue May 28 10:02:49 2019 -0400 rpc.mountd: Fix mountd segfault After commit 8f459a072f93 ("Remove abuse of ai_canonname") the ai_canonname field in addrinfo structs returned from host_reliable_addrinfo() is always NULL. This results in mountd segfaults when there are netgroups or hostname wildcards in /etc/exports. Add an extra DNS query in check_wildcard() and check_netgroup() to obtain the client's canonical hostname instead of dereferencing the NULL pointer. Reported-by: Mark Wagner Fixes: 8f459a072f93 ("Remove abuse of ai_canonname") Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson commit d77ee0f18c0e0658f892932600c38c346c4d5337 Author: Srikrishan Malik Date: Thu May 23 13:40:21 2019 -0400 nfsidmap: Add LDAP_tls_reqcert tunable to idmapd.conf. This tunable will control the checks on server certs for a TLS session similar to ldap.conf(5). LDAP_ca_cert can be skipped if LDAP_tls_reqcert is set to "never" Signed-off-by: Srikrishan Malik Signed-off-by: Steve Dickson commit 50ef80739d9e1e0df6616289ef2ff626a94666ee Author: Steve Dickson Date: Thu May 23 09:24:49 2019 -0400 rpc.mountd: Fix e_hostname and e_uuid leaks strdup of exportent uuid and hostname in getexportent() ends up leaking memory. Free the memory before getexportent() is called again from xtab_read() Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1713360 Signed-off-by: Nikhil Kshirsagar Signed-off-by: Steve Dickson commit a8133e1fd174267536cd459e19cfe0a1cbbe037c Author: Steve Dickson Date: Wed May 22 13:55:37 2019 -0400 sqlite.c: Use PRIx64 macro to print 64-bit integers On 32 bit machines, using "%016lx" format throws out an format error due to the -Werror=format=2 compiler option. On 64 bit machines using that format is correct. So use the PRIx64 macro to have the correct format defined on the different machines. Signed-off-by: Steve Dickson commit a709f25c1da4a2fb44a1f3fd060298fbbd88aa3c Author: Steve Dickson Date: Tue May 14 15:52:50 2019 -0400 mount: Report correct error in the fall_back cases. In mount auto negotiation, a v3 mount is tried when the v4 fails with error that could mean v4 is not supported. When the v3 mount fails, the original v4 failure should be used to set the errno, not the v3 failure. Fixes:https://bugzilla.redhat.com/show_bug.cgi?id=1709961 Signed-off-by: Steve Dickson