summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | gssd: By default, don't spam syslog when users' credentials expireKevin Coffman2009-01-054-11/+11
|/ | | | | | | | | | | | | | | | | | Change the priority of "common" log messages so that syslog doesn't get slammed/spammed when users' credentials expire, or there is another common problem which would cause error messages for all context creation requests. Note that this will now require that gssd or svcgssd option "-v" is used to debug these common cases. Original patch from Andrew Pollock <apollock@google.com>. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com> CC: Andrew Pollock <apollock@google.com>
* Now that the TCP wrapper actually works, mounts willSteve Dickson2009-01-031-4/+16
| | | | | | | | be denied with misconfigured DNS configurations. Warnings will be logged when these types of configurations are detected. Signed-off-by: Steve Dickson <steved@redhat.com>
* To ensure the hash table of clients has validSteve Dickson2008-12-191-3/+42
| | | | | | | | | access rights, check the modification times on both access files. If one of them have change, update the hash entry instead of creating a new entry. Signed-off-by: Steve Dickson <steved@redhat.com>
* Clients IP address and host names are check onSteve Dickson2008-12-191-0/+79
| | | | | | | | | | every RPC request, to both mountd and statd when TCP wrappers are enabled. To help this process scale better the access rights are stored in a hash table, which are hashed per IP address, RPC program and procudure numbers. Signed-off-by: Steve Dickson <steved@redhat.com>
* When clients are define as IP addresses in /etc/hosts.deny,Steve Dickson2008-12-191-44/+45
| | | | | | | | access is allow due to misinterpreting the return value of hosts_ctl(). This patch reworks that logic which closes that hole. Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: not unlinking host filesSteve Dickson2008-12-173-17/+19
| | | | | | | | | | | | | | | Statd is not unlinking host files during SM_UNMON and SM_UNMON_ALL calls because the given host is still on the run-time notify list (rtnl) and the check flag is set when xunlink() is called. But the next thing the caller of xunlink() does is remove the host from the rtnl list which means the unlink will never happen. So this patch removes the check flag from xunlink() since its not needed and correctly allocates and frees memory used by xunlink(). Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify command: fix a use-after-free bugChuck Lever2008-12-171-11/+14
| | | | | | | | | | | | | The recv_reply() function was referencing host->ai in a freeaddrinfo(3) call after it had freed @host. This is not likely to be harmful in a single-threaded user context, but it's still bad form, and it will get called out if testing sm-notify with poisoned free memory. The less noise, the better we are able to see real problems. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* text-based mount command: use po_get_numeric() for handling retryChuck Lever2008-12-171-9/+11
| | | | | | | | Replace the logic in nfs_parse_retry_option() with a call to the new po_get_numeric() function. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* text-based mount command: add function to parse numeric mount optionsChuck Lever2008-12-172-0/+58
| | | | | | | | Introduce a function that is especially for parsing keyword mount options that take a numeric value. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* svcgssd: use the actual context expiration for cacheKevin Coffman2008-12-111-7/+13
| | | | | | | | | | | | | | | Instead of sending down an infinite expiration value for the rsi(init) and rsc(context) cache entries, use a reasonable value for the rsi cache, and the actual context expiration value for the rsc cache. Prompted by a proposal from Neil Brown as a result of a complaint of a server running out of kernel memory when under heavy load of rpcsec_gss traffic. Neil's original patch used one minute for the init cache and one hour for the context cache. Using the actual expiration time prevents unnecessary context re-negotiation. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd/svcgssd: add support to retrieve actual context expirationKevin Coffman2008-12-118-17/+30
| | | | | | | | | Add some plumbing so that the context expiration can be returned while serializing the information. Later patch(es) will actually get the expiration and pass it down to the kernel. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: AF_INET6 support for probe_bothports()Chuck Lever2008-12-112-21/+68
| | | | | | | | | | | | | | | | Introduce an AF_INET6 capable probe_bothports() API. This means replacing "struct sockaddr_in *" arguments with a "struct sockaddr *" and a socklen_t arguments. These functions often combine a "struct sockaddr_in" and a "struct pmap" into a single "clnt_addr_t" argument. Instead of modifying "clnt_addr_t" and all the legacy code that uses it, I'm going to create a new probe_bothports() API for the text-based mount command that takes a "struct sockaddr *" and sockaddr length, and leave the existing probe_bothports() interface, which takes "clnt_addr_t" arguments, for legacy use. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: support AF_INET6 in probe_nfsport() and probe_mntport()Chuck Lever2008-12-111-16/+42
| | | | | | | | Flesh out support for AF_INET6 in the intermediate helper functions probe_nfsport() and probe_mntport(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: full support for AF_INET6 addresses in probe_port()Chuck Lever2008-12-111-10/+44
| | | | | | | | Now that probe_port() uses an AF_INET6-capable rpcbind query and RPC ping, finish updating probe_port() to support AF_INET6 addresses fully. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify: always exiting without any notificationSteve Dickson2008-12-061-1/+2
| | | | | | | | Added curly brackets around the record_pid() check which stop sm-notify from exiting when a pid file does not exist. Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: remove local getport() implementationChuck Lever2008-12-021-74/+2
| | | | | | | | Eliminate local getport() implementation from utils/mount/network.c, as it is no longer used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: Replace clnt_ping() and getport() calls in probe_port()Chuck Lever2008-12-021-14/+29
| | | | | | | | | | | Update the mount command's probe_port() function to call the new shared rpcbind query and RPC ping functions. This provides immediate support for rpcbind v3/v4 queries, and paves the way for supporting AF_INET6 in the probe_bothports() path. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: Use nfs_error() instead of perror()Chuck Lever2008-12-021-1/+2
| | | | | | | | So we can ensure that error output is directed appropriately, use nfs_error() instead of perror() in start_statd(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount command: Use nfs_pmap_getport() in probe_statd()Chuck Lever2008-12-021-18/+16
| | | | | | | | Repace the getport() and clnt_ping() calls in probe_statd() with their new shared equivalents. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Ensure statd gets started if required when non-rootNeil Brown2008-11-262-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | user mounts an NFS filesystem. The first time an NFS filesystem is mounted, we start statd from /sbin/mount.nfs. If this first time is a non-root user doing the mount, (thanks to e.g. the 'users' option in /etc/fstab) then we need to be sure that the 'setuid' status from mount.nfs is inherited through to rpc.statd so that it runs as root. There are two places where we loose our setuid status due to the shell (/bin/sh) discarding. 1/ mount.nfs uses "system" to run /usr/sbin/start-statd. This runs a shell which is likely to drop privileges. So change that code to use 'fork' and 'execl' explicitly. 2/ start-statd is a shell script. To convince the shell to allow the program to run in privileged mode, we need to add a "-p" flag. We could just call setuid(getuid()) at some appropriate time, and it might be worth doing that as well, however I think that getting rid of 'system()' is a good idea and once that is done, the adding of '-p' is trivial and sufficient. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: unblock DNOTIFY_SIGNAL in case it was blocked.Neil Brown2008-11-261-0/+6
| | | | | | | | | | | | | | | | | | | | I have a situation where rpc.gssd appears to not be working. Mount attempts which need to communicate with it block. I've narrowed down the problem to that fact that all realtime signals have been blocked. This means that DNOTIFY_SIGNAL (which is a realtime signal) is never delivered, so gssd never rescans the rpc_pipe/nfs directory. It seems start_kde (or whatever it is called) and all descendants have these signals blocked. xfce seems to do the same thing. gnome doesn't. So if you start rpc.gssd from a terminal window while logged in via KDE, it doesn't behave as expected. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount command: support querying IPv6 serversChuck Lever2008-11-251-0/+36
| | | | | | | | | | Introduce a version of nfs_get_mount_client() that supports AF_INET6 and AF_INET server addresses. If the TI-RPC library is not available when the showmount command is built, fall back to the legacy RPC user-space API. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount command: move logic to acquire RPC client handle out of main()Chuck Lever2008-11-251-52/+64
| | | | | | | | | | In preparation to support IPv6 in the showmount command, extract the logic that parses/acquires the target hostname and converts it into an RPC client handle to contact the remote mountd service, and move it into its own function. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount command: Remove unused local getport() implementationChuck Lever2008-11-251-105/+0
| | | | | | | | Clean up: remove showmount.c's local getport() implementation, now that the showmount command uses the shared one. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* showmount command: call nfs_getport instead of local getportChuck Lever2008-11-251-6/+8
| | | | | | | | | | Have the showmount command invoke the shared nfs_getport() function instead of its own local version. This gives the showmount command immediate support for querying via rpcbindv3/v4 in addition to portmapper, and sets the stage for AF_INET6 support in showmount. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Added support/nfs/getport.cSteve Dickson2008-11-181-0/+965
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce rpcbind client utility functionsChuck Lever2008-11-172-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that at least the mount command and the showmount command need to query a server's rpcbind daemon. They need to query over AF_INET6 as well as AF_INET. libtirpc provides an rpcbind query capability with the rpcb_getaddr(3) interface, but it takes a hostname and netconfig entry rather than a sockaddr and a protocol type, and always uses a lengthy timeout. The former is important to the mount command because it sometimes must operate using a specific port and IP address rather than depending on rpcbind and DNS to convert a [hostname, RPC program, netconfig] tuple to a [socket address, port number, transport protocol] tuple. The rpcb_getaddr(3) API also always uses a privileged port (at least for setuid root executables like mount.nfs), which is not required for an rpcbind query. This can exhaust the local system's reserved port space quickly. This patch provides a reserved-port-friendly AF_INET6-capable rpcbind query C API that can be shared among commands and tools in nfs-utils, and allows a query to a specified socket address and port rather than a hostname. In addition to an rpcbind query interface, this patch also provides a facility to ping the remote RPC service to ensure that it is operating as advertised by rpcbind. It's useful to combine an RPC ping with an rpcbind query because in many cases, components of nfs-utils already ping an RPC service immediately after receiving a successful GETPORT result. There are also a handful of utility routines provided, such as a functions that can map between [sockaddr, port] and a universal address. I've made an attempt to make these new functions build and operate on systems that do not have libtirpc. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* 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>