summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add AF_INET6-capable API to acquire an RPC CLIENT *Chuck Lever2008-11-174-1/+605
| | | | | | | | | | | | Provide a simple interface that any component of nfs-utils can use to acquire an RPC CLIENT *. This is an AF_INET6-enabled API, and can also handle PF_LOCAL sockets if libtirpc is present on the system. When libtirpc is not available, legacy RPC services will be used instead, and an attempt to connect to an AF_INET6 address will fail. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Get rid of empty AUTHORS fileJan Engelhardt2008-10-212-1/+2
| | | | | | | | | | build: remove redundant AUTHORS file One can use the --foreign automake option to make it not enforce presence of an AUTHORS file. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Release 1.1.4Steve Dickson2008-10-171-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify should exit as soon as its determinedPhil Endecott2008-10-141-3/+10
| | | | | | | there are no hosts to notify. This also decreases start up time by a few seconds. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcgen: include sys/ioctl.h on linux systemsMike Frysinger2008-10-081-0/+3
| | | | | | | | | The rpcgen tool included with nfs-utils will generate calls to ioctl() but not actually generate the sys/ioctl.h header include. Attached patch should fix this. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): Clarify behavior of the mountproto= and proto= optionsChuck Lever2008-10-081-0/+85
| | | | | | | | Document the interaction between the mountproto= and the proto= mount options in a new subsection of nfs(5). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: make makesock() staticChuck Lever2008-10-081-42/+40
| | | | | | | | | | | | | | | | | | Clean up: The makesock() function can become static since it is only used in rpcmisc.c, where it is defined. Fix some minor nits while we're in the area: o Move it so we can remove it's forward declaration. o Get rid of unneeded newlines in the xlog() format strings. o Use htonl(INADDR_ANY) instead of INADDR_ANY to initialize sin_addr. Should make no run-time difference, but is slightly more proper, as the standard definition of INADDR_ANY is in host byte-order. o Remove the parentheses in the "return" statements. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Clean up support/nfs/rpcmisc.c:closedown()Chuck Lever2008-10-081-23/+25
| | | | | | | | Clean up: update closedown()'s synopsis to modern C style, and move the function so we can remove the forward declaration. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleaned up the wording in the rpc.nfsd(8) manpageSteve Dickson2008-10-011-1/+1
| | | | | | (BZ: https://bugzilla.linux-nfs.org/show_bug.cgi?id=159) Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleared up a contradiction in the export(5) man pageSteve Dickson2008-10-011-1/+1
| | | | | | (BZ: https://bugzilla.linux-nfs.org/show_bug.cgi?id=161) Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: change "unknown host" error message to "unmatched host"Jeff Layton2008-09-291-1/+1
| | | | | | | | | | | | | mount request from unknown host 10.11.14.99 for /export The hosts are listed in DNS with proper reverse records, so the reason why the host is "unknown" isn't clear. This patch just changes the wording of this error to hopefully make it more clear why the mount request was rejected. This also makes this error message use a format more similar to the other error messages in auth_authenticate(). Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): Replace the term "netid" in mount option descriptionsChuck Lever2008-09-291-8/+8
| | | | | | | | | | | | | | | | | | | | | | | TI-RPC introduced the concept of "netid" which is a string that is mapped to a set of transport capabilities via a netconfig database. RPC services register a netid and bindaddr with their local rpcbind daemon to advertise their ability to support particular transports. Mike Eisler noted that the use of the term "netid" in nfs(5) is not appropriate, since Linux does not treat the value of the proto= or mountproto= options as a netid proper, but rather to select a particular transport capability provided locally on the client. The Linux NFS client currently uses a simple internal mapping between these names and its own transport capabilities rather than using the names as part of an rpcbind query, thus these strings are really not netids. They are more akin to what TI-RPC calls "protocol names". Remove the term "netid" from nfs(5) for now. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Mike Eisler <mike.eisler@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): Replace the term "netid" in mount option descriptionsChuck Lever2008-09-291-6/+6
| | | | | | | | | | | | Mike Eisler noted that the use of the term "netid" in the descriptions of the "proto=" option is not appropriate, since Linux does not allow "udp6" or "tcp6". Replaced the term "netid" with "transport" in nfs(5). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Tom Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.statd: Stop overloading sockfd in utils/statd/rmtcall.cChuck Lever2008-09-263-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel's lockd requires that rpc.statd perform notification callbacks from a privileged source port. To guarantee rpc.statd gets a privileged source port but runs unprivileged, it calls statd_get_socket() then drops root privileges before starting it's svc request processing loop. Statd's svc request loop is the only caller of the process_foo() functions in utils/statd/rmtcall.c, but one of them, process_notify_list() attempts to invoke statd_get_socket() again. In today's code, this is unneeded because statd_get_socket() is always invoked before my_svc_run(). However, if it ever succeeded, it would get an unprivileged source port anyway, causing the kernel to reject all subsequent requests from statd. Thus the process_notify_list() function should not ever call statd_get_socket() because root privileges have been dropped by this point, and statd_get_socket() wouldn't get a privileged source port, causing the kernel to reject all subsequent SM_NOTIFY requests. So all of the process_foo functions in utils/statd/rmtcall.c should use the global sockfd instead of a local copy, as it already has a privileged source port. I've seen some unexplained behavior where statd starts making calls to the kernel via an unprivileged port. This could be one way that might occur. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.statd: Use __func__ in dprintfChuck Lever2008-09-261-23/+27
| | | | | | | | | | | | Clean up: The named function in many of the debugging messages in utils/statd/rmtcall.c is out of date. To prevent this from happening in the future, replace these with __func__. Also, note() and dprintf() do not require a terminating '\n' in their format string. So make all invocations consistent. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.statd: Clean up: replace "if (!(foo = rtnl))".Chuck Lever2008-09-262-6/+6
| | | | | | | | | | | | Static code checkers flag this kind of thing because it's easy to confuse with "if (!(foo == rtnl))". In one of these cases, the combination of evaluation and assignment isn't even necessary. While we are in the neighborhood, remove an extra argument to note() that is not called for in the passed-in format string. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: whitespace clean ups in support/nfs/rpcmisc.cChuck Lever2008-09-261-7/+6
| | | | | | | Clean up: fix a few spurious white space issues in support/nfs/rpcmisc.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Remove excess log reportingChuck Lever2008-09-261-8/+4
| | | | | | | | | Clean up: The makesock() function already reports an error if it can't create a socket. Remove the redundant error check and logging done in rpc_init() after a makesock() call. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: make makesock() staticChuck Lever2008-09-262-17/+22
| | | | | | | | | | | | | | | | | | Clean up: The makesock() function can become static since it is only used in rpcmisc.c, where it is defined. Fix some minor nits while we're in the area: o Move it so we can remove it's forward declaration. o Get rid of unneeded newlines in the xlog() format strings. o Use htonl(INADDR_ANY) instead of INADDR_ANY to initialize sin_addr. Should make no run-time difference, but is slightly more proper, as the standard definition of INADDR_ANY is in host byte-order. o Remove the parentheses in the "return" statements. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount: destroy RPC client when finishedChuck Lever2008-09-261-0/+4
| | | | | | | | | Clean up: call clnt_destroy() in the showmount command as needed to destroy the RPC client properly (and close the associated socket) before the program exits. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: remove disabled code from support/nfs/rpcmisc.cChuck Lever2008-09-261-16/+0
| | | | | | | | | After some recent discussions, we want to rely on the kernel's network layer to autotune socket buffers. Since this code is already disabled in support/nfs/rpcmisc.c (and has been for some time), let's just remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Remove unused function rpc_svcrun()Chuck Lever2008-09-262-52/+0
| | | | | | | | Clean up: remove function that has been disabled (via #if 0) for almost a decade. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: remove unused function rpc_logcall()Chuck Lever2008-09-262-61/+0
| | | | | | | Clean up: Eliminate rpc_logcall(), which has no callers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: use static function definitionsChuck Lever2008-09-261-10/+10
| | | | | | | | | | | | | | | | Clean up. The sm-notify command is built from a single source file. Some of its internal functions are appropriately defined as static. However, some are declared static, but defined as global. Some are declared and defined as global. None of them are used outside of utils/statd/sm-notify.c. Make all the internal functions in utils/statd/sm-notify.cstatic. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: replace nsm_address typedefChuck Lever2008-09-261-66/+63
| | | | | | | | | Clean up: replace "typedef struct sockaddr_storage nsm_address" with standard socket address types. This makes sm-notify.c consistent with other parts of nfs-utils, and with typical network application coding conventions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: clean up error loggingChuck Lever2008-09-261-19/+29
| | | | | | | | | | | | | | | | | | | | | | Clean up a few issues with logging in sm-notify.c. Sometimes in sm-notify, when a system call fails the problem is reported to stderr but not logged, and then usually sm-notify exits. In cases like this, there are probably more hosts to notify, but sm-notify dies silently. Make sure these errors are logged, and that the log messages explain the nature of the problem. Also, if sm-notify exits prematurely, make sure this is always reported at the LOG_ERR level, not at the LOG_WARNING level. Remove a couple of unnecessary '\n' in the arguments of nsm_log() calls -- nsm_log() already appends an '\n' to the message. Finally, use exit() consistently in main(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: getaddrinfo(3) addrinfo leakChuck Lever2008-09-261-1/+4
| | | | | | | | | | | Make sure the results of getaddrinfo(3) are properly freed in notify(). Note this is a one-time addrinfo allocation that would be automatically freed when sm-notify exits anyway, so this is more of a nit than a real bug fix. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: include <config.h>Chuck Lever2008-09-261-2/+4
| | | | | | | | Clean up: Include config.h as other source files do; instead of using "config.h" use the HAVE_CONFIG_H macro and include <config.h>. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount command: clean up error returns from connect_nb()Chuck Lever2008-09-261-10/+12
| | | | | | | | | | | | | Clean up connect_nb() in the showmount command. Sometimes it returns -1 on error, and sometimes a negative errno. On error, it should always return one of these or the other, not both. Similar functions in other parts of nfs-utils return -1 on error, and set errno; so let's do that here too. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.statd: eliminate --secure_statdChuck Lever2008-09-263-65/+13
| | | | | | | | | | | | | | | | | | | | | | | Clean up: Remove RESTRICTED_STATD to help make IPv6 changes simpler. We keep the code behind RESTRICTED_STATD, and toss anything that is compiled out when it is set. RESTRICTED_STATD was added almost 10 years ago in response to CERT CERT CA-99.05, which addresses exposures in rpc.statd that might allow an attacker to take advantage of buffer overflows in rpc.statd while it is running in privileged mode. These days, I can't think of a reason why anyone would want to run rpc.statd without setting RESTRICTED_STATD. In addition, I don't think rpc.statd is ever tested without it. Removing RESTRICTED_STATD will get rid of some address storage and comparison issues that will make IPv6 support simpler. Plus it will make our test matrix smaller! Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.tatd: refactor check to see if call is from loopback addressChuck Lever2008-09-261-46/+36
| | | | | | | | | | | | | | Refactor common logic to check if SM_FOO request is from loopback address. We'll have to do something about this for IPv6. On IPv6-capable systems, there will be only one AF_INET6 listener. The loopback caller will get either an IPv6 loopback address, or a mapped IPv4 loopback -- either way this will be an AF_INET6 address. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: enable retry for nfs23 to set the correct protocol for mount.Neil Brown2008-08-281-2/+4
| | | | | | | | | | Use a connected port when talking to portmap via UDP. This allows us to get ICMP errors reported back so we can avoid timeouts. Also catch the error (RPC_CANTRECV) properly in getport. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove idmapd.confJ. Bruce Fields2008-08-281-10/+0
| | | | | | | | The example idmapd.conf file is kept in libnfsidmap now, which is what's responsible for parsing it anyway. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Determine supported pseudoflavors from exportJ. Bruce Fields2008-08-281-17/+38
| | | | | | | | Instead of using a static list of supported flavors, we should be taking the list from the export. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Minor mountd.c cleanupJ. Bruce Fields2008-08-281-38/+49
| | | | | | | | | I find it more readable to have the normal (non-error) case unindented, and to keep conditionals relatively simple, as is the usual kernel style. Fix some inconsistent indentation while we're there. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove redundant m_path fieldJ. Bruce Fields2008-08-286-38/+5
| | | | | | | | | | | | | | | | | Contrary to the comment above its definition, the field m_path always has the same value as e_path: the *only* modifications of m_path are all of the form: strncpy(exp->m_export.m_path, exp->m_export.e_path, sizeof (exp->m_export.m_path) - 1); exp->m_export.m_path[sizeof (exp->m_export.m_path) - 1] = '\0'; So m_path is always just a copy of e_path. In places where we need to store a path to a submount of a CROSSMNT-exported filesystem, as in cache.c, we just use a local variable. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Stop exportfs warning about needing fsid, when we actually have oneDavid Woodhouse2008-08-281-1/+9
| | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Use fsid from statfs for UUID if blkid can't cope (or not used)David Woodhouse2008-08-281-2/+11
| | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Explicit UUID handling doesn't require blkid; factor out get_uuid_blkdev()David Woodhouse2008-08-281-36/+41
| | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix handling of explicit uuidDavid Woodhouse2008-08-282-2/+4
| | | | | | | | | | | Fix a couple of bugs which show up if you try to explicitly set a 16-byte UUID when exporting a file system. First, exportfs cuts the first two bytes off the UUID and writes something invalid to etab. Second, mountd writes the _ascii_ form of the UUID to the kernel, instead of converting it to hex. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount issue with Mac OSX and --manage-gids, client hangsNeil Brown2008-08-271-1/+3
| | | | | | | | | Make sure are zero len group list is sent down to the kernel when the gids do not exist on the server. Tested-by: Alex Samad <alex@samad.com.au> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs command: old glibc missing some flagsChuck Lever2008-07-311-0/+18
| | | | | | | | | | | | | | | | Old versions of glibc (< 2.4) have a getaddrinfo(3) implementation, but do not include public definitions of the AI_V4MAPPED, AI_ALL, and AI_ADDRCONFIG flags because it was believed that these flags were not standardized. However, these flags have standard definitions both in POSIX 1003 and in RFCs, and were thus included in later releases of glibc. To allow the mount.nfs command to build on systems with these older versions of glibc, add conditional definitions for these flags in utils/mount/network.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Release 1.1.3Steve Dickson2008-07-271-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount issuesMartin Leisner2008-07-251-2/+4
| | | | | | | | The connect_nb() routne returns zero for success and a negative value for failure which was not being interpreted correctly by the getport() routine. This patch fixes that problem. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5) man page: Add documentation for the "mountproto=" optionChuck Lever2008-07-251-0/+19
| | | | | | | | Looks like mountproto= was never documented in nfs(5). Add a paragraph that describes it in the "nfs mount options" section. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify: perform DNS lookup in the background.Steve Dickson2008-07-251-20/+40
| | | | | | | | | | | | | If an NFS server has no network connectivity when it reboots, it will block in sm-notify waiting for DNS lookup for a potentially large number of hosts. This is not helpful and just annoys the sysadmin. So do the DNS lookup in the backgrounded phase of sm-notify, before sending off the NOTIFY requests. Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* If portmap is not listening on UDP (as apparently happens withNeil Brown2008-07-161-4/+15
| | | | | | | | | | | | | | | | | | | MS-Windows-Server2003R2SP2), then nfs mounts have to be mounted with -o mountproto=tcp to succeed. In this case a umount will still try UDP and will fail to contact the server. It will still succeed with the local unmount (after a timeout) but exits with a non-zero exit status. This causes /bin/mount to retry so we get a strange error about the filesystem not being mounted. So: get umount to use tcp if "mountproto=tcp" appears in mtab ignore any failure message from the server that would overwrite a success message from the local umount syscall. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* If an NFS server is only listening on TCP for portmap (as apparentlyNeil Brown2008-07-162-2/+29
| | | | | | | | | | | | | | | MS-Windows-Server2003R2SP2 does), mount doesn't cope. There is retry logic in case the initial choice of version/etc doesn't work, but it doesn't cope with mountd needing tcp. So: Fix probe_port so that a TIMEDOUT error doesn't simply abort but probes with other protocols (e.g. tcp). Fix rewrite_mount_options to extract the mountproto option before doing a probe, then set mountproto (and mount prot) based on the result. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* It appears that a recent glibc update now enforces the requirement for a modeSteve Dickson2008-07-151-1/+7
| | | | | | | | | | parameter for open calls with the O_CREAT flag set. nfs-utils support code defines a function xflock used by exportfs and mountd that calls open with O_CREAT but no mode parameter. This causes exportfs and mountd to dump core, with the error message: *** invalid open64 call: O_CREAT without mode ***:rpc.mountd terminated Signed-off-by: Steve Dickson <steved@redhat.com>
* Clean up: Include the bare minimum of legacy RPC headers inChuck Lever2008-07-156-24/+9
| | | | | | | utils/mount/network.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>