summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libexport.a: Use host helper to parse address in client_init()Chuck Lever2010-08-311-5/+8
| | | | | | | | | | Take the first step towards making it possible to parse either IPv4 or IPv6 addresses in client_init(). It won't handle IPv6 until host_pton() has IPv6 support enabled, and it still doesn't deal with IPv6 netmasks yet. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Prepare to recognize IPv6 addresses in client_gettype()Chuck Lever2010-08-311-9/+14
| | | | | | | | | | | | The current open-coded parsing logic in client_gettype() will be hard to modify to recognize IPv6 addresses. Use a more generic mechanism for detecting IP presentation addresses. IPv6 will be enabled automatically in client_gettype() when host_pton() is changed to support IPv6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Use xlog() for error reportingChuck Lever2010-08-241-27/+29
| | | | | | | | | | | | | | exportfs already invokes xlog_open() because libexport.a uses xlog() exclusively for error reporting and debugging messages. If we can use xlog() throughout exportfs itself, that enables xlog debugging messages everywhere in the code path. In addition, use xlog() instead of fprintf(stderr) for reporting errors in exportfs.c, to be consistent with libexport.a and other components of nfs-utils. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: exportfs.c no longer needs #include "xmalloc.h"Chuck Lever2010-08-241-2/+4
| | | | | | | | Clean up: No calls to xmalloc() or xstrdup() here. No need for the double #include of xmalloc.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: statd fails to monitor if no reverse mapping of mon_name existsChuck Lever2010-08-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | Commit 8ce130c4 switched in the new statd_canonical_name() function that constructs a "unique" name statd can use to uniquely identify a monitor record. The legacy statd would monitor a client that sent an IP address with no reverse map as its caller_name. To remain bug-for-bug compatible, allow this case in the new statd. This shouldn't be a problem: statd_canonical_name() needs to create a unique name for the monitored host so it can keep track of monitor requests from the same remote. The IP address itself should work as well as the host's canonical name, in case there is no reverse mapping. We still enforce the requirement that a mon_name that is a DNS name must have a forward map to an IP address. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport: Fix IP address check in check_netgroup()Chuck Lever2010-08-241-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | Neil Brown reports that recent changes to replace gethostby{addr,name}(3) with get{addr,info}name(3) may have inadvertently broken netgroup support. There used to be a gethostbyaddr(3) call in the third paragraph in check_netgroup(). The reason for that gethostbyaddr(3) call was that the first innetgr(3) call has already confirmed that hname is not a member of the netgroup. We also need to confirm that, if hname happens to be an IP address, the hostname bound to that IP address is not a member of the netgroup, either. Fix this by restoring appropriate address to hostname mapping of hname before retrying the innetgr(3) call. See http://marc.info/?l=linux-nfs&m=128084830214653&w=2 . Introduced by commit 0509d3428f523776ddd9d6e9fa318587d3ec7d84. Reviewed-by: Neil Brown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* bexport: Add a common exit label to check_netgroup()Chuck Lever2010-08-241-7/+16
| | | | | | | | | | check_netgroup() is going to be changed to free dynamically allocated resources before it returns, so a common exit point is needed. Reviewed-by: Neil Brown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix the description of nfsversion mount option in the man nfs pageGuillaume Rousse2010-08-171-8/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove warnings from nfsctl.cSteve Dickson2010-08-091-1/+1
| | | | | | | nfsctl.c: In function 'expsetup': nfsctl.c:112: warning: signed and unsigned type in conditional expression Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from mountd.cSteve Dickson2010-08-091-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mountd.c: In function 'mount_null_1_svc': mountd.c:195: warning: unused parameter 'rqstp' mountd.c:195: warning: unused parameter 'argp' mountd.c:195: warning: unused parameter 'resp' mountd.c: In function 'mount_dump_1_svc': mountd.c:213: warning: unused parameter 'argp' mountd.c: In function 'mount_umnt_1_svc': mountd.c:224: warning: unused parameter 'resp' mountd.c: In function 'mount_umntall_1_svc': mountd.c:248: warning: unused parameter 'argp' mountd.c:248: warning: unused parameter 'resp' mountd.c: In function 'mount_export_1_svc': mountd.c:258: warning: unused parameter 'argp' mountd.c: In function 'mount_exportall_1_svc': mountd.c:269: warning: unused parameter 'argp' mountd.c: In function 'mount_dump_1_svc': mountd.c:216: warning: unused parameter 'argp' mountd.c: In function 'mount_umnt_1_svc': mountd.c:227: warning: unused parameter 'resp' mountd.c: In function 'mount_umntall_1_svc': mountd.c:251: warning: unused parameter 'argp' mountd.c:251: warning: unused parameter 'resp' mountd.c: In function 'mount_export_1_svc': mountd.c:261: warning: unused parameter 'argp' mountd.c: In function 'mount_exportall_1_svc': mountd.c:272: warning: unused parameter 'argp' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from idmapd.cSteve Dickson2010-08-091-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | idmapd.c:120: warning: missing initializer idmapd.c:120: warning: (near initialization for 'nfsd_ic[0].ic_event') idmapd.c:121: warning: missing initializer idmapd.c:121: warning: (near initialization for 'nfsd_ic[1].ic_event') idmapd.c: In function 'flush_nfsd_cache': idmapd.c:173: warning: comparison between signed and unsigned integer expressions idmapd.c: In function 'dirscancb': idmapd.c:384: warning: unused parameter 'fd' idmapd.c:384: warning: unused parameter 'which' idmapd.c: In function 'svrreopen': idmapd.c:468: warning: unused parameter 'fd' idmapd.c:468: warning: unused parameter 'which' idmapd.c:468: warning: unused parameter 'data' idmapd.c: In function 'clntscancb': idmapd.c:474: warning: unused parameter 'fd' idmapd.c:474: warning: unused parameter 'which' idmapd.c: In function 'nfsdcb': idmapd.c:488: warning: unused parameter 'fd' idmapd.c: In function 'nfscb': idmapd.c:663: warning: unused parameter 'fd' idmapd.c: In function 'validateascii': idmapd.c:850: warning: comparison between signed and unsigned integer expressions idmapd.c:858: warning: comparison between signed and unsigned integer expressions idmapd.c: In function 'getfield': idmapd.c:916: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from configfile.cSteve Dickson2010-08-091-2/+4
| | | | | | | configfile.c:195: warning: 'inline' is not at beginning of declaration configfile.c:232: warning: 'inline' is not at beginning of declaration Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from svcgssd_proc.cSteve Dickson2010-08-091-9/+3
| | | | | | | | | svcgssd_proc.c: In function 'send_response': svcgssd_proc.c:135: warning: unused parameter 'f' svcgssd_proc.c: In function 'handle_nullreq': svcgssd_proc.c:434: warning: comparison of unsigned expression < 0 is always false Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from network.cSteve Dickson2010-08-092-1/+5
| | | | | | | network.c: In function 'nfs_verify_family': network.c:1366: warning: unused parameter 'family' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from nfs4mount.cSteve Dickson2010-08-091-1/+1
| | | | | | | nfs4mount.c: In function 'fill_ipv4_sockaddr': nfs4mount.c:149: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from nfsmount.cSteve Dickson2010-08-091-2/+6
| | | | | | | | | | nfsmount.c: In function 'nfsmount': nfsmount.c:513: warning: missing initializer nfsmount.c:513: warning: (near initialization for 'mnt_server.saddr') nfsmount.c:514: warning: missing initializer nfsmount.c:514: warning: (near initialization for 'nfs_server.saddr') Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from svcgssd.cSteve Dickson2010-08-091-1/+1
| | | | | | | svcgssd.c: In function 'sig_hup': svcgssd.c:160: warning: unused parameter 'signal' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from gssd_proc.cSteve Dickson2010-08-091-3/+3
| | | | | | | | | | | | gssd_proc.c: In function 'create_auth_rpc_client': gssd_proc.c:939: warning: comparison between signed and unsigned integer expressions gssd_proc.c:939: warning: comparison between signed and unsigned integer expressions gssd_proc.c: In function 'handle_krb5_upcall': gssd_proc.c:1164: warning: comparison between signed and unsigned integer expressions gssd_proc.c: In function 'handle_spkm3_upcall': gssd_proc.c:1178: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from krb5_util.cSteve Dickson2010-08-093-10/+23
| | | | | | | | | krb5_util.c: In function 'realm_and_service_match': krb5_util.c:617: warning: unused parameter 'context' krb5_util.c: In function 'limit_krb5_enctypes': krb5_util.c:1275: warning: unused parameter 'uid' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from gssd_main_loop.cSteve Dickson2010-08-091-0/+2
| | | | | | | | | gssd_main_loop.c: In function 'dir_notify_handler': gssd_main_loop.c:64: warning: unused parameter 'sig' gssd_main_loop.c:64: warning: unused parameter 'si' gssd_main_loop.c:64: warning: unused parameter 'data' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from gssd.cSteve Dickson2010-08-091-1/+1
| | | | | | | gssd.c: In function 'sig_hup': gssd.c:78: warning: unused parameter 'signal' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from atomicio.cSteve Dickson2010-08-091-1/+2
| | | | | | | atomicio.c: In function 'atomicio': atomicio.c:48: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from nfsstat.cSteve Dickson2010-08-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | nfsstat.c: In function 'print_callstats': nfsstat.c:797: warning: comparison between signed and unsigned integer expressions nfsstat.c:801: warning: comparison between signed and unsigned integer expressions nfsstat.c:802: warning: comparison between signed and unsigned integer expressions nfsstat.c:805: warning: comparison between signed and unsigned integer expressions nfsstat.c: In function 'print_callstats_list': nfsstat.c:821: warning: comparison between signed and unsigned integer expressions nfsstat.c:828: warning: comparison between signed and unsigned integer expressions nfsstat.c: In function 'unpause': nfsstat.c:1111: warning: unused parameter 'sig' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from nfssvc.cSteve Dickson2010-08-091-3/+3
| | | | | | | | | | nfssvc.c:184: warning: comparison between signed and unsigned integer expressions nfssvc.c: In function 'nfssvc_setvers': nfssvc.c:254: warning: comparison between signed and unsigned integer expressions nfssvc.c: In function 'nfssvc_threads': nfssvc.c:280: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from cache.cSteve Dickson2010-08-092-10/+10
| | | | | | | | | | | | | | | | | | cache.c:812: warning: missing initializer cache.c:812: warning: (near initialization for 'cachelist[0].f') cache.c:813: warning: missing initializer cache.c:813: warning: (near initialization for 'cachelist[1].f') cache.c:814: warning: missing initializer cache.c:814: warning: (near initialization for 'cachelist[2].f') cache.c:815: warning: missing initializer cache.c:815: warning: (near initialization for 'cachelist[3].f') cache.c:816: warning: missing initializer cache.c:816: warning: (near initialization for 'cachelist[4].f') cache.c: In function 'cache_export_ent': cache.c:887: warning: comparison between signed and unsigned integer expressions cache.c:907: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from fsloc.cSteve Dickson2010-08-093-3/+3
| | | | | | | fsloc.c: In function 'replicas_lookup': fsloc.c:149: warning: unused parameter 'key' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from conffile.cSteve Dickson2010-08-091-4/+4
| | | | | | | | | | conffile.c: In function 'conf_parse_line': conffile.c:301: warning: comparison between signed and unsigned integer expressions conffile.c: In function 'conf_load_defaults': conffile.c:356: warning: unused parameter 'tr' Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove warnings from nfs_mntent.cSteve Dickson2010-08-091-1/+1
| | | | | | | nfs_mntent.c: In function 'mangle': nfs_mntent.c:36: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* emove warnings from cacheio.cSteve Dickson2010-08-091-1/+1
| | | | | | | cacheio.c: In function 'cache_flush': cacheio.c:352: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove warnings from svc_socket.cSteve Dickson2010-08-093-5/+5
| | | | | | | svc_socket.c: In function 'svcudp_socket': svc_socket.c:160: warning: unused parameter 'reuse' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from rpcdispatch.cSteve Dickson2010-08-091-2/+2
| | | | | | | | | | rpcdispatch.c: In function 'rpc_dispatch': rpcdispatch.c:30: warning: comparison between signed and unsigned integer expressions rpcdispatch.c:35: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Enable extra compile warnings (-Wextra) by default.Steve Dickson2010-08-091-1/+1
| | | | | | | | Added -Wextra to the CFLAGS which enables more checking during compilation, which in turn, will hopefully flag potential problems before they occur. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: picking wrong credsDoug Nazar2010-07-191-0/+7
| | | | | | | | | When not using machine credentials for root, if the machine credential cache file is newer than the root credential file the wrong file will get picked. Ignore the machine file in this case. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Fix memcmp result comparison error for uuid match.Doug Nazar2010-07-191-1/+1
| | | | | | Fixed Small typo in the new fs uuid comparison code Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fix endtime issueDoug Nazar2010-07-192-1/+5
| | | | | | | | | Commit 4c5ff6d4 removed the setting of endtime for a few contexts by accident. Now to figure out why I get stale handles on submounts. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Fix C aliasing rules violation in nfs_getrpccaller()Chuck Lever2010-07-191-2/+2
| | | | | | | | | | | | | | | Squelch compiler warnings reported with -Wextra: In file included from statd.c:24: ../../support/include/rpcmisc.h: In function nfs_getrpccaller_in: ../../support/include/rpcmisc.h:58: warning: dereferencing type-punned pointer might break strict-aliasing rules ../../support/include/rpcmisc.h: In function nfs_getrpccaller: ../../support/include/rpcmisc.h:63: warning: dereferencing type-punned pointer might break strict-aliasing rules Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat.py: divide by zero with fresh mountKevin Constantine2010-06-221-0/+6
| | | | | | | | | | When an export is freshly mounted, /proc/self/mountstats displays age = 0. This causes nfs-iostat.py to divide by zero throwing an error. When we have age = 0, other stats are greater than 0, so we'll set age = 1 and print the relevant stats. Signed-off-by: Kevin Constantine <kevin.constantine@disneyanimation.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Remove unused hostent-based DNS helper functionsChuck Lever2010-06-222-310/+16
| | | | | | | | | | | Clean up: Get rid of hostent-based DNS helper functions in libexport.a that have been replaced by addrinfo-based DNS helpers. None of the original code remains, so replace the copyright notice as well. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Replace matchhostname()Chuck Lever2010-06-222-2/+78
| | | | | | | | | | | | | | | | | So that exportfs can eventually support IPv6 addresses, copy statd's getaddrinfo(3)-based matchhostname to exportfs, with adjustments for dealing with export wildcards and netgroups. Until exportfs has full IPv6 support, however, we want to ensure that IPv6 addresses continue to remain blocked in the address comparison code used by exportfs. At a later point we'll replace much of this with the generic functions in sockaddr.h. Since it contains special logic for handling wildcard and netgroups, this function is specialized for exportfs, and does not belong in one of the shared libraries. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Add documenting commentsChuck Lever2010-06-222-9/+39
| | | | | | | | Clean up. Add a few additional documenting comments for globally visible functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Make export_add() staticChuck Lever2010-06-222-5/+2
| | | | | | | | Clean up: export_add() is not called from outside of export.c, so make it a static helper. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Make export_read() return voidChuck Lever2010-06-222-3/+7
| | | | | | | | Clean up: export_read()'s return value is always zero, and its only caller never checks it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Replace "struct hostent" with "struct addrinfo"Chuck Lever2010-06-228-212/+257
| | | | | | | | | | | | | | | | | | | struct hostent can store either IPv4 or IPv6 addresses, but it can't store both address families concurrently for the same host. Neither can hostent deal with parts of socket addresses that are outside of the sin{,6}_addr field. Replace the use of "struct hostent" everywhere in libexport.a, mountd, and exportfs with "struct addrinfo". This is a large change, but there are so many strong dependencies on struct hostent that this can't easily be broken into smaller pieces. One benefit of this change is that hostent_dup() is no longer required, since the results of getaddrinfo(3) are already dynamically allocated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Add a common exit label in exportfs()Chuck Lever2010-06-221-8/+6
| | | | | | | | | Clean up: Reduce code duplication by introducing a goto label for freeing hp and exiting. This will make replacing "struct hostent *" with "struct addrinfo *" more straightforward in this code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Add helpers to manage DNS lookupsChuck Lever2010-06-226-16/+382
| | | | | | | | | | | | | | | Introduce DNS query helpers based on getaddrinfo(3) and getnameinfo(3). These will eventually replace the existing hostent-based functions in support/export/hostname.c. Put some of these new helpers to immediate use, where convenient. As they are part of libexport.a, I've added the forward declarations for these new functions in exportfs.h rather than misc.h, where the hostent-based forward declarations are currently. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Improve support for exporting btrfs subvolumesNeilBrown2010-06-221-29/+78
| | | | | | | | | | | | | | | | | | | If you export two subvolumes of a btrfs filesystem, they will both be given the same uuid so lookups will be confused. blkid cannot differentiate the two, so we must use the fsid from statfs64 to identify the filesystem. We cannot tell if blkid or statfs is best without knowing internal details of the filesystem in question, so we need to encode specific knowledge of btrfs in mountd. This is unfortunate. To ensure smooth handling of this and possible future changes in uuid generation, we add infrastructure for multiple different uuids to be recognised on old filehandles, but only the preferred on is used on new filehandles. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: silently fails when the network protocol is not foundSteve Dickson2010-06-222-8/+27
| | | | | | | mount.nfs should display some type of error diagnostics when the network protocol can not be determined. Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: silently fails when bad option values are givenSteve Dickson2010-06-222-5/+19
| | | | | | | | mount.nfs should not only fail when an invalid option values are supplied (as it does), it should also print a diagnostic message identifying the problem Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat.man: Add linebreak before --version optionKevin Constantine2010-06-021-0/+1
| | | | | | | The nfsiostat man file was missing a linebreak before the --verbose option Signed-off-by: Kevin Constantine <kevin.constantine@disneyanimation.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Convert colons in IPv6 presentation addresses tosemicolonsChuck Lever2010-05-241-3/+39
| | | | | | | | | | | | | | The /var/lib/nfs/rmtab file delineates fields in each of its lines with a ":". The first field contains the IP address of a client, in presentation format. IPv6 presentation format addresses contain colons, which screws up the field delineation of rmtab. Use a simple simple scheme to convert the colons in incoming client names to some other character, and then convert them back when the rmtab file is read. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>