summaryrefslogtreecommitdiffstats
path: root/support/misc
Commit message (Collapse)AuthorAgeFilesLines
* tcpwrapper: Add support for IPv6Chuck Lever2010-01-171-36/+79
| | | | | | | | | | Assuming the tcp_wrappers library can actually support IPv6 addresses, here's a crack at IPv6 support in nfs-utils' TCP wrapper shim. Some reorganization is done to limit the number of times that @sap is converted to a presentation address string. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* tcpwrapper: Eliminated shadowed declaration warningsChuck Lever2010-01-171-17/+15
| | | | | | | | | | | | | | | | | | | | | | Clean up: the use of identifiers called "access" and "daemon" shadow function declarations in unistd.h. Seen with "-Wextra -pedantic". tcpwrapper.c: In function haccess_add: tcpwrapper.c:112: warning: declaration of access shadows a global declaration /usr/include/unistd.h:288: warning: shadowed declaration is here tcpwrapper.c: In function good_client: tcpwrapper.c:161: warning: declaration of daemon shadows a global declaration /usr/include/unistd.h:953: warning: shadowed declaration is here tcpwrapper.c: In function check_default: tcpwrapper.c:212: warning: declaration of daemon shadows a global declaration /usr/include/unistd.h:953: warning: shadowed declaration is here good_client() is used only in support/misc/tcpwrapper.c, so make it static (and update its prototype to c99 standard form). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* tcpwrapper: Fix signage problems in the tcp_wrappers hash functionChuck Lever2010-01-171-14/+20
| | | | | | | | | | | | | | | | | | | | Eliminate the following compiler warnings: tcpwrapper.c:78: warning: no previous prototype for strtoint tcpwrapper.c: In function strtoint tcpwrapper.c:81: warning: conversion to int size_t may change the sign of the result tcpwrapper.c:85: warning: conversion to unsigned int from int may change the sign of the result tcpwrapper.c: In function hashint: tcpwrapper.c:91: warning: conversion to int from unsigned int may change the sign of the result The hash value is probably computed consistently even with unexpected sign inversions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* tcp_wrapper: Clean up logit()Chuck Lever2010-01-171-32/+24
| | | | | | | | | | | | | | | | | | | | | | | | | Eliminate these compiler warnings: tcpwrapper.c: In function logit tcpwrapper.c:225: warning: unused parameter procnum tcpwrapper.c:225: warning: unused parameter prognum Actually, @procnum is not used anywhere in our tcpwrapper.c, so let's just get rid of it. Since there is only one logit() call site in tcpwrapper.c, the macro wrapper just adds needless clutter. Let's get rid of that too. Finally, both mountd and statd now use xlog(), which adds an appropriate program name prefix to every message. Replace the open-coded syslog(2) call with an xlog() call in order to consistently identify the RPC service reporting the intrusion. Since logit() no longer references "deny_severity" and no nfs-utils caller sets either allow_severity or deny_severity, we remove them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* tcp_wrappers: Use getifaddrs(3) if it is availableChuck Lever2010-01-172-8/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After glibc 2.3.3, getifaddrs(3) can return AF_INET6 addresses for local network interfaces. Using the library call is easier than trying to update the open code in from_local(), and means we have less to maintain in nfs-utils going forward. And, since from_local() can now support IPv6, change its synopsis to take a "struct sockaddr *" . Note that the original code discovers local addresses once. These days, with wifi, DHCP, and NetworkManager, the local network configuration can change dynamically over time. So, call getifaddrs() more often to ensure from_local() has up-to-date network configuration information. This implementation refreshes the list if from_local() has not been called in the last second. This is actually not terribly honerous. check_default() invokes from_local() only when the remote host is not in its access cache, or the access/deny files have changed. So new hosts will cause a refresh, but previously seen hosts (including localhost) should not. On the other hand, it still may not be often enough. After the first call, if only previously seen hosts attempt to access our daemons, from_local() would never be called, and the local list would never be updated. This might be possible during steady-state operation with a small number of servers and clients. It would also be nice if we could free the local interface address list at shutdown time, but that would be a lot of trouble for little gain. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* tcpwrappers: Use xlog() instead of perror(3) and syslog(2)Chuck Lever2010-01-171-12/+13
| | | | | | | | | | | | Clean up: Replace calls to syslog(2) and perror(3) in from_local.c with calls to xlog(). The problems displayed by the perror(3) calls especially should be reported. Currently they are never seen in the system log. As part of a build test, I defined TEST, and found a couple of problems with main(), which are also addressed in this patch. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Replace the Sun RPC license with the BSD license,Tom spot Callaway2009-06-021-25/+23
| | | | | | | with the explicit permission of Sun Microsystems Signed-off-by: Tom "spot" Callaway <tcallawa@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Added back the some logging variables which are noSteve Dickson2009-03-081-1/+9
| | | | | | | | | longer used but, unfortunately, they are extern-ed by public headers files which are not under the control of this package. Spotted-by: Juergen Daubert <jue@jue.li> Signed-off-by: Steve Dickson <steved@redhat.com>
* General clean up. Removed unused routines. Reworked syslogSteve Dickson2009-03-041-130/+5
| | | | | | | | message to (hopefully) make it more sensible. Move "#ifdef HAVE_LIBWRAP" around so nothing will be defined when tcp wrapper is not configured. Signed-off-by: Steve Dickson <steved@redhat.com>
* Converted good_client() to correctly use the tcp wrapperSteve Dickson2009-03-041-50/+7
| | | | | | | interface and added a note to the mountd man page saying hostnames will be ignored when they can not be looked up. Signed-off-by: Steve Dickson <steved@redhat.com>
* Only hash on IP address and Program number. Including the ProcedureSteve Dickson2009-03-041-12/+11
| | | | | | number only creates needles extra hash entries. Signed-off-by: Steve Dickson <steved@redhat.com>
* Exportfs and rpc.mountd optimalizationTomas Richter2009-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There were some problems with exportfs and rpc.mountd for long export lists - see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76643 I do optimalization as my bachelors thesis (Facuulty of informatics, Masaryk's university Brno, Czech Republic), under lead of Yenya Kasprzak. Both exportfs and rpc.mount build linked list of exports (shared functions in export.c). Every time they are inserting new export into list, they search for same export in list. I replaced linked list by hash table and functions export_add and export_lookup by functions hash_export_add and hash_export_lookup (export.c). Because some other functions required exportlist as linked list, hash table has some implementation modification im comparison with ordinary hash table. It also keeps exports in linked list and has pointer to head of the list. So there's no need of implementation function <for_all_in_hash_table>. Signed-off-by: Tomas Richter <krik3t@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.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>
* Fixed arguments to the hosts_ctl() call in the good_client() routineSten Spans2008-05-051-2/+2
| | | | | | used in the tcpwrapper support. Signe-off-by: Steve Dickson <steved@redhat.com>
* Add -Wstrict-prototypes to compiler args, and fix warnings caused.Neil Brown2007-07-292-20/+12
|
* Include the right header to get xmalloc() declaration.Greg Banks2006-07-031-1/+1
|
* Merge branch 'master' of git://linux-nfs.org/nfs-utilsGreg Banks2006-07-031-7/+12
|\
| * Further coverity related cleanups.Neil Brown2006-06-231-3/+2
| | | | | | | | | | Greg Banks suggested some variations, particularly improved use of xmalloc/xstrdup functions. Thanks.
| * Fix various issues discovered by CoverityNeil Brown2006-06-231-6/+12
| | | | | | | | Thanks to Michael Halcrow for finding them.
* | Comment out the decades-old SCCS id strings from the original SunGreg Banks2006-06-271-1/+1
|/ | | | | | distribution. They cause compile warnings, there is no longer any reason to try to build them into the binaries, and gcc seems to be eliding some of them anyway.
* Remove **/Makefile.in, aclocal.m4, configure, andNeil Brown2006-04-171-470/+0
| | | | | | support/include/config.h.in from source control These are auto autogenerated by aclocal -I aclocal ; autoheader ; automake ; autoconf
* 2006-04-10 "Kevin Coffman" <kwc@citi.umich.edu>neilbrown2006-04-101-0/+2
| | | | | Check for sufficient version of librpcsecgss and libgssapi in configure.in
* 2006-04-10 "Kevin Coffman" <kwc@citi.umich.edu>neilbrown2006-04-101-0/+2
| | | | | Update aclocal/tcp-wrappers.m4 to define HAVE_LIBWRAP and HAVE_TCP_WRAPPERS as appropriate.
* aclocal/autoconf/automake, properly this time.neilbrown2006-03-281-0/+4
|
* Remove all the Makefilesneilbrown2005-12-201-12/+0
|
* More automake stuffneilbrown2005-12-201-0/+462
|
* Autogen updateneilbrown2005-12-202-2/+17
|
* Added TOP, as needed, for easier compile in subdirectoriesgmorris2005-04-121-0/+1
|
* new "mountpoint" export option.neilbrown2003-05-302-1/+35
|
* 2001-11-26 Chip Salzenberg <chip@pobox.com>chip2001-11-261-3/+1
| | | | | | | | | | * utils/showmount/showmount.c (main): Don't assume that strings starting with digits are IP addresses. * utils/nfsd/nfsd.c (main): Close all fds and reopen 0,1,2 on /dev/null before nfssvc(). Use syslog to report nfssvc errors. * support/misc/tcpwrapper.c, utils/mountd/mountd.man, utils/rquotad/rquotad.man, utils/statd/statd.man: Fix comments and man pages: We check host names *and* addresses with tcpwrappers.
* 2000-08-25 H.J. Lu <hjl@lucon.org>hjl2000-08-261-5/+7
| | | | * support/misc/tcpwrapper.c (logit): Modify the log output.
* 2000-08-25 Ion Badulescu <ionut@cs.columbia.edu>hjl2000-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * utils/rquotad/rquotad.man, utils/statd/statd.man, utils/mountd/mountd.man: updated * utils/mountd/Makefile (LIBS): added -lmisc $(LIBWRAP) $(LIBNSL) * utils/rquotad/Makefile: fix comment * support/misc/tcpwrapper.c (logit): added comment about waiting for the children after fork() * utils/mountd/mountd.c (main): ignore SIGCHLD to prevent leaving zombies behind (from logit()'s fork) * utils/rquotad/rquota_svc.c (main): ditto * utils/statd/statd.c (main): ditto * utils/rquotad/rquota_svc.c (rquotaprog_1): pass RQUOTAPROG to check_default instead of 0, for prognum * utils/statd/statd.c (sm_prog_1_wrapper): pass SM_PROG to check_default instead of 0, for prognum * utils/mountd/mount_dispatch.c: Include "tcpwrapper.h" if HAVE_TCP_WRAPPER is defined. (mount_dispatch): Call check_default () if HAVE_TCP_WRAPPER is defined. Reject an RPC call if check_default () fails.
* 2000-08-25 H.J. Lu <hjl@lucon.org>hjl2000-08-253-0/+455
* support/include/tcpwrapper.h: New for the tcp wrapper support. * support/misc/Makefile: Likewise. * support/misc/from_local.c: Likewise. * support/misc/tcpwrapper.c: Likewise. * aclocal.m4 (AC_TCP_WRAPPER): New. * configure.in: Use it. Substitute LIBWRAP. * configure: Rebuilt. * config.mk.in (LIBNSL): New. (LIBWRAP): Likewise. * support/Makefile (SUBDIRS): Add misc. * support/lib/Makefile (LIBS): Add libmisc.a. * utils/rquotad/Makefile (LIBS): Add -lmisc $(LIBWRAP) $(LIBNSL) * utils/statd/Makefile (LIBS): Likewise. * utils/rquotad/rquota_svc.c: Include "tcpwrapper.h" if HAVE_TCP_WRAPPER is defined. (rquotaprog_1): Call check_default () if HAVE_TCP_WRAPPER is defined. Reject an RPC call if check_default () fails. * utils/statd/statd.c: Include "tcpwrapper.h" if HAVE_TCP_WRAPPER is defined. (sm_prog_1_wrapper): New. A wrapper for sm_prog_1. Call check_default () before calling sm_prog_1 (). Define it as sm_prog_1_wrapper if HAVE_TCP_WRAPPER is defined.