summaryrefslogtreecommitdiffstats
path: root/utils/statd/monitor.c
Commit message (Collapse)AuthorAgeFilesLines
* statd: not unlinking host filesSteve Dickson2008-12-171-2/+2
| | | | | | | | | | | | | | | 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: Clean up: replace "if (!(foo = rtnl))".Chuck Lever2008-09-261-2/+4
| | | | | | | | | | | | 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>
* rpc.statd: eliminate --secure_statdChuck Lever2008-09-261-34/+0
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Add -Wstrict-prototypes to compiler args, and fix warnings caused.Neil Brown2007-07-291-1/+1
|
* statd - the files created are named for dns_name, so use that when unlinking.Neil Brown2007-05-031-2/+2
| | | | Also free dns_name when freeing an 'nlist', so do the unlink before the free.
* Don't hide my_name in statd.Neil Brown2007-04-201-7/+22
| | | | | statd now passes the 'my_name' from the SM_MON call faithfully to the ha-callout and records it in the sm/ files.
* Tell NFS/lockd client what that local state number is.Neil Brown2007-04-021-5/+13
| | | | | | | | | | | | Both SM_STAT and SM_MON can return the state of an NSM, but it is unclear which NSM they return the state of, so the value cannot be used, and lockd doesn't use it. Document this confusion, and give the current state to the kernel via a sysctl if that sysctl is available (since about 2.6.19). This should make is possible for the NFS server to detect a small class of bad SM_NOTIFY packets and not flush locks in that case. Signed-off-by: Neil Brown <neilb@suse.de>
* statd - use dnsname to ensure correct matching of NOTIFY requests.Neil Brown2007-03-291-13/+27
| | | | | | | | | | | | | | | When lockd asks to monitor a host, we find the FQDN from the DNS and remember that, both internally and in the /var/lib/nfs/sm/* file. When we receive an SM_NOTIFY request, we compare both the mon_name and the source IP address against that DNS name to find a match. If a DNS name is not available, we fall back to the name provided by lockd, which at least is known to map to an IP address via gethostbyname. Signed-off-by: Neil Brown <neilb@suse.de>
* statd - check for 'priv' when looking for duplicate registrations.Neil Brown2007-03-291-1/+2
| | | | | | | | From the point of view of the client (lockd), the 'priv' blob is probably the most important key, so make sure to not throw away requests with new 'priv' information. Signed-off-by: Neil Brown <neilb@suse.de>
* statd - remove a pointless ifNeil Brown2007-03-291-19/+17
| | | | | | The if contains a while with essentially the same condition. Signed-off-by: Neil Brown <neilb@suse.de>
* statd - keep persistent state in sm/* files.Neil Brown2007-03-291-1/+76
| | | | | | | | | | | | 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>
* Make --enable-secure-statd the default.Neil Brown2007-03-151-6/+14
| | | | | | | | | | | | | | i.e. you now need --disable-secure-statd if you want any client other than lockd to talk to statd. Also relax the RESTRICTED_STATD checks so that a recent kernel with /proc/sys/fs/nfs/nsm_use_hostnames set can still talk to statd. Finally, restrict access to simulate_crash so that only privileged processes on localhost can call it. Having it accessible by the whole world is probably not much more than a minor inconvenience, but it really should be kept closed.
* Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-221-0/+4
| | | | unused labels, constness, signedness.
* Autogen updateneilbrown2005-12-201-1/+3
|
* Assorted changes from Steve Dicksonneilbrown2005-10-061-1/+2
|
* Fix spurious error message: erroneous SM_UNMON if RESTRICTED_STATDneilbrown2004-09-151-5/+41
|
* Support --ha-callout for high-availability calloutsneilbrown2004-09-061-0/+9
|
* Rename statd log() to note() to avoid conflict with ISO C.chip2003-08-221-18/+18
|
* Support "-P path" in statd as alternate to /var/lib/nfsneilbrown2002-09-021-1/+1
|
* 2000-12-10 Chip Salzenberg <chip@valinux.com>chip2000-12-111-4/+7
| | | | | | * utils/statd/monitor.c (sm_mon_1_svc): Fix buggy check for program and procedure numbers of kernel lockd's callback. Also, besides the old (and broken) procedure #24, allow #16 per Trond.
* Accept lockd callbacks to the new port 24 as well as the historicalchip1999-11-251-1/+4
| | | | port 100021.
* Initial revisionhjl1999-10-181-0/+287