summaryrefslogtreecommitdiffstats
path: root/support
Commit message (Collapse)AuthorAgeFilesLines
* mountd: Fix memory leak in getexportentScott Mayhew2015-02-261-1/+1
| | | | | | | | | | | Valgrind shows that the memory allocated for ee.e_hostname in getexportent() is being leaked. While there _is_ a call to xfree(), by the time it gets called the leak's already happened. Moving the xfree() call so that it occurs before the assignment that overwrites ee fixes this. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* cleanup daemonization codeDavid Hardeman2015-01-232-47/+50
| | | | | | | | | | | | | | | The daemonization init/ready functions have parameters that are never used, require the caller to keep track of some pipefds that it has no interest in and which might not be used in some scenarios. Cleanup both functions a bit. The idea here is also that these two functions might be good points to insert more systemd init code later (sd_notify()). Also, statd had a private copy of the daemonization code for unknown reasons...so make it use the generic version instead. Signed-off-by: David H?rdeman <david@hardeman.nu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix up issue with "make dist"NeilBrown2014-12-071-0/+5
| | | | | | | | | | | | | Add mention of new files, remove mention of old files, and cause "make dist" to create something very similar to the current distributions. systemd files are not currently included in "make dist" and some files generated by "rpcgen" are (though they aren't in official distribution). Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfslib: remove now unused FILE helpersTimo Teräs2014-12-072-117/+0
| | | | | | | All access to kernel is now done using file descriptors. Signed-off-by: Timo Ter?s <timo.teras@iki.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsexport: talk to kernel using file descriptors instead of FILETimo Teräs2014-12-071-33/+44
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Add string.h to source files that need itTimo Teräs2014-12-073-0/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: warn when really nothing is exportedPavel Raiskup2014-12-032-14/+8
| | | | | | | | | | | | Throw 'No file systems exported!' iff no volume is exported rather then if some exports file is empty. Typically this can happen if the default /etc/exports file is empty and admin installed configuration into /etc/exports.d directory. This is follow-up for e725def62c73b4 commit. Signed-off-by: Pavel Raiskup <praiskup@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Do not fail on empty exports file.Steve Dickson2014-11-172-4/+11
| | | | | | | | | | Commit 076dd80 introduced a regression that causes exportfs to fail when there is an empty /etc/exports file. A empty /etc/exports file is valid and should not cause exportfs to fail. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set libtirpc nonblocking mode to avoid DOSBodo Stroesser2014-11-121-0/+17
| | | | | | | | | | | | | | | This patch is experimental. In works fine in that it removes the vulnerability against a DOS attack. rpc.mountd can be blocked by a bad client, that sends many RPC requests but never reads the responses. This might happen intentionally or caused by a wrong network config (MTU). The patch switches on the nonblocking mode of libtirpc. In that mode writes can block for a max of 2 seconds. Attackers are forced to send requests slower, as libtirpc will close a connection if it finds two requests to read at the same time. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set nonblocking mode with libtirpcBodo Stroesser2014-11-121-0/+7
| | | | | | | | | | | | If mountd is built with libtirpc the tcp listeners and the sockets waiting for UDP messages are not in non-blocking mode. Thus if running with multiple threads (-t XX), all threads will wake up from select on a connection request or a UDP message, but only one thread will succeed. All others will wait on accept() or read() for the next event. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set nonblocking mode if no libtirpcBodo Stroesser2014-11-123-33/+36
| | | | | | | | | | | | | If mountd is built without libtirpc and it is started using "-p XXX" option, the tcp listeners and the sockets waiting for UDP messages are not in non-blocking mode. Thus if running with multiple threads (-t XX), all threads will wake up from select on a connection request or a UDP message, but only one thread will succeed. All others will wait on accept() or read() for the next event. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: changes handling of unresolvable entriesHenrique Martins2014-11-043-5/+12
| | | | | | | | | The patch to nfs/exportfs to allow nfsd to start when there are some, but not all, unresolvable entries in /etc/exports. Signed-off-by: Henrique Martins <linux@martins.cc> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs_get_tcpclient/nfs_get_udpclient - make bind(2) implicitChris Perl2014-09-161-48/+20
| | | | | | | | | | | | | | | | | | | | | | | | | When attempting to establish a local ephemeral endpoint for a TCP or UDP socket, do not explicitly call bind(2), instead let it happen implicilty when the socket is first used. The main motivating factor for this change is when TCP runs out of unique ephemeral ports (i.e. cannot find any ephemeral ports which are not a part of *any* TCP connection). In this situation if you explicitly call bind(2), then the call will fail with EADDRINUSE. However, if you allow the allocation of an ephemeral port to happen implicitly as part of connect(2) (or other functions), then ephemeral ports can be reused, so long as the combination of (local_ip, local_port, remote_ip, remote_port) is unique for TCP sockets on the system. This doesn't matter for UDP sockets, but it seemed easiest to treat TCP and UDP sockets the same. This can allow mount.nfs(8) to continue to function successfully, even in the face of misbehaving applications which are creating a large number of TCP connections. Signed-off-by: Chris Perl <chris.perl@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: fix test of NULL pointer in host_pton()Natanael Copa2014-09-151-5/+7
| | | | | | | | This fixes the problem reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1083018 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Allow usage of getrpcbynumber() when getrpcbynumber_r() is unavailableNatanael Copa2014-09-151-3/+12
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* replace __attribute_malloc__ with the more portable __attribute__((__malloc__))Natanael Copa2014-09-153-13/+13
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix header include for definition of NULLNatanael Copa2014-09-151-0/+1
| | | | | | | NULL is defined in stdlib.h so we need to include that. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* conffile: use standard uint*_t and unsigned charNatanael Copa2014-09-152-8/+9
| | | | | | | Use the standard integer types. This fixes compiling errors with musl libc. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Allow turning off nfsv3 readdir_plusRajesh Ghanekar2014-08-202-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | One of our customer's application only needs file names, not file attributes. With directories having 10K+ inodes (assuming buffer cache has directory blocks cached having file names, but inode cache is limited and hence need eviction of older cached inodes), older inodes are evicted periodically. So if they keep on doing readdir(2) from NSF client on multiple directories, some directory's files are periodically removed from inode cache and hence new readdir(2) on same directory requires disk access to bring back inodes again to inode cache. As READDIRPLUS request fetches attributes also, doing getattr on each file on server, it causes unnecessary disk accesses. If READDIRPLUS on NFS client is returned with -ENOTSUPP, NFS client uses READDIR request which just gets the names of the files in a directory, not attributes, hence avoiding disk accesses on server. There's already a corresponding client-side mount option, but an export option reduces the need for configuration across multiple clients. This flag affects NFSv3 only. If it turns out it's needed for NFSv4 as well then we may have to figure out how to extend the behavior to NFSv4, but it's not currently obvious how to do that. Signed-off-by: Rajesh Ghanekar <rajesh_ghanekar@symantec.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix segfault in add_name with newer gcc compilersJeff Layton2014-05-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some NULL pointer checks got reordered such that a pointer was dereferenced before checking to see whether it was NULL. The problem was due to nfs-utils relying on undefined behavior, which tricked gcc into assuming that the pointer would never be NULL. At first I assumed that this was a compiler bug, but Jakub Jelinek and Jeff Law pointed out: "If old is NULL, then: strncpy(new, old, cp-old); is undefined behavior (even when cp == old == NULL in that case), therefore gcc assumes that old is never NULL, as otherwise it would be invalid. Just guard strncpy(new, old, cp-old); new[cp-old] = 0; with if (old) { ... }." This patch does that. If old is NULL though, then we still need to ensure that new is NULL terminated, lest the subsequent strcats walk off the end of it. Cc: Jeff Law <law@redhat.com> Cc: Jakub Jelinek <jakub@redhat.com> Signed-off-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsidmap: fix error reporting for nfs4_* family of functionsMateusz Guzik2014-03-112-0/+13
| | | | | | | | | | 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>
* nfsd: support NFS4_MAXMINOR up to the number an unsigned int can keepSteve Dickson2014-02-131-1/+2
| | | | | | | | | | | | | | | | | | | 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>
* exportfs: Exit with correct value when an error occursSteve Dickson2014-01-201-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: fix minorversion-choosing interfaceJ. Bruce Fields2014-01-071-1/+0
| | | | | | | | | | | | | | | | | | | | 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>
* nfs-utils: consolidate mydaemon() and release_parent() implementationsJeff Layton2013-11-203-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | We currently have 2 cut-and-paste versions of this code. One for idmapd and one for svcgssd.[1] The two are basically equivalent but there are some small differences, mostly related to how errors in that function are logged. svcgssd uses printerr() with a priority of 1, which only prints errors if -v was specified. That doesn't seem to be quite right. Daemonizing errors are necessarily fatal and should be logged as such. The one for idmapd uses err(), which always prints to stderr even though we have the xlog facility set up. Since both have xlog configured at this point, log the errors using xlog_err() instead. The only other significant difference I see is that the idmapd version will open "/" if it's unable to open "/dev/null". I believe that however was a holdover from an earlier version of that function that did not error out when we were unable to open a file descriptor. Since the function does that now, I don't believe we need that fallback anymore. [1]: technically, we have a third in statd too, but it's different enough that I don't want to touch it here. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Add the ability to disable UDP listeners.Steve Dickson2013-11-051-0/+3
| | | | | | | Add the ability to turn off UDP listeners with the new "-u | --no-udp" flag. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Use protocol bit fields to turn protocols off.Steve Dickson2013-11-053-6/+20
| | | | | | | Convert the current code to used the NFSCTL_XXX macros to turn off the TCP listener. Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: exit with error code if there was any error (take 2).NeilBrown2013-11-055-11/+6
| | | | | | | | | | | | | | | | | exportfs currently exits with a non-zero error for some errors, but not for others. It does this by having various support routines set the global variable "export_errno". Change this to have 'xlog' set export_errno if an ERROR is reported. That way all errors will be caught. Note that the exit error code is changed from 22 (EINVAL) to the more traditional '1'. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Stop Treat IP addresses a FQDN rather than SUBNETs.NeilBrown2013-10-241-11/+0
| | | | | | | | | | | | | | | I think there was a reason for this many years ago, but I can not find any evidence that it ever really did anything useful and it certainly doesn't seem to now. And the documentation suggests that IP address take precedence over SUBNETs, and that can only happen if they are treated as MCL_FQDN. So remove this apparently pointless code. Reported-and-tested-by: Wangminlan <wangminlan@huawei.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: exit with error code if there was any error.NeilBrown2013-10-221-0/+2
| | | | | | | | | | | | | | | | | exportfs currently exits with a non-zero error for some errors, but not for others. It does this by having various support routines set the global variable "export_errno". Change this to have 'xlog' set export_errno if an ERROR is reported. That way all errors will be caught. Note that the exit error code is changed from 22 (EINVAL) to the more traditional '1'. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Revert "exportfs: Return non-zero exit value on error"Steve Dickson2013-10-221-2/+0
| | | | This reverts commit 956aeff2e24304e938846f81f4b9db34cbf18a32.
* exportfs: Return non-zero exit value on errorTony Asleson2013-10-221-0/+2
| | | | | | | | | | | | To improve error handling when scripting exportfs it's useful to have non-zero exit codes when the requested operation did not succeed. This patch also returns a non-zero exit code if you request to unexport a non-existant share. Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Fix the default authentication flavour settingTrond Myklebust2013-09-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 11ba3b1e01b67b7d19f26fba94fabdb60878e809 (Add a default flavor to an export's e_secinfo list) breaks the ordering of security flavours in the secinfo list, by reordering 'sec=sys' to always be the first secinfo flavour if one fails to set a default 'sec' setting. An export of the form: /export -sync,no_subtree_check,mp \ 192.168.1.0/24(sec=krb5p:krb5i:krb5,rw,sec=sys,ro) ends up getting translated by exportfs into the following entry in /var/lib/nfs/etab: /export 192.168.1.0/24(ro,sync,wdelay,hide,nocrossmnt,\ secure,root_squash,no_all_squash,\ no_subtree_check,secure_locks,acl,\ mountpoint,anonuid=65534,anongid=65534,\ sec=sys,ro,root_squash,no_all_squash,\ sec=krb5p:krb5i:krb5,rw,root_squash,no_all_squash) Note how the 'sec=sys' is now listed first... The fix is to defer adding the default flavour until the call to secinfo_show, when we can see if it is even needed at all. With the patch, the above export is now correctly entered in /var/lib/nfs/etab as: /export 192.168.1.0/24(ro,sync,wdelay,hide,nocrossmnt,\ secure,root_squash,no_all_squash,\ no_subtree_check,secure_locks,acl,\ mountpoint,anonuid=65534,anongid=65534,\ sec=krb5p:krb5i:krb5,rw,root_squash,no_all_squash,\ sec=sys,ro,root_squash,no_all_squash) Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: insecure/secure should be a secinfo_flagTrond Myklebust2013-09-181-7/+27
| | | | | | | | | | | | | The 'insecure' flag is listed in /proc/fs/nfsd/export_features in newer kernels as being a secinfo_flag, however it is not displayed by secinfo_show. This patch fixes that, and sets up a framework which should make it easy to add new flags to /proc/fs/nfsd/export_features and have them be displayed properly. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: dont pass options from configuration sections that are not relevantScott Mayhew2013-08-192-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The nfsmount.conf file has the following format: [ section "arg" ] tag = value conf_get_tag_list() currently doesn't check the arg field so we wind up getting all the options that fall under a particular section value, instead of just the ones that match the specific "arg" field. As a result, we wind up passing options to the mount syscall from sections that aren't even relevant to the mount operation that is being performed. For example, if we have three different server sections, and each section has an Nfsvers tag, then the string we pass to the mount syscall will have two extra occurrences of the nfsvers option. Each option should appear at most 4 times -- once for the system section, once for the server-specific section, once for the mount-specific section, and once for the command line mount options. Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.nfsd: Allow v4.2 server support with the -V optionSteve Dickson2013-08-191-0/+4
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.nfsd: No longer advertise NFS v2 support.Steve Dickson2013-08-191-0/+1
| | | | | | | | | Changed the default protocol versions that rpc.nfsd register with rpcbind to just 3 and 4. Version 2 can still be enabled with the '-V' flag, but it will not be on by default. Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: exit if a statd is already runningWeston Andros Adamson2013-05-072-0/+27
| | | | | | | | Moves nfs_probe_statd from mount to nfs support lib to share with statd. Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix exporting of "/" with sec= setting.NeilBrown2013-04-222-1/+2
| | | | | | | | | | | | | | | | Commit 91bb95f2689e84856ecdf6fac365489d36709cf9 4set_root: force "fsid=0" for all exports of '/' set NFSEXP_FSID for the export of "/" if nothing else had any fsid set, however it didn't also set the flag for all security flavours. So the kernel complains that the flags on the security flavours don't match and it rejects the export. So call fix_pseudoflavor_flags() in write_secinfo() to make sure that any fiddling that has been done to e_flags gets copied to e_secinfo. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: Add support for the -V and --nfs-version optional argumentsTrond Myklebust2013-03-251-0/+1
| | | | | | | | | | Add command line options to enable those NFS versions that are currently disabled by default. We choose to use the options '-V' and '--nfs-version' for compatibility with rpc.mountd. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure: check for libio.h availabilityMike Frysinger2013-03-251-0/+6
| | | | | | | | On some systems (like uClibc), there isn't a libio.h header. But it isn't also needed on them. So check for the header first. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add a default flavor to an export's e_secinfo listChuck Lever2013-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of security flavors that mountd allows for the NFSv4 pseudo-fs is constructed from the union of flavors of all current exports. exports(5) documents that the default security flavor for an export, if "sec=" is not specified, is "sys". Suppose /etc/exports contains: /a *(rw) /b *(rw,sec=krb5:krb5i:krb5p) The resulting security flavor list for the pseudo-fs is missing "sec=sys". /proc/net/rpc/nfsd.export/content contains: /a *(rw,root_squash,sync,wdelay,no_subtree_check, uuid=095c95bc:08e4407a:91ab8601:05fe0bbf) /b *(rw,root_squash,sync,wdelay,no_subtree_check, uuid=2a6fe811:0cf044a7:8fc75ebe:65180068, sec=390003:390004:390005) / *(ro,root_squash,sync,no_wdelay,v4root,fsid=0, uuid=2a6fe811:0cf044a7:8fc75ebe:65180068, sec=390003:390004:390005) The root entry is not correct, as there does exist an export whose unspecified default security flavor is "sys". The security settings on the root cause sec=sys mount attempts to be incorrectly rejected. The reason is that when the line in /etc/exports for "/a" is parsed, the e_secinfo list for that exportent is left empty. Thus the union of e_secinfo lists created by set_pseudofs_security() is "krb5:krb5i:krb5p". I fixed this by ensuring that if no "sec=" option is specified for an export, its e_secinfo list gets at least an entry for AUTH_UNIX. [ Yes, we could make the security flavors allowed for the pseudo-fs a fixed list of all flavors the server supports. That becomes complicated by the special meaning of AUTH_NULL, and we still have to check /etc/exports for whether Kerberos flavors should be listed. I opted for a simple approach for now. ] Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix checking for errors when exporting filesystemsNeilBrown2012-12-171-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5604b35a61e22930873ffc4e9971002f578e7978 nfs-utils: Increase the stdio file buffer size for procfs files changed writes to some sysfs files to be line buffered (_IOLBF) where they weren't before. While this probably makes sense, it introduced a bug. With fully buffered streams, you don't expect to get an error until you call fflush(). With line buffered streams you can get the error from fprintf() et al. qword_eol() only tests the return from fflush(), not from fprintf(). Consequently errors were not noticed. One result of this is that if you export, with crossmnt, a filesystem underneath which are mounted non-exportable filesystems (e.g. /proc) then an 'ls -l' on the client will block indefinitely waiting for a meaningful 'yes' or 'no' from the server, but will never get one. This patch changes qword_eol to test both fprintf and fflush. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: xtab.c no longer needs #include xmalloc.hChuck Lever2012-12-121-1/+1
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: rmtab.c no longer needs #include xmalloc.hChuck Lever2012-12-121-3/+3
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Avoid unnecessary type conversionsChuck Lever2012-10-302-0/+6
| | | | | | | | | Removed a number of Wconversion warnings in the mountd code. Took the opportunity to eliminate some code duplication. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Eliminate dereferencing type punned pointersChuck Lever2012-10-301-6/+4
| | | | | | | | | | Removed a number of Wstrict-aliasing warnings Note also that site-local IPv6 addresses are deprecated, and thus are no longer encountered. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Add exportent_release()Chuck Lever2012-10-222-7/+13
| | | | | | | | | Split out the logic that releases dynamically allocated data in an exportent. The junction resolution code will invoke this to clean up the junction exportent once it has been dumped to the kernel. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Exportfs crashes with long pathIvan Romanov2012-10-151-1/+1
| | | | | Acked-by: Bruce Fields <bfields@fieldses.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: Before clearing the capability bounding set, check if we have the capHarald Hoyer2012-06-191-1/+1
| | | | | | | | | | | | | | | | | From: Harald Hoyer <harald@redhat.com> PR_CAPBSET_DROP can return EINVAL, if an older kernel does support some capabilities, which are defined by CAP_LAST_CAP, which results in a failure of the service. For example kernel 3.4 errors on CAP_EPOLLWAKEUP, which was newly introduced in 3.5. So, for future capabilities, we clear until we get an EINVAL for PR_CAPBSET_READ. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>