summaryrefslogtreecommitdiffstats
path: root/utils/statd/statd.h
Commit message (Collapse)AuthorAgeFilesLines
* statd: Add API to canonicalize mon_namesChuck Lever2010-01-151-0/+2
| | | | | | | | Provide a shared function to generate canonical names that statd uses to index its on-disk monitor list. This function can resolve DNS hostnames, and IPv4 and IPv6 presentation addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* statd: add nsm_present_address() APIChuck Lever2010-01-151-0/+2
| | | | | | | | | | | | Add an API to convert a socket address to a presentation address string. This is used for displaying error messages and the like. We prefer getnameinfo(3) over inet_?to?(3) as it supports IPv6 scope IDs. Since statd has to continue to build correctly on systems whose glibc does not have getnameinfo(3), an inet_?to?(3) version is also provided. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* statd: Introduce statd version of matchhostname()Chuck Lever2010-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | For the near future, statd will support IPv6 but exportfs will not. Thus statd will need a version of matchhostname() that can deal properly with IPv6 remotes. To reduce the risk of breaking exportfs, introduce a separate version of matchhostname() for statd to use while exportfs continues to use the existing AF_INET-only implementation. Note that statd will never send matchhostname() a hostname string containing export wildcards, so is_hostame() is not needed in the statd version of matchhostname(). This saves some computational expense when comparing hostnames. A separate statd-specific implementation of matchhostname() allows some flexibility in the long term, as well. We might want to enrich the matching heuristics of our SM_NOTIFY, for example, or replace them entirely with a heuristic that is not dependent upon DNS. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* statd: Use the new nsm_ file.c calls in rpc.statdChuck Lever2010-01-121-23/+0
| | | | | | | | | | Replace open-coded accesses to on-disk NSM information in rpc.statd with calls to the new API. Behavior should be much the same as it was before. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: Replace note() with xlog() in rpc.statdChuck Lever2009-11-241-8/+1
| | | | | | | | | | | To facilitate code sharing between statd and sm-notify (and with other components of nfs-utils), replace sm-notify's nsm_log() with xlog(). Since opt_quiet is used in only a handful of insignificant cases, it is removed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: not unlinking host filesSteve Dickson2008-12-171-1/+1
| | | | | | | | | | | | | | | 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>
* rpc.statd: Stop overloading sockfd in utils/statd/rmtcall.cChuck Lever2008-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add -Wstrict-prototypes to compiler args, and fix warnings caused.Neil Brown2007-07-291-1/+0
|
* statd - keep persistent state in sm/* files.Neil Brown2007-03-291-0/+1
| | | | | | | | | | | | If statd dies and is restarted, it forgets what peers the kernel is interested in monitoring, and so will not forward NOTIFY requests properly. With this patch the required information is recorded in the files in /var/lib/nfs/sm/* so that a kill/restart does what you might hope. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow rpc.statd to *not* run sm-notify.Neil Brown2007-03-201-1/+1
| | | | | With -L (for Listen-only) or --no-notify, statd will not run sm-notify.
* Remove notify functionality from statd in favour of sm-notifyNeil Brown2007-03-201-1/+0
| | | | | statd now execs sm-notify to notify peers and only listens to monitor requests and remote notifications itself.
* Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-221-1/+1
| | | | unused labels, constness, signedness.
* Autogen updateneilbrown2005-12-201-1/+4
|
* Assorted changes from Steve Dicksonneilbrown2005-10-061-0/+1
|
* Support --ha-callout for high-availability calloutsneilbrown2004-09-061-0/+2
|
* -N for statdneilbrown2002-09-021-1/+1
|
* Support "-P path" in statd as alternate to /var/lib/nfsneilbrown2002-09-021-5/+15
|
* Added a bitflag-based global to keep track of how statd is being run.lon2000-10-051-0/+19
|
* Initial revisionhjl1999-10-181-0/+58