summaryrefslogtreecommitdiffstats
path: root/support
Commit message (Collapse)AuthorAgeFilesLines
* exportfs: replace one xlog(D_GENERAL) in host_canonname()Scott Mayhew2016-05-021-1/+1
| | | | | | | | | | If we fall back to using the numeric host then we shouldn't call xlog with D_GENERAL. That can cause 'exportfs -u' to exit with a 1 if, for example, you have exports using ip addresses that can't be resolved to hostnames. Use D_PARSE instead. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* fix building w/newer C librariesMike Frysinger2016-04-272-0/+7
| | | | | | | | | | | | | | Linux C libraries are moving away from implicitly including the header sys/sysmacros.h via sys/types.h. We would like to do this for glibc now, but others (musl/etc...) have been doing it already. This means any code using major/minor/makedevs functions will fail to build when they don't include that header. Leverage the AC_HEADER_MAJOR macro that configure is already using to pull in the right header. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: Don't unregister statd service on failing to execute calloutToshiaki Makita2016-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | statd calls atexit(statd_unregister) to unregister statd service on exit, which actually has a side-effect that ha_callout() unregisters statd service even when the child callout process exits on execl() failure. Certain clustering software's deployment script adds -H option with its specified file non-existent, when it is configured not to use callout. In other words, -H seems to be used no matter if callout is needed or not, but when callout is unnecessary, the specified callout program is not deployed. This causes statd not to work once a lock is requested by its NFS client, as execl() in ha_callout() results in ENOENT and exit() of the child process calls exit-handler statd_unregister(). Eventually, the NFS client gets stuck with messages "lockd: cannot monitor xxx" on the NFS server. Also, execl() could fail for other reasons like ENFILE or EIO as well. A forked child must not unregister the statd RPC server, so use _exit(), which does not call any exit-handlers, instead of exit(). Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: fix missing brace in host_ntop() fallbackStefan Hajnoczi2016-03-161-1/+1
| | | | | | | | | An if statement has been missing a brace since host_ntop() was added in commit 94ce1eb94babb4c587b2826452fb053cba745098 ("libexport.a: Add helpers to manage DNS lookups"). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs_connect_nb: handle EINTR during connection establishmentOlga Kornievskaia2016-01-161-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | both connect() and select() can receive EINTR signals that we need to recover from. In Unix Network Programming, volume 1, section 5.9, W. Richard Stevens states: What we are doing [?] is restarting the interrupted system call ourself. This is fine for accept, along with the functions such as read, write, select and open. But there is one function that we cannot restart ourself: connect. If this function returns EINTR, we cannot call it again, as doing so will return an immediate error. When connect is interrupted by a caught signal and is not automatically restarted, we must call select to wait for the connection to complete, Thus for connect() treat both EINPROGRESS and EINTR the same -- call select(). For select(), it should be re-tried again upon receiving EINTR. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Set right error after getaddrinfo failsRinku Kothiya2016-01-161-2/+2
| | | | | | | URL: https://bugzilla.redhat.com/show_bug.cgi?id=1287468 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com> Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix netgroup lookup for short hostnamesFrank Sorenson2015-12-161-10/+7
| | | | | | | | | | | | Commit 9a92ef6f to add netgroup lookup of resolvable IP addresses inadvertently broke the netgroup check for short hostnames. This patch fixes that breakage by changing the IP address lookup to use a separate variable. Signed-off-by: Frank Sorenson <sorenson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libnsm.a: do not close file if open failedVivek Trivedi2015-12-112-2/+4
| | | | | | | | If file open failed, no need to issue close system call in nsm_get_state and closeall. Signed-off-by: Vivek Trivedi <t.vivek@samsung.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* svc_create.c: Make sure errors are loggedSteve Dickson2015-11-202-10/+13
| | | | | | | | To help debug rpcbind failures, make sure all errors are logged and log as much info about the error as possible. Signed-off-by: Steve Dickson <steved@redhat.com>
* mydaemon.c: Removed a warningSteve Dickson2015-11-041-0/+1
| | | | | | | | Commit 273b4647 introduced the following warning: mydaemon.c:125:2: warning: implicit declaration of function 'closelog' [-Wimplicit-function-declaration] Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Restore the EAI_NONAME check in host_pton()Scott Mayhew2015-11-021-0/+2
| | | | | | | | | Commit d89e3fc7 removed the EAI_NONAME check altogether instead of just moving the NULL check. This causes exportfs -u to incorrectly exit with 1 whenever there's more than one MCL_FQDN export in the exportlist. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix netgroup lookup for resolvable IP addressesFrank Sorenson2015-11-021-0/+15
| | | | | | | | | | | | | | | | If a netgroup entry specifies an IP address, and that IP address can be resolved to a name, mountd will currently only test whether the canonical name and any aliases are in the netgroup, and does not test whether the IP address is in the netgroup (IP addresses which do not resolve to a name are already checked against the netgroup). This patch adds the check to see whether the IP addresses are in the netgroup. Signed-off-by: Frank Sorenson <sorenson@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Allow gssd and svcgssd to set the libtirpc debug levelScott Mayhew2015-11-021-0/+3
| | | | | | | | The interface for controlling the debug level in libtirpc was added over a year ago, but nothing's taking advantage of it. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* close the syslog fd in daemon_init()Scott Mayhew2015-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | Commit 7addf9d (cleanup daemonization code) added the following line to mydaemon_init(): dup2(pipefds[1], 3); If we've already called vsyslog() before the fork(), then chances are fd 3 was being used for the syslog socket. In that case the next vsyslog() call will cause the data to appear on the read end of the pipe, causing the parent to exit with a nonzero status. If systemd is running, it will see the parent's nonzero exit status and will terminate the child as well. So just call closelog() to close the fd. The next call to vsyslog() will open a new one if need be. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* security information number as, 1 1 0 0Kinglong Mee2015-05-061-1/+1
| | | | | | | | | | | It's caused by commit 4a1ad4aa30, "mountd: Enable all auth flavors on pseudofs exports" This patch removes duplicate secinfo and invalid secinfo (zero). Acked-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: add missing comma for exports entKinglong Mee2015-04-061-1/+1
| | | | | | | | | | | | | When using pnfs with "fsid=0", exportfs prints error as, $ exportfs -a exportfs: /var/lib/nfs/etab:1: unknown keyword "no_pnfsfsid=0" Commit cdd16bef98 ("nfs-utils: add support for the "pnfs" export option") miss the comma after "pnfs"/"on_pnfs" operation. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: add support for the "pnfs" export optionChristoph Hellwig2015-04-022-0/+6
| | | | | | | | This goes along with the patch just sent to Bruce to make pnfs support conditional. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* 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>