]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Merge branch 'upstream'
authorBen Hutchings <ben@decadent.org.uk>
Wed, 14 Jul 2010 02:04:25 +0000 (03:04 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 14 Jul 2010 02:04:25 +0000 (03:04 +0100)
Conflicts:
Makefile.in
aclocal.m4
configure
linux-nfs/Makefile.in
support/Makefile.in
support/export/Makefile.in
support/include/Makefile.in
support/include/config.h.in
support/include/nfs/Makefile.in
support/include/rpcsvc/Makefile.in
support/include/sys/Makefile.in
support/include/sys/fs/Makefile.in
support/misc/Makefile.in
support/nfs/Makefile.in
tools/Makefile.in
tools/locktest/Makefile.in
tools/nlmtest/Makefile.in
tools/rpcdebug/Makefile.in
tools/rpcgen/Makefile.in
utils/Makefile.in
utils/exportfs/Makefile.in
utils/gssd/Makefile.in
utils/idmapd/Makefile.in
utils/mount/Makefile.in
utils/mountd/Makefile.in
utils/nfsd/Makefile.in
utils/nfsstat/Makefile.in
utils/showmount/Makefile.in
utils/statd/Makefile.in

68 files changed:
Makefile.am
Makefile.in
aclocal.m4
aclocal/ipv6.m4 [new file with mode: 0644]
aclocal/libevent.m4 [new file with mode: 0644]
aclocal/libnfsidmap.m4 [new file with mode: 0644]
aclocal/librpcsecgss.m4 [new file with mode: 0644]
aclocal/libtirpc.m4 [new file with mode: 0644]
aclocal/rpcsec_vers.m4 [new file with mode: 0644]
configure
configure.ac
linux-nfs/Makefile.in
support/Makefile.in
support/export/Makefile.in
support/export/rmtab.c
support/export/xtab.c
support/include/Makefile.in
support/include/config.h.in
support/include/nfs/Makefile.in
support/include/nfslib.h
support/include/nfsrpc.h
support/include/rpcsvc/Makefile.in
support/include/sys/Makefile.in
support/include/sys/fs/Makefile.in
support/misc/Makefile.in
support/misc/tcpwrapper.c
support/nfs/Makefile.in
support/nfs/cacheio.c
support/nfs/getport.c
support/nfs/rpc_socket.c
support/nfs/xio.c
tools/Makefile.in
tools/locktest/Makefile.in
tools/locktest/testlk.c
tools/nlmtest/Makefile.in
tools/rpcdebug/Makefile.in
tools/rpcgen/Makefile.in
utils/Makefile.in
utils/exportfs/Makefile.in
utils/gssd/Makefile.am
utils/gssd/Makefile.in
utils/gssd/context_heimdal.c
utils/gssd/context_lucid.c
utils/gssd/gssd.h
utils/gssd/gssd_proc.c
utils/gssd/krb5_util.c
utils/gssd/krb5_util.h
utils/gssd/svcgssd.c
utils/gssd/svcgssd_proc.c
utils/idmapd/Makefile.in
utils/idmapd/idmapd.c
utils/mount/Makefile.in
utils/mount/fstab.c
utils/mount/network.c
utils/mountd/Makefile.in
utils/mountd/mountd.c
utils/mountd/rmtab.c
utils/mountd/svc_run.c
utils/nfsd/Makefile.in
utils/nfsd/nfsd.c
utils/nfsstat/Makefile.in
utils/nfsstat/nfsstat.c
utils/nfsstat/nfsstat.man
utils/showmount/Makefile.in
utils/statd/Makefile.in
utils/statd/monitor.c
utils/statd/sm-notify.c
utils/statd/statd.c

index 88ae210b787af6e9c1edc751c59ff46864f3bb16..b3a6e912b6575ae5f51f252496978ad461c658f3 100644 (file)
@@ -40,7 +40,12 @@ EXTRA_DIST = \
        aclocal/bsdsignals.m4 \
        aclocal/nfs-utils.m4 \
        aclocal/kerberos5.m4 \
-       aclocal/tcp-wrappers.m4
+       aclocal/tcp-wrappers.m4 \
+       aclocal/libtirpc.m4 \
+       aclocal/libevent.m4 \
+       aclocal/libnfsidmap.m4 \
+       aclocal/rpcsec_vers.m4 \
+       aclocal/ipv6.m4
 
 ACLOCAL_AMFLAGS = -I aclocal
 
index 8f409cc632bfef1df57985b82b7e41d8e18fe425..5247be1a18f8e2d2738482bca5b1cf7730205d20 100644 (file)
@@ -38,9 +38,15 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
        install-sh ltmain.sh missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -80,6 +86,7 @@ ACLOCAL_AMFLAGS = -I aclocal
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -192,7 +199,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -263,7 +269,12 @@ EXTRA_DIST = \
        aclocal/bsdsignals.m4 \
        aclocal/nfs-utils.m4 \
        aclocal/kerberos5.m4 \
-       aclocal/tcp-wrappers.m4
+       aclocal/tcp-wrappers.m4 \
+       aclocal/libtirpc.m4 \
+       aclocal/libevent.m4 \
+       aclocal/libnfsidmap.m4 \
+       aclocal/rpcsec_vers.m4 \
+       aclocal/ipv6.m4
 
 all: all-recursive
 
index 15a8cedd38facbc8468aec3130d6eb23f12e7844..2768b17ce4e9cd7087fab119d6f76b9d38c316b7 100644 (file)
@@ -7725,7 +7725,13 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([aclocal/bsdsignals.m4])
+m4_include([aclocal/ipv6.m4])
 m4_include([aclocal/kerberos5.m4])
 m4_include([aclocal/libblkid.m4])
+m4_include([aclocal/libevent.m4])
+m4_include([aclocal/libnfsidmap.m4])
+m4_include([aclocal/librpcsecgss.m4])
+m4_include([aclocal/libtirpc.m4])
 m4_include([aclocal/nfs-utils.m4])
+m4_include([aclocal/rpcsec_vers.m4])
 m4_include([aclocal/tcp-wrappers.m4])
diff --git a/aclocal/ipv6.m4 b/aclocal/ipv6.m4
new file mode 100644 (file)
index 0000000..ba9dcc2
--- /dev/null
@@ -0,0 +1,29 @@
+dnl Checks for IPv6 support
+dnl
+AC_DEFUN([AC_IPV6], [
+
+  AC_CHECK_DECL([AI_ADDRCONFIG],
+                [AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
+                           [Define this to 1 if AI_ADDRCONFIG macro is defined])], ,
+                [ #include <netdb.h> ])
+
+  if test "$enable_ipv6" = yes; then
+
+    dnl TI-RPC required for IPv6
+    if test "$enable_tirpc" = no; then
+      AC_MSG_ERROR(['--enable-ipv6' requires '--enable-tirpc'.])
+    fi
+
+    dnl IPv6-enabled networking functions required for IPv6
+    AC_CHECK_FUNCS([getnameinfo bindresvport_sa], ,
+                   [AC_MSG_ERROR([Missing functions needed for IPv6.])])
+
+    dnl Need to detect presence of IPv6 networking at run time via
+    dnl getaddrinfo(3); old versions of glibc do not support ADDRCONFIG
+    AC_CHECK_DECL([AI_ADDRCONFIG], ,
+                  [AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support])],
+                  [ #include <netdb.h> ])
+
+  fi
+
+])dnl
diff --git a/aclocal/libevent.m4 b/aclocal/libevent.m4
new file mode 100644 (file)
index 0000000..3c962b3
--- /dev/null
@@ -0,0 +1,11 @@
+dnl Checks for libevent
+AC_DEFUN([AC_LIBEVENT], [
+
+  dnl Check for libevent, but do not add -levent to LIBS
+  AC_CHECK_LIB([event], [event_dispatch], [libevent=1],
+               [AC_MSG_ERROR([libevent not found.])])
+
+  AC_CHECK_HEADERS([event.h], ,
+                   [AC_MSG_ERROR([libevent headers not found.])])
+
+])dnl
diff --git a/aclocal/libnfsidmap.m4 b/aclocal/libnfsidmap.m4
new file mode 100644 (file)
index 0000000..cfcde2f
--- /dev/null
@@ -0,0 +1,17 @@
+dnl Checks for libnfsidmap
+dnl
+AC_DEFUN([AC_LIBNFSIDMAP], [
+
+  dnl Check for libnfsidmap, but do not add -lnfsidmap to LIBS
+  AC_CHECK_LIB([nfsidmap], [nfs4_init_name_mapping], [libnfsidmap=1],
+               [AC_MSG_ERROR([libnfsidmap not found.])])
+
+  AC_CHECK_HEADERS([nfsidmap.h], ,
+                   [AC_MSG_ERROR([libnfsidmap headers not found.])])
+
+  dnl nfs4_set_debug() doesn't appear in all versions of libnfsidmap
+  AC_CHECK_LIB([nfsidmap], [nfs4_set_debug],
+               [AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1,
+                          [Define to 1 if you have the `nfs4_set_debug' function.])])
+
+])dnl
diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
new file mode 100644 (file)
index 0000000..d1dd25e
--- /dev/null
@@ -0,0 +1,19 @@
+dnl Checks for rpcsecgss library and headers
+dnl KRB5LIBS must be set before this function is invoked.
+dnl
+AC_DEFUN([AC_LIBRPCSECGSS], [
+
+  dnl libtirpc provides an rpcsecgss API
+  if test "$enable_tirpc" = no; then
+
+    dnl Check for library, but do not add -lrpcsecgss to LIBS
+    AC_CHECK_LIB([rpcsecgss], [authgss_create_default], [librpcsecgss=1],
+                 [AC_MSG_ERROR([librpcsecgss not found.])])
+
+    AC_CHECK_LIB([rpcsecgss], [authgss_set_debug_level],
+                 [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
+                 [Define to 1 if you have the `authgss_set_debug_level' function.])])
+
+  fi
+
+])dnl
diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
new file mode 100644 (file)
index 0000000..af4c7d3
--- /dev/null
@@ -0,0 +1,28 @@
+dnl Checks for TI-RPC library and headers
+dnl
+AC_DEFUN([AC_LIBTIRPC], [
+
+  AC_ARG_WITH([tirpcinclude],
+              [AC_HELP_STRING([--with-tirpcinclude=DIR],
+                              [use TI-RPC headers in DIR])],
+              [tirpc_header_dir=$withval],
+              [tirpc_header_dir=/usr/include/tirpc])
+
+  dnl if --enable-tirpc was specifed, the following components
+  dnl must be present, and we set up HAVE_ macros for them.
+
+  if test "$enable_tirpc" = yes; then
+
+    dnl look for the library; add to LIBS if found
+    AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
+                 [AC_MSG_ERROR([libtirpc not found.])])
+
+    dnl also must have the headers installed where we expect
+    dnl look for headers; add -I compiler option if found
+    AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h], ,
+                     [AC_MSG_ERROR([libtirpc headers not found.])])
+    AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])
+
+  fi
+
+])dnl
diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
new file mode 100644 (file)
index 0000000..25902ca
--- /dev/null
@@ -0,0 +1,11 @@
+dnl Checks librpcsec version
+AC_DEFUN([AC_RPCSEC_VERSION], [
+
+  PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
+
+  dnl TI-RPC replaces librpcsecgss
+  if test "$enable_tirpc" = no; then
+    PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.16])
+  fi
+
+])dnl
index a673f3470b5f9fc649aee79cc559a66655c7e5af..a00a6f99f074771b81d32ccb3db8b8c1b0d36da0 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for linux nfs-utils 1.1.5.
+# Generated by GNU Autoconf 2.63 for linux nfs-utils 1.1.6.
 #
 # Report bugs to <linux-nfs@vger.kernel.org>.
 #
@@ -750,12 +750,11 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='linux nfs-utils'
 PACKAGE_TARNAME='nfs-utils'
-PACKAGE_VERSION='1.1.5'
-PACKAGE_STRING='linux nfs-utils 1.1.5'
+PACKAGE_VERSION='1.1.6'
+PACKAGE_STRING='linux nfs-utils 1.1.6'
 PACKAGE_BUGREPORT='linux-nfs@vger.kernel.org'
 
 ac_default_prefix=/usr
-ac_unique_file="support/include/config.h.in"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -792,6 +791,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
+ac_unique_file="support/include/config.h.in"
 ac_subst_vars='LTLIBOBJS
 ACLOCAL_AMFLAGS
 AM_CFLAGS
@@ -810,10 +810,10 @@ LIBBLKID
 LIBBSD
 LIBCRYPT
 LIBSOCKET
-GSSGLUE_LIBS
-GSSGLUE_CFLAGS
 RPCSECGSS_LIBS
 RPCSECGSS_CFLAGS
+GSSGLUE_LIBS
+GSSGLUE_CFLAGS
 PKG_CONFIG
 LIBNSL
 LD
@@ -828,11 +828,8 @@ DSYMUTIL
 RANLIB
 AR
 ECHO
-EGREP
-GREP
 SED
 LN_S
-CPP
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
@@ -842,6 +839,10 @@ CXX
 HAVE_TCP_WRAPPER
 HAVE_LIBWRAP
 LIBWRAP
+AM_CPPFLAGS
+EGREP
+GREP
+CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -858,9 +859,6 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
-CONFIG_TIRPC_FALSE
-CONFIG_TIRPC_TRUE
-enable_tirpc
 CONFIG_IPV6_FALSE
 CONFIG_IPV6_TRUE
 enable_ipv6
@@ -970,10 +968,11 @@ enable_kprefix
 with_rpcgen
 enable_uuid
 enable_mount
-enable_ipv6
 enable_tirpc
-with_tcp_wrappers
+enable_ipv6
+with_tirpcinclude
 enable_dependency_tracking
+with_tcp_wrappers
 enable_largefile
 enable_shared
 enable_static
@@ -992,18 +991,18 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
+CPP
 CXX
 CXXFLAGS
 CCC
-CPP
 CXXCPP
 F77
 FFLAGS
 PKG_CONFIG
-RPCSECGSS_CFLAGS
-RPCSECGSS_LIBS
 GSSGLUE_CFLAGS
-GSSGLUE_LIBS'
+GSSGLUE_LIBS
+RPCSECGSS_CFLAGS
+RPCSECGSS_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1556,7 +1555,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures linux nfs-utils 1.1.5 to adapt to many kinds of systems.
+\`configure' configures linux nfs-utils 1.1.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1626,7 +1625,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of linux nfs-utils 1.1.5:";;
+     short | recursive ) echo "Configuration of linux nfs-utils 1.1.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1643,8 +1642,8 @@ Optional Features:
   --disable-uuid          Exclude uuid support to avoid buggy libblkid
   --enable-mount          Create mount.nfs and don't use the util-linux
                           mount(8) functionality. [default=yes]
-  --enable-ipv6           enable support for IPv6 [default=no]
   --enable-tirpc          enable use of TI-RPC [default=no]
+  --enable-ipv6           enable support for IPv6 [default=no]
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
   --disable-largefile     omit support for large files
@@ -1665,6 +1664,7 @@ Optional Packages:
                           When an nfs filesystems is mounted with locking, run
                           this script
   --with-rpcgen=internal  use internal rpcgen instead of system one
+  --with-tirpcinclude=DIR use TI-RPC headers in DIR
   --with-tcp-wrappers[=PATH]      Enable tcpwrappers support
                  (optionally in PATH)
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -1681,21 +1681,21 @@ Some influential environment variables:
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
-  CPP         C preprocessor
   CXXCPP      C++ preprocessor
   F77         Fortran 77 compiler command
   FFLAGS      Fortran 77 compiler flags
   PKG_CONFIG  path to pkg-config utility
-  RPCSECGSS_CFLAGS
-              C compiler flags for RPCSECGSS, overriding pkg-config
-  RPCSECGSS_LIBS
-              linker flags for RPCSECGSS, overriding pkg-config
   GSSGLUE_CFLAGS
               C compiler flags for GSSGLUE, overriding pkg-config
   GSSGLUE_LIBS
               linker flags for GSSGLUE, overriding pkg-config
+  RPCSECGSS_CFLAGS
+              C compiler flags for RPCSECGSS, overriding pkg-config
+  RPCSECGSS_LIBS
+              linker flags for RPCSECGSS, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1763,7 +1763,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-linux nfs-utils configure 1.1.5
+linux nfs-utils configure 1.1.6
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1777,7 +1777,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by linux nfs-utils $as_me 1.1.5, which was
+It was created by linux nfs-utils $as_me 1.1.6, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2577,7 +2577,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nfs-utils'
- VERSION='1.1.5'
+ VERSION='1.1.6'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2924,6 +2924,13 @@ else
   CONFIG_MOUNT_FALSE=
 fi
 
+# Check whether --enable-tirpc was given.
+if test "${enable_tirpc+set}" = set; then
+  enableval=$enable_tirpc; enable_tirpc=$enableval
+else
+  enable_tirpc=no
+fi
+
 # Check whether --enable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
   enableval=$enable_ipv6; enable_ipv6=$enableval
@@ -2950,24 +2957,6 @@ else
 fi
 
 
-# Check whether --enable-tirpc was given.
-if test "${enable_tirpc+set}" = set; then
-  enableval=$enable_tirpc; enable_tirpc=$enableval
-else
-  enable_tirpc=no
-fi
-
-
-        if test "$enable_tirpc" = "yes"; then
-  CONFIG_TIRPC_TRUE=
-  CONFIG_TIRPC_FALSE='#'
-else
-  CONFIG_TIRPC_TRUE='#'
-  CONFIG_TIRPC_FALSE=
-fi
-
-
-# Check whether user wants TCP wrappers support
 DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
 
 
-
-  TCPW_MSG="no"
-
-# Check whether --with-tcp-wrappers was given.
-if test "${with_tcp_wrappers+set}" = set; then
-  withval=$with_tcp_wrappers; with_tcpw=$withval
-else
-  with_tcpw=yes
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
 fi
-
-        if test "x$with_tcpw" != "xno" ; then
-            saved_LIBS="$LIBS"
-            saved_LDFLAGS="$LDFLAGS"
-            saved_CPPFLAGS="$CPPFLAGS"
-            if test -n "${with_tcpw}" -a "${with_tcpw}" != "yes"; then
-                if test -d "${with_tcpw}/lib"; then
-                    if test -n "${need_dash_r}"; then
-                        LDFLAGS="-L${with_tcpw}/lib -R${with_tcpw}/lib ${LDFLAGS}"
-                    else
-                        LDFLAGS="-L${with_tcpw}/lib ${LDFLAGS}"
-                    fi
-                else
-                    if test -n "${need_dash_r}"; then
-                        LDFLAGS="-L${with_tcpw} -R${with_tcpw} ${LDFLAGS}"
-                    else
-                        LDFLAGS="-L${with_tcpw} ${LDFLAGS}"
-                    fi
-                fi
-                if test -d "${with_tcpw}/include"; then
-                    CPPFLAGS="-I${with_tcpw}/include ${CPPFLAGS}"
-                else
-                    CPPFLAGS="-I${with_tcpw} ${CPPFLAGS}"
-                fi
-            fi
-            LIBWRAP="-lwrap"
-            LIBS="$LIBWRAP $LIBS"
-            { $as_echo "$as_me:$LINENO: checking for libwrap" >&5
-$as_echo_n "checking for libwrap... " >&6; }
-            cat >conftest.$ac_ext <<_ACEOF
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-                #include <tcpd.h>
-                int deny_severity = 0, allow_severity = 0;
-
-int
-main ()
-{
-hosts_access(0);
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
        }; then
-
-                { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<\_ACEOF
-#define LIBWRAP 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBWRAP 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TCP_WRAPPER 1
-_ACEOF
-
-                TCPW_MSG="yes"
-
+  :
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
-                { { $as_echo "$as_me:$LINENO: error: *** libwrap missing" >&5
-$as_echo "$as_me: error: *** libwrap missing" >&2;}
-   { (exit 1); exit 1; }; }
-
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-            LIBS="$saved_LIBS"
-        fi
-
-
-
-
-
-# Arrange for large-file support
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then
-  enableval=$enable_largefile;
+  # Broken: fails on valid input.
+continue
 fi
 
-if test "$enable_largefile" != no; then
+rm -f conftest.err conftest.$ac_ext
 
-  { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-        # IRIX 6.2 and later do not support large files by default,
-        # so use the C compiler's -n32 option if that helps.
-        cat >conftest.$ac_ext <<_ACEOF
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#include <ac_nonexistent.h>
 _ACEOF
-        rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  break
+       }; then
+  # Broken: success on invalid input.
+continue
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
 
-rm -f core conftest.err conftest.$ac_objext
-        CC="$CC -n32"
-        rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_sys_largefile_CC=' -n32'; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
+    done
+    ac_cv_prog_CPP=$CPP
 
-rm -f core conftest.err conftest.$ac_objext
-        break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
-
-  { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  CPP=$ac_cv_prog_CPP
 else
-  while :; do
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_sys_file_offset_bits=no; break
+       }; then
+  :
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+  # Broken: fails on valid input.
+continue
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#include <ac_nonexistent.h>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_sys_file_offset_bits=64; break
+       }; then
+  # Broken: success on invalid input.
+continue
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_cv_sys_file_offset_bits=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
-  if test $ac_cv_sys_file_offset_bits = unknown; then
-    { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
+rm -f conftest.err conftest.$ac_ext
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_sys_large_files=no; break
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Check whether --with-tirpcinclude was given.
+if test "${with_tirpcinclude+set}" = set; then
+  withval=$with_tirpcinclude; tirpc_header_dir=$withval
+else
+  tirpc_header_dir=/usr/include/tirpc
+fi
+
+
+
+  if test "$enable_tirpc" = yes; then
+
+
+{ $as_echo "$as_me:$LINENO: checking for clnt_tli_create in -ltirpc" >&5
+$as_echo_n "checking for clnt_tli_create in -ltirpc... " >&6; }
+if test "${ac_cv_lib_tirpc_clnt_tli_create+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltirpc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clnt_tli_create ();
+int
+main ()
+{
+return clnt_tli_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_tirpc_clnt_tli_create=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_tirpc_clnt_tli_create=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tirpc_clnt_tli_create" >&5
+$as_echo "$ac_cv_lib_tirpc_clnt_tli_create" >&6; }
+if test "x$ac_cv_lib_tirpc_clnt_tli_create" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIRPC 1
+_ACEOF
+
+  LIBS="-ltirpc $LIBS"
+
+else
+  { { $as_echo "$as_me:$LINENO: error: libtirpc not found." >&5
+$as_echo "$as_me: error: libtirpc not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+for ac_header in ${tirpc_header_dir}/netconfig.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------- ##
+## Report this to linux-nfs@vger.kernel.org ##
+## ---------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:$LINENO: error: libtirpc headers not found." >&5
+$as_echo "$as_me: error: libtirpc headers not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+    AM_CPPFLAGS="-I${tirpc_header_dir}"
+
+
+  fi
+
+
+
+# Check whether user wants TCP wrappers support
+
+  TCPW_MSG="no"
+
+# Check whether --with-tcp-wrappers was given.
+if test "${with_tcp_wrappers+set}" = set; then
+  withval=$with_tcp_wrappers; with_tcpw=$withval
+else
+  with_tcpw=yes
+fi
+
+        if test "x$with_tcpw" != "xno" ; then
+            saved_LIBS="$LIBS"
+            saved_LDFLAGS="$LDFLAGS"
+            saved_CPPFLAGS="$CPPFLAGS"
+            if test -n "${with_tcpw}" -a "${with_tcpw}" != "yes"; then
+                if test -d "${with_tcpw}/lib"; then
+                    if test -n "${need_dash_r}"; then
+                        LDFLAGS="-L${with_tcpw}/lib -R${with_tcpw}/lib ${LDFLAGS}"
+                    else
+                        LDFLAGS="-L${with_tcpw}/lib ${LDFLAGS}"
+                    fi
+                else
+                    if test -n "${need_dash_r}"; then
+                        LDFLAGS="-L${with_tcpw} -R${with_tcpw} ${LDFLAGS}"
+                    else
+                        LDFLAGS="-L${with_tcpw} ${LDFLAGS}"
+                    fi
+                fi
+                if test -d "${with_tcpw}/include"; then
+                    CPPFLAGS="-I${with_tcpw}/include ${CPPFLAGS}"
+                else
+                    CPPFLAGS="-I${with_tcpw} ${CPPFLAGS}"
+                fi
+            fi
+            LIBWRAP="-lwrap"
+            LIBS="$LIBWRAP $LIBS"
+            { $as_echo "$as_me:$LINENO: checking for libwrap" >&5
+$as_echo_n "checking for libwrap... " >&6; }
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                #include <tcpd.h>
+                int deny_severity = 0, allow_severity = 0;
+
+int
+main ()
+{
+hosts_access(0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+
+                { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+cat >>confdefs.h <<\_ACEOF
+#define LIBWRAP 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBWRAP 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TCP_WRAPPER 1
+_ACEOF
+
+                TCPW_MSG="yes"
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+                { { $as_echo "$as_me:$LINENO: error: *** libwrap missing" >&5
+$as_echo "$as_me: error: *** libwrap missing" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+            LIBS="$saved_LIBS"
+        fi
+
+
+
+
+
+# Arrange for large-file support
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_largefile_CC=' -n32'; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=no; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=64; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=no; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6328,140 +7196,6 @@ SED=$lt_cv_path_SED
 { $as_echo "$as_me:$LINENO: result: $SED" >&5
 $as_echo "$SED" >&6; }
 
-{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
@@ -6882,7 +7616,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6885 "configure"' > conftest.$ac_ext
+  echo '#line 7619 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -6942,128 +7676,28 @@ s390*-*linux*|sparc*-*linux*)
           LD="${LD-ld} -m elf_s390"
           ;;
         sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      libsuff=64
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_x86_64_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  lt_cv_cc_needs_belf=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       lt_cv_cc_needs_belf=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
     *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-         LD="${LD-ld} -64"
-       fi
-       ;;
+      libsuff=64
+      case $host in
+        x86_64-*kfreebsd*-gnu)
+          LD="${LD-ld} -m elf_x86_64_fbsd"
+          ;;
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
       esac
       ;;
     esac
@@ -7071,28 +7705,27 @@ sparc*-*solaris*)
   rm -rf conftest*
   ;;
 
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
 int
 main ()
@@ -7102,15 +7735,15 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7119,214 +7752,63 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_stdc=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  lt_cv_cc_needs_belf=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
+       lt_cv_cc_needs_belf=no
 fi
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
 rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-       eval "$as_ac_Header=no"
 fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
+esac
 
-done
+need_locks="$enable_libtool_lock"
 
 
 
@@ -9252,11 +9734,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9255: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9737: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9259: \$? = $ac_status" >&5
+   echo "$as_me:9741: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9542,11 +10024,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9545: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10027: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9549: \$? = $ac_status" >&5
+   echo "$as_me:10031: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9646,11 +10128,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9649: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10131: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9653: \$? = $ac_status" >&5
+   echo "$as_me:10135: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12048,7 +12530,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12051 "configure"
+#line 12533 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12148,7 +12630,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12151 "configure"
+#line 12633 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14557,11 +15039,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14560: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15042: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14564: \$? = $ac_status" >&5
+   echo "$as_me:15046: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14661,11 +15143,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14664: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15146: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14668: \$? = $ac_status" >&5
+   echo "$as_me:15150: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16246,11 +16728,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16249: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16731: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16253: \$? = $ac_status" >&5
+   echo "$as_me:16735: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16350,11 +16832,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16353: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16835: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16357: \$? = $ac_status" >&5
+   echo "$as_me:16839: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18567,11 +19049,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18570: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19052: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18574: \$? = $ac_status" >&5
+   echo "$as_me:19056: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18857,11 +19339,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18860: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19342: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18864: \$? = $ac_status" >&5
+   echo "$as_me:19346: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18961,11 +19443,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18964: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19446: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18968: \$? = $ac_status" >&5
+   echo "$as_me:19450: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -22297,6 +22779,7 @@ _ACEOF
 
 
 
+
 { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
 $as_echo_n "checking for gethostbyname... " >&6; }
 if test "${ac_cv_func_gethostbyname+set}" = set; then
@@ -22707,6 +23190,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
 $as_echo "$ac_cv_func_getaddrinfo" >&6; }
+if test "x$ac_cv_func_getaddrinfo" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: Function 'getaddrinfo' not found." >&5
+$as_echo "$as_me: error: Function 'getaddrinfo' not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
 { $as_echo "$as_me:$LINENO: checking for getrpcbynumber" >&5
@@ -22794,6 +23284,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getrpcbynumber" >&5
 $as_echo "$ac_cv_func_getrpcbynumber" >&6; }
+if test "x$ac_cv_func_getrpcbynumber" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: Function 'getrpcbynumber' not found." >&5
+$as_echo "$as_me: error: Function 'getrpcbynumber' not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
 { $as_echo "$as_me:$LINENO: checking for getservbyname" >&5
@@ -22881,6 +23378,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getservbyname" >&5
 $as_echo "$ac_cv_func_getservbyname" >&6; }
+if test "x$ac_cv_func_getservbyname" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: Function 'getservbyname' not found." >&5
+$as_echo "$as_me: error: Function 'getservbyname' not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
 { $as_echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
@@ -22952,7 +23456,10 @@ if test "x$ac_cv_lib_crypt_crypt" = x""yes; then
   LIBCRYPT="-lcrypt"
 fi
 
+
 if test "$enable_nfsv4" = yes; then
+
+
     { $as_echo "$as_me:$LINENO: checking for event_dispatch in -levent" >&5
 $as_echo_n "checking for event_dispatch in -levent... " >&6; }
 if test "${ac_cv_lib_event_event_dispatch+set}" = set; then
@@ -23021,83 +23528,11 @@ $as_echo "$ac_cv_lib_event_event_dispatch" >&6; }
 if test "x$ac_cv_lib_event_event_dispatch" = x""yes; then
   libevent=1
 else
-  { { $as_echo "$as_me:$LINENO: error: libevent needed for nfsv4 support" >&5
-$as_echo "$as_me: error: libevent needed for nfsv4 support" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: libevent not found." >&5
+$as_echo "$as_me: error: libevent not found." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-    { $as_echo "$as_me:$LINENO: checking for nfs4_init_name_mapping in -lnfsidmap" >&5
-$as_echo_n "checking for nfs4_init_name_mapping in -lnfsidmap... " >&6; }
-if test "${ac_cv_lib_nfsidmap_nfs4_init_name_mapping+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnfsidmap  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char nfs4_init_name_mapping ();
-int
-main ()
-{
-return nfs4_init_name_mapping ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_nfsidmap_nfs4_init_name_mapping=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&5
-$as_echo "$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&6; }
-if test "x$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" = x""yes; then
-  libnfsidmap=1
-else
-  { { $as_echo "$as_me:$LINENO: error: libnfsidmap needed for nfsv4 support" >&5
-$as_echo "$as_me: error: libnfsidmap needed for nfsv4 support" >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 
 for ac_header in event.h
@@ -23189,70 +23624,149 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ---------------------------------------- ##
-## Report this to linux-nfs@vger.kernel.org ##
-## ---------------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------- ##
+## Report this to linux-nfs@vger.kernel.org ##
+## ---------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:$LINENO: error: libevent headers not found." >&5
+$as_echo "$as_me: error: libevent headers not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for nfs4_init_name_mapping in -lnfsidmap" >&5
+$as_echo_n "checking for nfs4_init_name_mapping in -lnfsidmap... " >&6; }
+if test "${ac_cv_lib_nfsidmap_nfs4_init_name_mapping+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnfsidmap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nfs4_init_name_mapping ();
+int
+main ()
+{
+return nfs4_init_name_mapping ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_nfsidmap_nfs4_init_name_mapping=no
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&5
+$as_echo "$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&6; }
+if test "x$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" = x""yes; then
+  libnfsidmap=1
 else
-  { { $as_echo "$as_me:$LINENO: error: libevent needed for nfsv4 support" >&5
-$as_echo "$as_me: error: libevent needed for nfsv4 support" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: libnfsidmap not found." >&5
+$as_echo "$as_me: error: libnfsidmap not found." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-done
 
 
 for ac_header in nfsidmap.h
@@ -23402,14 +23916,91 @@ as_val=`eval 'as_val=${'$as_ac_Header'}
 _ACEOF
 
 else
-  { { $as_echo "$as_me:$LINENO: error: libnfsidmap needed for nfsv4 support" >&5
-$as_echo "$as_me: error: libnfsidmap needed for nfsv4 support" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: libnfsidmap headers not found." >&5
+$as_echo "$as_me: error: libnfsidmap headers not found." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 done
 
-            if test "$enable_gss" = yes; then
+
+    { $as_echo "$as_me:$LINENO: checking for nfs4_set_debug in -lnfsidmap" >&5
+$as_echo_n "checking for nfs4_set_debug in -lnfsidmap... " >&6; }
+if test "${ac_cv_lib_nfsidmap_nfs4_set_debug+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnfsidmap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nfs4_set_debug ();
+int
+main ()
+{
+return nfs4_set_debug ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nfsidmap_nfs4_set_debug=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_nfsidmap_nfs4_set_debug=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_set_debug" >&5
+$as_echo "$ac_cv_lib_nfsidmap_nfs4_set_debug" >&6; }
+if test "x$ac_cv_lib_nfsidmap_nfs4_set_debug" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NFS4_SET_DEBUG 1
+_ACEOF
+
+fi
+
+
+
+
+      if test "$enable_gss" = yes; then
 
 
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
@@ -23527,36 +24118,38 @@ $as_echo "no" >&6; }
 
 fi
 
+
+
 pkg_failed=no
-{ $as_echo "$as_me:$LINENO: checking for RPCSECGSS" >&5
-$as_echo_n "checking for RPCSECGSS... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking for GSSGLUE" >&5
+$as_echo_n "checking for GSSGLUE... " >&6; }
 
-if test -n "$RPCSECGSS_CFLAGS"; then
-    pkg_cv_RPCSECGSS_CFLAGS="$RPCSECGSS_CFLAGS"
+if test -n "$GSSGLUE_CFLAGS"; then
+    pkg_cv_GSSGLUE_CFLAGS="$GSSGLUE_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.16\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.16") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssglue >= 0.1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libgssglue >= 0.1") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.16" 2>/dev/null`
+  pkg_cv_GSSGLUE_CFLAGS=`$PKG_CONFIG --cflags "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
  else
     pkg_failed=untried
 fi
-if test -n "$RPCSECGSS_LIBS"; then
-    pkg_cv_RPCSECGSS_LIBS="$RPCSECGSS_LIBS"
+if test -n "$GSSGLUE_LIBS"; then
+    pkg_cv_GSSGLUE_LIBS="$GSSGLUE_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.16\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.16") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssglue >= 0.1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libgssglue >= 0.1") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.16" 2>/dev/null`
+  pkg_cv_GSSGLUE_LIBS=`$PKG_CONFIG --libs "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -23574,64 +24167,100 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "librpcsecgss >= 0.16" 2>&1`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libgssglue >= 0.1" 2>&1`
         else
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --print-errors "librpcsecgss >= 0.16" 2>&1`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libgssglue >= 0.1" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$RPCSECGSS_PKG_ERRORS" >&5
+       echo "$GSSGLUE_PKG_ERRORS" >&5
 
-       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-                { { $as_echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5
-$as_echo "$as_me: error: Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;}
-   { (exit 1); exit 1; }; }
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (libgssglue >= 0.1) were not met:
 
+$GSSGLUE_PKG_ERRORS
 
-elif test $pkg_failed = untried; then
-       { { $as_echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5
-$as_echo "$as_me: error: Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;}
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GSSGLUE_CFLAGS
+and GSSGLUE_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (libgssglue >= 0.1) were not met:
+
+$GSSGLUE_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GSSGLUE_CFLAGS
+and GSSGLUE_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
    { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GSSGLUE_CFLAGS
+and GSSGLUE_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GSSGLUE_CFLAGS
+and GSSGLUE_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
 else
-       RPCSECGSS_CFLAGS=$pkg_cv_RPCSECGSS_CFLAGS
-       RPCSECGSS_LIBS=$pkg_cv_RPCSECGSS_LIBS
+       GSSGLUE_CFLAGS=$pkg_cv_GSSGLUE_CFLAGS
+       GSSGLUE_LIBS=$pkg_cv_GSSGLUE_LIBS
         { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
        :
 fi
 
+    if test "$enable_tirpc" = no; then
+
 pkg_failed=no
-{ $as_echo "$as_me:$LINENO: checking for GSSGLUE" >&5
-$as_echo_n "checking for GSSGLUE... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking for RPCSECGSS" >&5
+$as_echo_n "checking for RPCSECGSS... " >&6; }
 
-if test -n "$GSSGLUE_CFLAGS"; then
-    pkg_cv_GSSGLUE_CFLAGS="$GSSGLUE_CFLAGS"
+if test -n "$RPCSECGSS_CFLAGS"; then
+    pkg_cv_RPCSECGSS_CFLAGS="$RPCSECGSS_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssglue >= 0.1\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssglue >= 0.1") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.16\"") >&5
+  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.16") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSGLUE_CFLAGS=`$PKG_CONFIG --cflags "libgssglue >= 0.1" 2>/dev/null`
+  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
  else
     pkg_failed=untried
 fi
-if test -n "$GSSGLUE_LIBS"; then
-    pkg_cv_GSSGLUE_LIBS="$GSSGLUE_LIBS"
+if test -n "$RPCSECGSS_LIBS"; then
+    pkg_cv_RPCSECGSS_LIBS="$RPCSECGSS_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssglue >= 0.1\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssglue >= 0.1") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.16\"") >&5
+  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.16") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSGLUE_LIBS=`$PKG_CONFIG --libs "libgssglue >= 0.1" 2>/dev/null`
+  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -23649,33 +24278,33 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libgssglue >= 0.1" 2>&1`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "librpcsecgss >= 0.16" 2>&1`
         else
-               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libgssglue >= 0.1" 2>&1`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --print-errors "librpcsecgss >= 0.16" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$GSSGLUE_PKG_ERRORS" >&5
+       echo "$RPCSECGSS_PKG_ERRORS" >&5
 
-       { { $as_echo "$as_me:$LINENO: error: Package requirements (libgssglue >= 0.1) were not met:
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (librpcsecgss >= 0.16) were not met:
 
-$GSSGLUE_PKG_ERRORS
+$RPCSECGSS_PKG_ERRORS
 
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GSSGLUE_CFLAGS
-and GSSGLUE_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables RPCSECGSS_CFLAGS
+and RPCSECGSS_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 " >&5
-$as_echo "$as_me: error: Package requirements (libgssglue >= 0.1) were not met:
+$as_echo "$as_me: error: Package requirements (librpcsecgss >= 0.16) were not met:
 
-$GSSGLUE_PKG_ERRORS
+$RPCSECGSS_PKG_ERRORS
 
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GSSGLUE_CFLAGS
-and GSSGLUE_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables RPCSECGSS_CFLAGS
+and RPCSECGSS_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 " >&2;}
    { (exit 1); exit 1; }; }
@@ -23686,8 +24315,8 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively, you may set the environment variables GSSGLUE_CFLAGS
-and GSSGLUE_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables RPCSECGSS_CFLAGS
+and RPCSECGSS_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
@@ -23696,23 +24325,26 @@ $as_echo "$as_me: error: The pkg-config script could not be found or is too old.
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively, you may set the environment variables GSSGLUE_CFLAGS
-and GSSGLUE_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables RPCSECGSS_CFLAGS
+and RPCSECGSS_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 else
-       GSSGLUE_CFLAGS=$pkg_cv_GSSGLUE_CFLAGS
-       GSSGLUE_LIBS=$pkg_cv_GSSGLUE_LIBS
+       RPCSECGSS_CFLAGS=$pkg_cv_RPCSECGSS_CFLAGS
+       RPCSECGSS_LIBS=$pkg_cv_RPCSECGSS_LIBS
         { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
        :
 fi
-    fi
+  fi
 
+
+  fi
 fi
+
 if test "$knfsd_cv_glibc2" = no; then
     { $as_echo "$as_me:$LINENO: checking for daemon in -lbsd" >&5
 $as_echo_n "checking for daemon in -lbsd... " >&6; }
 
 
 if test "$enable_gss" = yes; then
+    { $as_echo "$as_me:$LINENO: checking for getnameinfo" >&5
+$as_echo_n "checking for getnameinfo... " >&6; }
+if test "${ac_cv_func_getnameinfo+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define getnameinfo to an innocuous variant, in case <limits.h> declares getnameinfo.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define getnameinfo innocuous_getnameinfo
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char getnameinfo (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef getnameinfo
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getnameinfo ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_getnameinfo || defined __stub___getnameinfo
+choke me
+#endif
+
+int
+main ()
+{
+return getnameinfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_getnameinfo=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_getnameinfo=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getnameinfo" >&5
+$as_echo "$ac_cv_func_getnameinfo" >&6; }
+if test "x$ac_cv_func_getnameinfo" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: GSSAPI support requires 'getnameinfo' function" >&5
+$as_echo "$as_me: error: GSSAPI support requires 'getnameinfo' function" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for nfs4_init_name_mapping in -lnfsidmap" >&5
+$as_echo_n "checking for nfs4_init_name_mapping in -lnfsidmap... " >&6; }
+if test "${ac_cv_lib_nfsidmap_nfs4_init_name_mapping+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnfsidmap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nfs4_init_name_mapping ();
+int
+main ()
+{
+return nfs4_init_name_mapping ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_nfsidmap_nfs4_init_name_mapping=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&5
+$as_echo "$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" >&6; }
+if test "x$ac_cv_lib_nfsidmap_nfs4_init_name_mapping" = x""yes; then
+  libnfsidmap=1
+else
+  { { $as_echo "$as_me:$LINENO: error: libnfsidmap not found." >&5
+$as_echo "$as_me: error: libnfsidmap not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
 
 for ac_header in nfsidmap.h
 do
@@ -24233,20 +25035,97 @@ ac_res=`eval 'as_val=${'$as_ac_Header'}
 $as_echo "$ac_res" >&6; }
 
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:$LINENO: error: libnfsidmap headers not found." >&5
+$as_echo "$as_me: error: libnfsidmap headers not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+
+    { $as_echo "$as_me:$LINENO: checking for nfs4_set_debug in -lnfsidmap" >&5
+$as_echo_n "checking for nfs4_set_debug in -lnfsidmap... " >&6; }
+if test "${ac_cv_lib_nfsidmap_nfs4_set_debug+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnfsidmap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nfs4_set_debug ();
+int
+main ()
+{
+return nfs4_set_debug ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nfsidmap_nfs4_set_debug=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_nfsidmap_nfs4_set_debug=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_set_debug" >&5
+$as_echo "$ac_cv_lib_nfsidmap_nfs4_set_debug" >&6; }
+if test "x$ac_cv_lib_nfsidmap_nfs4_set_debug" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NFS4_SET_DEBUG 1
 _ACEOF
 
-else
-  { { $as_echo "$as_me:$LINENO: error: libnfsidmap needed for gss support" >&5
-$as_echo "$as_me: error: libnfsidmap needed for gss support" >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
-done
+
+
 
 
 for ac_header in spkm3.h
@@ -24396,85 +25275,12 @@ as_val=`eval 'as_val=${'$as_ac_Header'}
 _ACEOF
 
 else
-  { $as_echo "$as_me:$LINENO: WARNING: could not locate SPKM3 header; will not have SPKM3 support" >&5
-$as_echo "$as_me: WARNING: could not locate SPKM3 header; will not have SPKM3 support" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: Could not locate SPKM3 header; will not have SPKM3 support" >&5
+$as_echo "$as_me: WARNING: Could not locate SPKM3 header; will not have SPKM3 support" >&2;}
 fi
 
 done
 
-    { $as_echo "$as_me:$LINENO: checking for nfs4_set_debug in -lnfsidmap" >&5
-$as_echo_n "checking for nfs4_set_debug in -lnfsidmap... " >&6; }
-if test "${ac_cv_lib_nfsidmap_nfs4_set_debug+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnfsidmap  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char nfs4_set_debug ();
-int
-main ()
-{
-return nfs4_set_debug ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_nfsidmap_nfs4_set_debug=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_nfsidmap_nfs4_set_debug=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_set_debug" >&5
-$as_echo "$ac_cv_lib_nfsidmap_nfs4_set_debug" >&6; }
-if test "x$ac_cv_lib_nfsidmap_nfs4_set_debug" = x""yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_NFS4_SET_DEBUG 1
-_ACEOF
-
-fi
-
 
 
   { $as_echo "$as_me:$LINENO: checking for Kerberos v5" >&5
@@ -24563,173 +25369,17 @@ $as_echo "$KRBDIR" >&6; }
 
     echo "The current KRBDIR is $KRBDIR"
   if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
-       -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
-    KRBLDFLAGS="";
-  elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
-    KRBLDFLAGS="";
-  else
-    KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
-  fi
-
-    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_export_lucid_sec_context" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib" >&5
-$as_echo_n "checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib... " >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$gssapi_lib $KRBLIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gss_krb5_export_lucid_sec_context ();
-int
-main ()
-{
-return gss_krb5_export_lucid_sec_context ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_Lib=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_Lib=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval 'as_val=${'$as_ac_Lib'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Lib'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LUCID_CONTEXT_SUPPORT 1
-_ACEOF
-
-fi
-
-  as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_set_allowable_enctypes" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib" >&5
-$as_echo_n "checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib... " >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$gssapi_lib $KRBLIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gss_krb5_set_allowable_enctypes ();
-int
-main ()
-{
-return gss_krb5_set_allowable_enctypes ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_Lib=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_Lib=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval 'as_val=${'$as_ac_Lib'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Lib'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SET_ALLOWABLE_ENCTYPES 1
-_ACEOF
-
-fi
+       -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
+    KRBLDFLAGS="";
+  elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
+    KRBLDFLAGS="";
+  else
+    KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
+  fi
 
-  as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_ccache_name" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for gss_krb5_ccache_name in -l$gssapi_lib" >&5
-$as_echo_n "checking for gss_krb5_ccache_name in -l$gssapi_lib... " >&6; }
+    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_export_lucid_sec_context" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib" >&5
+$as_echo_n "checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
@@ -24748,11 +25398,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char gss_krb5_ccache_name ();
+char gss_krb5_export_lucid_sec_context ();
 int
 main ()
 {
-return gss_krb5_ccache_name ();
+return gss_krb5_export_lucid_sec_context ();
   ;
   return 0;
 }
@@ -24800,15 +25450,14 @@ as_val=`eval 'as_val=${'$as_ac_Lib'}
    if test "x$as_val" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_GSS_KRB5_CCACHE_NAME 1
+#define HAVE_LUCID_CONTEXT_SUPPORT 1
 _ACEOF
 
 fi
 
-
-    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_krb5_get_error_message" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for krb5_get_error_message in -l$gssapi_lib" >&5
-$as_echo_n "checking for krb5_get_error_message in -l$gssapi_lib... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_set_allowable_enctypes" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib" >&5
+$as_echo_n "checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
@@ -24827,11 +25476,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_get_error_message ();
+char gss_krb5_set_allowable_enctypes ();
 int
 main ()
 {
-return krb5_get_error_message ();
+return gss_krb5_set_allowable_enctypes ();
   ;
   return 0;
 }
@@ -24879,15 +25528,14 @@ as_val=`eval 'as_val=${'$as_ac_Lib'}
    if test "x$as_val" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_KRB5_GET_ERROR_MESSAGE 1
+#define HAVE_SET_ALLOWABLE_ENCTYPES 1
 _ACEOF
 
 fi
 
-
-    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_krb5_get_init_creds_opt_set_addressless" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for krb5_get_init_creds_opt_set_addressless in -l$gssapi_lib" >&5
-$as_echo_n "checking for krb5_get_init_creds_opt_set_addressless in -l$gssapi_lib... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_gss_krb5_ccache_name" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for gss_krb5_ccache_name in -l$gssapi_lib" >&5
+$as_echo_n "checking for gss_krb5_ccache_name in -l$gssapi_lib... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
@@ -24906,11 +25554,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_get_init_creds_opt_set_addressless ();
+char gss_krb5_ccache_name ();
 int
 main ()
 {
-return krb5_get_init_creds_opt_set_addressless ();
+return gss_krb5_ccache_name ();
   ;
   return 0;
 }
@@ -24958,32 +25606,20 @@ as_val=`eval 'as_val=${'$as_ac_Lib'}
    if test "x$as_val" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS 1
+#define HAVE_GSS_KRB5_CCACHE_NAME 1
 _ACEOF
 
 fi
 
 
-    if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
-    { $as_echo "$as_me:$LINENO: WARNING: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" >&5
-$as_echo "$as_me: WARNING: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" >&2;}
-  fi
-
-
-
-
-
-
-
-
-
-      { $as_echo "$as_me:$LINENO: checking for authgss_create_default in -lrpcsecgss" >&5
-$as_echo_n "checking for authgss_create_default in -lrpcsecgss... " >&6; }
-if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then
+    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_krb5_get_error_message" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for krb5_get_error_message in -l$gssapi_lib" >&5
+$as_echo_n "checking for krb5_get_error_message in -l$gssapi_lib... " >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
+LIBS="-l$gssapi_lib $KRBLIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24997,11 +25633,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char authgss_create_default ();
+char krb5_get_error_message ();
 int
 main ()
 {
-return authgss_create_default ();
+return krb5_get_error_message ();
   ;
   return 0;
 }
@@ -25027,12 +25663,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_rpcsecgss_authgss_create_default=yes
+  eval "$as_ac_Lib=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_rpcsecgss_authgss_create_default=no
+       eval "$as_ac_Lib=no"
 fi
 
 rm -rf conftest.dSYM
@@ -25040,23 +25676,29 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rpcsecgss_authgss_create_default" >&5
-$as_echo "$ac_cv_lib_rpcsecgss_authgss_create_default" >&6; }
-if test "x$ac_cv_lib_rpcsecgss_authgss_create_default" = x""yes; then
-  librpcsecgss=1
-else
-  { { $as_echo "$as_me:$LINENO: error: librpcsecgss needed for nfsv4 support" >&5
-$as_echo "$as_me: error: librpcsecgss needed for nfsv4 support" >&2;}
-   { (exit 1); exit 1; }; }
+ac_res=`eval 'as_val=${'$as_ac_Lib'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5_GET_ERROR_MESSAGE 1
+_ACEOF
+
 fi
 
-  { $as_echo "$as_me:$LINENO: checking for authgss_set_debug_level in -lrpcsecgss" >&5
-$as_echo_n "checking for authgss_set_debug_level in -lrpcsecgss... " >&6; }
-if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then
+
+    as_ac_Lib=`$as_echo "ac_cv_lib_$gssapi_lib''_krb5_get_init_creds_opt_set_addressless" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for krb5_get_init_creds_opt_set_addressless in -l$gssapi_lib" >&5
+$as_echo_n "checking for krb5_get_init_creds_opt_set_addressless in -l$gssapi_lib... " >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
+LIBS="-l$gssapi_lib $KRBLIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25070,11 +25712,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char authgss_set_debug_level ();
+char krb5_get_init_creds_opt_set_addressless ();
 int
 main ()
 {
-return authgss_set_debug_level ();
+return krb5_get_init_creds_opt_set_addressless ();
   ;
   return 0;
 }
@@ -25100,12 +25742,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_rpcsecgss_authgss_set_debug_level=yes
+  eval "$as_ac_Lib=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_rpcsecgss_authgss_set_debug_level=no
+       eval "$as_ac_Lib=no"
 fi
 
 rm -rf conftest.dSYM
@@ -25113,91 +25755,45 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rpcsecgss_authgss_set_debug_level" >&5
-$as_echo "$ac_cv_lib_rpcsecgss_authgss_set_debug_level" >&6; }
-if test "x$ac_cv_lib_rpcsecgss_authgss_set_debug_level" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_Lib'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_AUTHGSS_SET_DEBUG_LEVEL 1
+#define HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS 1
 _ACEOF
 
 fi
 
 
-fi
+    if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
+    { $as_echo "$as_me:$LINENO: WARNING: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" >&5
+$as_echo "$as_me: WARNING: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" >&2;}
+  fi
 
-{ $as_echo "$as_me:$LINENO: checking whether AI_ADDRCONFIG is declared" >&5
-$as_echo_n "checking whether AI_ADDRCONFIG is declared... " >&6; }
-if test "${ac_cv_have_decl_AI_ADDRCONFIG+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
- #include <netdb.h>
 
-int
-main ()
-{
-#ifndef AI_ADDRCONFIG
-  (void) AI_ADDRCONFIG;
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_AI_ADDRCONFIG=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_AI_ADDRCONFIG=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_AI_ADDRCONFIG" >&5
-$as_echo "$ac_cv_have_decl_AI_ADDRCONFIG" >&6; }
-if test "x$ac_cv_have_decl_AI_ADDRCONFIG" = x""yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DECL_AI_ADDRCONFIG 1
-_ACEOF
 
-fi
 
 
-if test "$enable_tirpc" = yes; then
 
-{ $as_echo "$as_me:$LINENO: checking for clnt_tli_create in -ltirpc" >&5
-$as_echo_n "checking for clnt_tli_create in -ltirpc... " >&6; }
-if test "${ac_cv_lib_tirpc_clnt_tli_create+set}" = set; then
+
+    if test "$enable_tirpc" = no; then
+
+        { $as_echo "$as_me:$LINENO: checking for authgss_create_default in -lrpcsecgss" >&5
+$as_echo_n "checking for authgss_create_default in -lrpcsecgss... " >&6; }
+if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltirpc  $LIBS"
+LIBS="-lrpcsecgss  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25211,11 +25807,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char clnt_tli_create ();
+char authgss_create_default ();
 int
 main ()
 {
-return clnt_tli_create ();
+return authgss_create_default ();
   ;
   return 0;
 }
@@ -25241,12 +25837,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_tirpc_clnt_tli_create=yes
+  ac_cv_lib_rpcsecgss_authgss_create_default=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_tirpc_clnt_tli_create=no
+       ac_cv_lib_rpcsecgss_authgss_create_default=no
 fi
 
 rm -rf conftest.dSYM
@@ -25254,191 +25850,102 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tirpc_clnt_tli_create" >&5
-$as_echo "$ac_cv_lib_tirpc_clnt_tli_create" >&6; }
-if test "x$ac_cv_lib_tirpc_clnt_tli_create" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBTIRPC 1
-_ACEOF
-
-  LIBS="-ltirpc $LIBS"
-
-else
-  { { $as_echo "$as_me:$LINENO: error: libtirpc not found." >&5
-$as_echo "$as_me: error: libtirpc not found." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-for ac_header in tirpc/netconfig.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rpcsecgss_authgss_create_default" >&5
+$as_echo "$ac_cv_lib_rpcsecgss_authgss_create_default" >&6; }
+if test "x$ac_cv_lib_rpcsecgss_authgss_create_default" = x""yes; then
+  librpcsecgss=1
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
+  { { $as_echo "$as_me:$LINENO: error: librpcsecgss not found." >&5
+$as_echo "$as_me: error: librpcsecgss not found." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
+    { $as_echo "$as_me:$LINENO: checking for authgss_set_debug_level in -lrpcsecgss" >&5
+$as_echo_n "checking for authgss_set_debug_level in -lrpcsecgss... " >&6; }
+if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrpcsecgss  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char authgss_set_debug_level ();
+int
+main ()
+{
+return authgss_set_debug_level ();
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
        }; then
-  ac_header_preproc=yes
+  ac_cv_lib_rpcsecgss_authgss_set_debug_level=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       ac_cv_lib_rpcsecgss_authgss_set_debug_level=no
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ---------------------------------------- ##
-## Report this to linux-nfs@vger.kernel.org ##
-## ---------------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rpcsecgss_authgss_set_debug_level" >&5
+$as_echo "$ac_cv_lib_rpcsecgss_authgss_set_debug_level" >&6; }
+if test "x$ac_cv_lib_rpcsecgss_authgss_set_debug_level" = x""yes; then
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AUTHGSS_SET_DEBUG_LEVEL 1
 _ACEOF
 
-else
-  { { $as_echo "$as_me:$LINENO: error: libtirpc headers not found." >&5
-$as_echo "$as_me: error: libtirpc headers not found." >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
-done
-
 
+  fi
 
 
 
+fi
 
 
 
-for ac_func in bindresvport_sa getnetconfig \
-                  clnt_create clnt_create_timed \
-                  clnt_vc_create clnt_dg_create xdr_rpcb
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking whether AI_ADDRCONFIG is declared" >&5
+$as_echo_n "checking whether AI_ADDRCONFIG is declared... " >&6; }
+if test "${ac_cv_have_decl_AI_ADDRCONFIG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -25447,54 +25954,28 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+ #include <netdb.h>
 
 int
 main ()
 {
-return $ac_func ();
+#ifndef AI_ADDRCONFIG
+  (void) AI_ADDRCONFIG;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -25503,47 +25984,44 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_AI_ADDRCONFIG=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       ac_cv_have_decl_AI_ADDRCONFIG=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_AI_ADDRCONFIG" >&5
+$as_echo "$ac_cv_have_decl_AI_ADDRCONFIG" >&6; }
+if test "x$ac_cv_have_decl_AI_ADDRCONFIG" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DECL_AI_ADDRCONFIG 1
 _ACEOF
 
 fi
-done
 
-fi
 
-if test "$enable_ipv6" = yes; then
-  if test "$enable_tirpc" = no; then
-    { { $as_echo "$as_me:$LINENO: error: '--enable-ipv6' requires '--enable-tirpc'." >&5
+  if test "$enable_ipv6" = yes; then
+
+        if test "$enable_tirpc" = no; then
+      { { $as_echo "$as_me:$LINENO: error: '--enable-ipv6' requires '--enable-tirpc'." >&5
 $as_echo "$as_me: error: '--enable-ipv6' requires '--enable-tirpc'." >&2;}
    { (exit 1); exit 1; }; }
-  fi
-  { $as_echo "$as_me:$LINENO: checking for getnameinfo" >&5
-$as_echo_n "checking for getnameinfo... " >&6; }
-if test "${ac_cv_func_getnameinfo+set}" = set; then
+    fi
+
+
+
+for ac_func in getnameinfo bindresvport_sa
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -25552,12 +26030,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define getnameinfo to an innocuous variant, in case <limits.h> declares getnameinfo.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define getnameinfo innocuous_getnameinfo
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getnameinfo (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -25567,7 +26045,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef getnameinfo
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -25575,18 +26053,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char getnameinfo ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_getnameinfo || defined __stub___getnameinfo
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
 #endif
 
 int
 main ()
 {
-return getnameinfo ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -25612,22 +26090,38 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_func_getnameinfo=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_getnameinfo=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getnameinfo" >&5
-$as_echo "$ac_cv_func_getnameinfo" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-  { $as_echo "$as_me:$LINENO: checking whether AI_ADDRCONFIG is declared" >&5
+else
+  { { $as_echo "$as_me:$LINENO: error: Missing functions needed for IPv6." >&5
+$as_echo "$as_me: error: Missing functions needed for IPv6." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+done
+
+
+            { $as_echo "$as_me:$LINENO: checking whether AI_ADDRCONFIG is declared" >&5
 $as_echo_n "checking whether AI_ADDRCONFIG is declared... " >&6; }
 if test "${ac_cv_have_decl_AI_ADDRCONFIG+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -25689,7 +26183,10 @@ $as_echo "$as_me: error: full getaddrinfo(3) implementation needed for IPv6 supp
    { (exit 1); exit 1; }; }
 fi
 
-fi
+
+  fi
+
+
 
 
 
@@ -31681,13 +32178,6 @@ $as_echo "$as_me: error: conditional \"CONFIG_IPV6\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${CONFIG_TIRPC_TRUE}" && test -z "${CONFIG_TIRPC_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"CONFIG_TIRPC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"CONFIG_TIRPC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -32038,7 +32528,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by linux nfs-utils $as_me 1.1.5, which was
+This file was extended by linux nfs-utils $as_me 1.1.6, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -32101,7 +32591,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-linux nfs-utils config.status 1.1.5
+linux nfs-utils config.status 1.1.6
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index 5db44176a17b300323122c1189e7d7a79a0e6966..e09e1d9a092997c38855fd379bd1ab439c449473 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl
-AC_INIT([linux nfs-utils],[1.1.5],[linux-nfs@vger.kernel.org],[nfs-utils])
+AC_INIT([linux nfs-utils],[1.1.6],[linux-nfs@vger.kernel.org],[nfs-utils])
 AC_CANONICAL_BUILD([])
 AC_CANONICAL_HOST([])
 AC_CONFIG_MACRO_DIR(aclocal)
@@ -118,6 +118,11 @@ AC_ARG_ENABLE(mount,
        enable_mount=$enableval,
        enable_mount=yes)
        AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"])
+AC_ARG_ENABLE(tirpc,
+       [AC_HELP_STRING([--enable-tirpc],
+                       [enable use of TI-RPC @<:@default=no@:>@])],
+       enable_tirpc=$enableval,
+       enable_tirpc=no)
 AC_ARG_ENABLE(ipv6,
        [AC_HELP_STRING([--enable-ipv6],
                         [enable support for IPv6 @<:@default=no@:>@])],
@@ -131,13 +136,8 @@ AC_ARG_ENABLE(ipv6,
        AC_SUBST(enable_ipv6)
        AM_CONDITIONAL(CONFIG_IPV6, [test "$enable_ipv6" = "yes"])
 
-AC_ARG_ENABLE(tirpc,
-       [AC_HELP_STRING([--enable-tirpc],
-                        [enable use of TI-RPC @<:@default=no@:>@])],
-       enable_tirpc=$enableval,
-       enable_tirpc=no)
-       AC_SUBST(enable_tirpc)
-       AM_CONDITIONAL(CONFIG_TIRPC, [test "$enable_tirpc" = "yes"])
+dnl Check for TI-RPC library and headers
+AC_LIBTIRPC
 
 # Check whether user wants TCP wrappers support
 AC_TCP_WRAPPERS
@@ -176,39 +176,40 @@ AC_BSD_SIGNALS
 dnl *************************************************************
 dnl * Check for required libraries
 dnl *************************************************************
-AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"])])
+
+AC_CHECK_FUNC([gethostbyname], ,
+              [AC_CHECK_LIB([nsl], [gethostbyname], [LIBNSL="-lnsl"])])
 AC_SUBST(LIBNSL)
 
-AC_CHECK_FUNC(connect, ,
-      AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"],
-                AC_MSG_ERROR(Function 'socket' not found.), $LIBNSL))
+AC_CHECK_FUNC([connect], ,
+              [AC_CHECK_LIB([socket], [connect], [LIBSOCKET="-lsocket"],
+                    [AC_MSG_ERROR([Function 'socket' not found.])], [$LIBNSL])])
+
+AC_CHECK_FUNC([getaddrinfo], ,
+              [AC_MSG_ERROR([Function 'getaddrinfo' not found.])])
 
-AC_CHECK_FUNC(getaddrinfo, , ,
-                AC_MSG_ERROR(Function 'getaddrinfo' not found.))
+AC_CHECK_FUNC([getrpcbynumber], ,
+              [AC_MSG_ERROR([Function 'getrpcbynumber' not found.])])
 
-AC_CHECK_FUNC(getrpcbynumber, , ,
-                AC_MSG_ERROR(Function 'getrpcbynumber' not found.))
+AC_CHECK_FUNC([getservbyname], ,
+              [AC_MSG_ERROR([Function 'getservbyname' not found.])])
 
-AC_CHECK_FUNC(getservbyname, , ,
-                AC_MSG_ERROR(Function 'getservbyname' not found.))
+AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
 
-AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
 if test "$enable_nfsv4" = yes; then
-    AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
-    AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
-    AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support]))
-    AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
-    dnl librpcsecgss already has a dependency on libgssapi,
-    dnl but we need to make sure we get the right version
-    if test "$enable_gss" = yes; then
-     PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.16, ,
-      [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
-      ]
-     )
-    PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
-    fi
+  dnl check for libevent libraries and headers
+  AC_LIBEVENT
+
+  dnl check for nfsidmap libraries and headers
+  AC_LIBNFSIDMAP
 
+  dnl librpcsecgss already has a dependency on libgssapi,
+  dnl but we need to make sure we get the right version
+  if test "$enable_gss" = yes; then
+    AC_RPCSEC_VERSION
+  fi
 fi
+
 if test "$knfsd_cv_glibc2" = no; then
     AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
 fi
@@ -235,50 +236,25 @@ AC_SUBST(LIBBSD)
 AC_SUBST(LIBBLKID)
 
 if test "$enable_gss" = yes; then
+  dnl 'gss' requires getnameinfo - at least for gssd_proc.c
+  AC_CHECK_FUNC([getnameinfo], , [AC_MSG_ERROR([GSSAPI support requires 'getnameinfo' function])])
+
   dnl 'gss' also depends on nfsidmap.h - at least for svcgssd_proc.c
-  AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for gss support]))
-  AC_CHECK_HEADERS(spkm3.h, ,AC_MSG_WARN([could not locate SPKM3 header; will not have SPKM3 support]))
-  dnl the nfs4_set_debug function doesn't appear in all version of the library
-  AC_CHECK_LIB(nfsidmap, nfs4_set_debug,
-              AC_DEFINE(HAVE_NFS4_SET_DEBUG,1,
-                        [Whether nfs4_set_debug() is present in libnfsidmap]),)
+  AC_LIBNFSIDMAP
+
+  AC_CHECK_HEADERS([spkm3.h], ,
+                   [AC_MSG_WARN([Could not locate SPKM3 header; will not have SPKM3 support])])
 
   dnl Check for Kerberos V5
   AC_KERBEROS_V5
 
-  dnl This is not done until here because we need to have KRBLIBS set
-  dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS)
-  AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), -lgssglue -ldl)
-  AC_CHECK_LIB(rpcsecgss, authgss_set_debug_level,
-              AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, -lgssglue -ldl)
-
-fi
+  dnl Invoked after AC_KERBEROS_V5; AC_LIBRPCSECGSS needs to have KRBLIBS set
+  AC_LIBRPCSECGSS
 
-AC_CHECK_DECL([AI_ADDRCONFIG],
-              AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
-                         [Define this to 1 if AI_ADDRCONFIG macro is defined]), ,
-              [ #include <netdb.h> ] )
-
-if test "$enable_tirpc" = yes; then
-  AC_CHECK_LIB(tirpc, clnt_tli_create, ,
-           AC_MSG_ERROR([libtirpc not found.]))
-  AC_CHECK_HEADERS(tirpc/netconfig.h, ,
-                   AC_MSG_ERROR([libtirpc headers not found.]))
-  AC_CHECK_FUNCS([bindresvport_sa getnetconfig \
-                  clnt_create clnt_create_timed \
-                  clnt_vc_create clnt_dg_create xdr_rpcb])
 fi
 
-if test "$enable_ipv6" = yes; then
-  if test "$enable_tirpc" = no; then
-    AC_MSG_ERROR('--enable-ipv6' requires '--enable-tirpc'.)
-  fi
-  AC_CHECK_FUNC(getnameinfo, , ,
-               AC_MSG_ERROR(Function 'getnameinfo' not found.))
-  AC_CHECK_DECL([AI_ADDRCONFIG], ,
-               AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support]),
-               [ #include <netdb.h> ] )
-fi
+dnl Check for IPv6 support
+AC_IPV6
 
 dnl *************************************************************
 dnl Check for headers
index f2b1c608d06e3c0b66982e3f75623cd3cb11ca74..dfdec9e5b39a8cf49fb7b09ec70217fccaa310a3 100644 (file)
@@ -36,9 +36,15 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        ChangeLog INSTALL THANKS TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -54,6 +60,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -166,7 +173,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 3fc9892dfd1107fcca8af07e27d07ea11947eade..a3b8a305513c423116c17404450075fcdbed228f 100644 (file)
@@ -35,9 +35,15 @@ subdir = support
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -65,6 +71,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -177,7 +184,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 4076e860d1266b8280793b2f4da5391f1e89a7cc..70e145e18ce4457463ffdf8517f343b04f76fb4a 100644 (file)
@@ -38,9 +38,15 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +85,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -191,7 +198,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index e11a22a8dd0d96fd18247c5375443c6c4b95eea0..b49e1aaa9c121922d943a4b91cad496b9f9c4924 100644 (file)
@@ -57,7 +57,7 @@ rmtab_read(void)
                   file. */
                int     lockid;
                FILE    *fp;
-               if ((lockid = xflock(_PATH_RMTAB, "w")) < 0)
+               if ((lockid = xflock(_PATH_RMTABLCK, "w")) < 0)
                        return -1;
                rewindrmtabent();
                if (!(fp = fsetrmtabent(_PATH_RMTABTMP, "w"))) {
index 510765a3f0d59b5517e06b0542f1eb8d0d702f03..3b1dcce325493fec61fbb5385b9a89aadff8da84 100644 (file)
@@ -23,7 +23,7 @@
 static void cond_rename(char *newfile, char *oldfile);
 
 static int
-xtab_read(char *xtab, int is_export)
+xtab_read(char *xtab, char *lockfn, int is_export)
 {
     /* is_export == 0  => reading /proc/fs/nfs/exports - we know these things are exported to kernel
      * is_export == 1  => reading /var/lib/nfs/etab - these things are allowed to be exported
@@ -33,7 +33,7 @@ xtab_read(char *xtab, int is_export)
        nfs_export              *exp;
        int                     lockid;
 
-       if ((lockid = xflock(xtab, "r")) < 0)
+       if ((lockid = xflock(lockfn, "r")) < 0)
                return 0;
        setexportent(xtab, "r");
        while ((xp = getexportent(is_export==0, 0)) != NULL) {
@@ -66,18 +66,20 @@ xtab_mount_read(void)
        int fd;
        if ((fd=open(_PATH_PROC_EXPORTS, O_RDONLY))>=0) {
                close(fd);
-               return xtab_read(_PATH_PROC_EXPORTS, 0);
+               return xtab_read(_PATH_PROC_EXPORTS,
+                                _PATH_PROC_EXPORTS, 0);
        } else if ((fd=open(_PATH_PROC_EXPORTS_ALT, O_RDONLY) >= 0)) {
                close(fd);
-               return xtab_read(_PATH_PROC_EXPORTS_ALT, 0);
+               return xtab_read(_PATH_PROC_EXPORTS_ALT,
+                                _PATH_PROC_EXPORTS_ALT, 0);
        } else
-               return xtab_read(_PATH_XTAB, 2);
+               return xtab_read(_PATH_XTAB, _PATH_XTABLCK, 2);
 }
 
 int
 xtab_export_read(void)
 {
-       return xtab_read(_PATH_ETAB, 1);
+       return xtab_read(_PATH_ETAB, _PATH_ETABLCK, 1);
 }
 
 /*
@@ -87,13 +89,13 @@ xtab_export_read(void)
  * fix the auth_reload logic as well...
  */
 static int
-xtab_write(char *xtab, char *xtabtmp, int is_export)
+xtab_write(char *xtab, char *xtabtmp, char *lockfn, int is_export)
 {
        struct exportent        xe;
        nfs_export              *exp;
        int                     lockid, i;
 
-       if ((lockid = xflock(xtab, "w")) < 0) {
+       if ((lockid = xflock(lockfn, "w")) < 0) {
                xlog(L_ERROR, "can't lock %s for writing", xtab);
                return 0;
        }
@@ -124,13 +126,13 @@ xtab_write(char *xtab, char *xtabtmp, int is_export)
 int
 xtab_export_write()
 {
-       return xtab_write(_PATH_ETAB, _PATH_ETABTMP, 1);
+       return xtab_write(_PATH_ETAB, _PATH_ETABTMP, _PATH_ETABLCK, 1);
 }
 
 int
 xtab_mount_write()
 {
-       return xtab_write(_PATH_XTAB, _PATH_XTABTMP, 0);
+       return xtab_write(_PATH_XTAB, _PATH_XTABTMP, _PATH_XTABLCK, 0);
 }
 
 void
@@ -139,7 +141,7 @@ xtab_append(nfs_export *exp)
        struct exportent xe;
        int             lockid;
 
-       if ((lockid = xflock(_PATH_XTAB, "w")) < 0)
+       if ((lockid = xflock(_PATH_XTABLCK, "w")) < 0)
                return;
        setexportent(_PATH_XTAB, "a");
        xe = exp->m_export;
index c6cf455683a461d78eb5bf4604a8f2e9cf444278..f6b7efa44867c575e2d22b4769df37741dc4b682 100644 (file)
@@ -37,9 +37,15 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(srcdir)/config.h.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -68,6 +74,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -180,7 +187,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 4dbe22b7e645a5e05da432b55656278435234d68..dcd2102ccb428f4d4c66f7e1c5525242e10b2b1f 100644 (file)
@@ -34,8 +34,7 @@
 /* Define to 1 if you have the `atexit' function. */
 #undef HAVE_ATEXIT
 
-/* Define this if the rpcsec_gss library has the function
-   authgss_set_debug_level */
+/* Define to 1 if you have the `authgss_set_debug_level' function. */
 #undef HAVE_AUTHGSS_SET_DEBUG_LEVEL
 
 /* Define to 1 if you have the `bindresvport_sa' function. */
 /* Define this if you want to use BSD signal semantics */
 #undef HAVE_BSD_SIGNALS
 
-/* Define to 1 if you have the `clnt_create' function. */
-#undef HAVE_CLNT_CREATE
-
-/* Define to 1 if you have the `clnt_create_timed' function. */
-#undef HAVE_CLNT_CREATE_TIMED
-
-/* Define to 1 if you have the `clnt_dg_create' function. */
-#undef HAVE_CLNT_DG_CREATE
-
-/* Define to 1 if you have the `clnt_vc_create' function. */
-#undef HAVE_CLNT_VC_CREATE
-
 /* Define to 1 if you have the <com_err.h> header file. */
 #undef HAVE_COM_ERR_H
 
 /* Define to 1 if you have the `getnameinfo' function. */
 #undef HAVE_GETNAMEINFO
 
-/* Define to 1 if you have the `getnetconfig' function. */
-#undef HAVE_GETNETCONFIG
-
 /* Define to 1 if you have the `getrpcbyname' function. */
 #undef HAVE_GETRPCBYNAME
 
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #undef HAVE_NETINET_IN_H
 
-/* Whether nfs4_set_debug() is present in libnfsidmap */
+/* Define to 1 if you have the `nfs4_set_debug' function. */
 #undef HAVE_NFS4_SET_DEBUG
 
 /* Define to 1 if you have the <nfsidmap.h> header file. */
 /* tcp-wrapper */
 #undef HAVE_TCP_WRAPPER
 
-/* Define to 1 if you have the <tirpc/netconfig.h> header file. */
-#undef HAVE_TIRPC_NETCONFIG_H
-
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if `vfork' works. */
 #undef HAVE_WORKING_VFORK
 
-/* Define to 1 if you have the `xdr_rpcb' function. */
-#undef HAVE_XDR_RPCB
-
 /* Define this if you want IPv6 support compiled in */
 #undef IPV6_SUPPORTED
 
index c972608144a6812bae3ab9ec3c983e50923bb4d5..9cede25f767e1fff17b53bc18aa9bdb88734a70f 100644 (file)
@@ -37,9 +37,15 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -58,6 +64,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -170,7 +177,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index a51d79d60eb9ee1d92e498c3f5c6b8d046921c49..9d0d39d438d2c19872c313d59529a06ebd639109 100644 (file)
 #ifndef _PATH_XTABTMP
 #define _PATH_XTABTMP          NFS_STATEDIR "/xtab.tmp"
 #endif
+#ifndef _PATH_XTABLCK
+#define _PATH_XTABLCK          NFS_STATEDIR "/.xtab.lock"
+#endif
 #ifndef _PATH_ETAB
 #define _PATH_ETAB             NFS_STATEDIR "/etab"
 #endif
 #ifndef _PATH_ETABTMP
 #define _PATH_ETABTMP          NFS_STATEDIR "/etab.tmp"
 #endif
+#ifndef _PATH_ETABLCK
+#define _PATH_ETABLCK          NFS_STATEDIR "/.etab.lock"
+#endif
 #ifndef _PATH_RMTAB
 #define _PATH_RMTAB            NFS_STATEDIR "/rmtab"
 #endif
 #ifndef _PATH_RMTABTMP
 #define _PATH_RMTABTMP         _PATH_RMTAB ".tmp"
 #endif
+#ifndef _PATH_RMTABLCK
+#define _PATH_RMTABLCK         NFS_STATEDIR "/.rmtab.lock"
+#endif
 #ifndef _PATH_PROC_EXPORTS
 #define        _PATH_PROC_EXPORTS      "/proc/fs/nfs/exports"
 #define        _PATH_PROC_EXPORTS_ALT  "/proc/fs/nfsd/exports"
index 097debb873aed39d90f2afff63ed6857f3883927..543c35bc9fdc8901395c6ae378b46ec182ab8bc9 100644 (file)
@@ -24,6 +24,7 @@
 #define __NFS_UTILS_NFSRPC_H
 
 #include <rpc/types.h>
+#include <rpc/clnt.h>
 
 /*
  * Conventional RPC program numbers
 extern rpcprog_t       nfs_getrpcbyname(const rpcprog_t, const char *table[]);
 
 /*
- * Acquire an RPC CLIENT *
+ * Acquire an RPC CLIENT * with an ephemeral source port
  */
 extern CLIENT          *nfs_get_rpcclient(const struct sockaddr *,
                                const socklen_t, const unsigned short,
                                const rpcprog_t, const rpcvers_t,
                                struct timeval *);
 
+/*
+ * Acquire an RPC CLIENT * with a privileged source port
+ */
+extern CLIENT          *nfs_get_priv_rpcclient( const struct sockaddr *,
+                               const socklen_t, const unsigned short,
+                               const rpcprog_t, const rpcvers_t,
+                               struct timeval *);
+
 /*
  * Convert a socket address to a universal address
  */
index d73c231028589b9db550e28a83a83f6c89b11ce2..7db19dfb85ead72b69f7081edf00326a71be4f2f 100644 (file)
@@ -37,9 +37,15 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -58,6 +64,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -170,7 +177,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index eb46b06558ad899ef03e0c61df66c03d76ba897d..c1acd5d30ae9e4cc65212e400e2a5e7631b48832 100644 (file)
@@ -35,9 +35,15 @@ subdir = support/include/sys
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -65,6 +71,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -177,7 +184,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 66042a9a2c2a598d70e1c7afdda09182ecf42aae..c059a17ed220391e4ed4f6867d46cd40cc017e84 100644 (file)
@@ -37,9 +37,15 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -58,6 +64,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -170,7 +177,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 71b249dd822c61c76b639259d6ff609e7c8f2f3b..91aa0dd3b797ca025444ee69d8ec0daabb4baf14 100644 (file)
@@ -36,9 +36,15 @@ subdir = support/misc
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -75,6 +81,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -187,7 +194,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index a361496e25720b5f8cf56f7e06dabaa3689bc4f5..1da60204c541a3ee178d9a8ec869bc277387de93 100644 (file)
@@ -60,8 +60,16 @@ static void logit(int severity, struct sockaddr_in *addr,
                  u_long procnum, u_long prognum, char *text);
 static int check_files(void);
 
+/*
+ * These need to exist since they are externed 
+ * public header files.
+ */
+int     verboselog = 0;
+int     allow_severity = LOG_INFO;
+int     deny_severity = LOG_WARNING;
+
 #define log_bad_host(addr, proc, prog) \
-  logit(LOG_WARNING, addr, proc, prog, "request from unauthorized host")
+  logit(deny_severity, addr, proc, prog, "request from unauthorized host")
 
 #define ALLOW 1
 #define DENY 0
index 259c5350b71e8a1c4f2beeaa72b68f5687bf228c..17ae732abc7e6d8485b860d17fa52fb315971b0b 100644 (file)
@@ -36,9 +36,15 @@ subdir = support/nfs
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -80,6 +86,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -192,7 +199,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 48292f8a5d49841c48f323c1b5977691396ef6be..6a6ed5ac7f093a590e621895a03f2c9e3729683e 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <time.h>
+#include <errno.h>
 
 void qword_add(char **bpp, int *lp, char *str)
 {
@@ -125,7 +126,10 @@ void qword_print(FILE *f, char *str)
        char *bp = qword_buf;
        int len = sizeof(qword_buf);
        qword_add(&bp, &len, str);
-       fwrite(qword_buf, bp-qword_buf, 1, f);
+       if (fwrite(qword_buf, bp-qword_buf, 1, f) != 1) {
+               xlog_warn("qword_print: fwrite failed: errno %d (%s)",
+                       errno, strerror(errno));
+       }
 }
 
 void qword_printhex(FILE *f, char *str, int slen)
@@ -133,7 +137,10 @@ void qword_printhex(FILE *f, char *str, int slen)
        char *bp = qword_buf;
        int len = sizeof(qword_buf);
        qword_addhex(&bp, &len, str, slen);
-       fwrite(qword_buf, bp-qword_buf, 1, f);
+       if (fwrite(qword_buf, bp-qword_buf, 1, f) != 1) {
+               xlog_warn("qword_printhex: fwrite failed: errno %d (%s)",
+                       errno, strerror(errno));
+       }
 }
 
 void qword_printint(FILE *f, int num)
@@ -147,15 +154,21 @@ int qword_eol(FILE *f)
 
        fprintf(f,"\n");
        err = fflush(f);
+       if (err) {
+               xlog_warn("qword_eol: fflush failed: errno %d (%s)",
+                           errno, strerror(errno));
+       }
        /*
         * We must send one line (and one line only) in a single write
         * call.  In case of a write error, libc may accumulate the
         * unwritten data and try to write it again later, resulting in a
         * multi-line write.  So we must explicitly ask it to throw away
-        * any such cached data:
+        * any such cached data.  But we return any original error
+        * indication to the caller.
         */
        __fpurge(f);
-       return fflush(f);
+       fflush(f);
+       return err;
 }
 
 
@@ -318,7 +331,10 @@ cache_flush(int force)
                sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]);
                fd = open(path, O_RDWR);
                if (fd >= 0) {
-                       write(fd, stime, strlen(stime));
+                       if (write(fd, stime, strlen(stime)) != strlen(stime)) {
+                               xlog_warn("Writing to '%s' failed: errno %d (%s)",
+                               path, errno, strerror(errno));
+                       }
                        close(fd);
                }
        }
index 5da174928db7192be4be1155d81c315136f2510c..cf1677e78650869a284c8ca550f02ff83845f2bf 100644 (file)
@@ -40,9 +40,9 @@
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 
-#ifdef HAVE_TIRPC_NETCONFIG_H
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpcb_prot.h>
+#ifdef HAVE_LIBTIRPC
+#include <netconfig.h>
+#include <rpc/rpcb_prot.h>
 #endif
 
 #include "nfsrpc.h"
  * Rpcbind's local socket service does not seem to be working.
  * Disable this logic for now.
  */
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
 #undef NFS_GP_LOCAL
-#else  /* HAVE_XDR_RPCB */
+#else  /* !HAVE_LIBTIRPC */
 #undef NFS_GP_LOCAL
-#endif /* HAVE_XDR_RPCB */
+#endif /* !HAVE_LIBTIRPC */
 
-#ifdef HAVE_XDR_RPCB
-const static rpcvers_t default_rpcb_version = RPCBVERS_4;
-#else
-const static rpcvers_t default_rpcb_version = PMAPVERS;
-#endif
+#ifdef HAVE_LIBTIRPC
+static const rpcvers_t default_rpcb_version = RPCBVERS_4;
+#else  /* !HAVE_LIBTIRPC */
+static const rpcvers_t default_rpcb_version = PMAPVERS;
+#endif /* !HAVE_LIBTIRPC */
 
 #ifdef HAVE_DECL_AI_ADDRCONFIG
 /*
@@ -242,7 +242,7 @@ static CLIENT *nfs_gp_get_rpcbclient(const struct sockaddr *sap,
  * Returns a '\0'-terminated string if successful; otherwise NULL.
  * rpc_createerr.cf_stat is set to reflect the error.
  */
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
 
 static char *nfs_gp_get_netid(const sa_family_t family,
                              const unsigned short protocol)
@@ -290,7 +290,7 @@ out:
        return NULL;
 }
 
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
 
 /*
  * Extract a port number from a universal address, and terminate the
@@ -453,7 +453,7 @@ static int nfs_gp_ping(CLIENT *client, struct timeval timeout)
        return (int)(status == RPC_SUCCESS);
 }
 
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
 
 /*
  * Initialize the rpcb argument for a GETADDR request.
@@ -565,7 +565,7 @@ static unsigned short nfs_gp_rpcb_getaddr(CLIENT *client,
        return port;
 }
 
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
 
 /*
  * Try GETPORT request via rpcbind version 2.
@@ -595,7 +595,7 @@ static unsigned long nfs_gp_pmap_getport(CLIENT *client,
        return port;
 }
 
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
 
 static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
                                          const struct sockaddr *sap,
@@ -617,7 +617,7 @@ static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
        return port;
 }
 
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
 
 static unsigned long nfs_gp_getport_pmap(CLIENT *client,
                                         const rpcprog_t program,
@@ -652,11 +652,11 @@ static unsigned short nfs_gp_getport(CLIENT *client,
                                     struct timeval timeout)
 {
        switch (sap->sa_family) {
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
        case AF_INET6:
                return nfs_gp_getport_rpcb(client, sap, salen, program,
                                                version, protocol, timeout);
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
        case AF_INET:
                return nfs_gp_getport_pmap(client, program, version,
                                                        protocol, timeout);
@@ -922,7 +922,7 @@ unsigned short nfs_getlocalport(const rpcprot_t program,
  * address of the same address family.  In this way an RPC server can
  * advertise via rpcbind that it does not support AF_INET6.
  */
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
 
 unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
                                const socklen_t salen,
@@ -955,7 +955,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
        return port;
 }
 
-#else  /* HAVE_XDR_RPCB */
+#else  /* !HAVE_LIBTIRPC */
 
 unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
                                const socklen_t salen,
@@ -971,7 +971,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
        return 0;
 }
 
-#endif /* HAVE_XDR_RPCB */
+#endif /* !HAVE_LIBTIRPC */
 
 /**
  * nfs_pmap_getport - query rpcbind via the portmap protocol (rpcbindv2)
index b7420d1556cded14b7145135d961b10a9e8107e8..85e60641941c19dd2fc9875641c3e10c0ef4b553 100644 (file)
 
 #include "nfsrpc.h"
 
-#ifdef HAVE_TIRPC_NETCONFIG_H
-
-/*
- * Most of the headers under /usr/include/tirpc are currently
- * unusable for various reasons.  We statically define the bits
- * we need here until the official headers are fixed.
- *
- * The commonly used RPC calls such as CLNT_CALL and CLNT_DESTROY
- * are actually virtual functions in both the legacy and TI-RPC
- * implementations.  The proper _CALL or _DESTROY will be invoked
- * no matter if we used a legacy clnt_create() or clnt_tli_create()
- * from libtirpc.
- */
-
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpcb_prot.h>
-
-/* definitions from tirpc/rpc/types.h */
-
-/*
- * The netbuf structure is used for transport-independent address storage.
- */
-struct netbuf {
-       unsigned int    maxlen;
-       unsigned int    len;
-       void            *buf;
-};
-
-/* definitions from tirpc/rpc/clnt.h */
-
-/*
- * Low level clnt create routine for connectionless transports, e.g. udp.
- */
-extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
-                             const rpcprog_t, const rpcvers_t,
-                             const u_int, const u_int);
-
-/*
- * Low level clnt create routine for connectionful transports, e.g. tcp.
- */
-extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
-                             const rpcprog_t, const rpcvers_t,
-                             u_int, u_int);
-
-#endif /* HAVE_TIRPC_NETCONFIG_H */
+#ifdef HAVE_LIBTIRPC
+#include <netconfig.h>
+#include <rpc/rpcb_prot.h>
+#endif /* HAVE_LIBTIRPC */
 
 /*
  * If "-1" is specified in the tv_sec field, use these defaults instead.
@@ -107,14 +66,14 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
                                   const rpcvers_t version,
                                   struct timeval *timeout)
 {
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
        struct sockaddr_storage address;
        const struct netbuf nbuf = {
                .maxlen         = sizeof(struct sockaddr_un),
                .len            = (size_t)salen,
                .buf            = &address,
        };
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* HAVE_LIBTIRPC */
        CLIENT *client;
        int sock;
 
@@ -128,13 +87,13 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
        if (timeout->tv_sec == -1)
                timeout->tv_sec = NFSRPC_TIMEOUT_TCP;
 
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
        memcpy(nbuf.buf, sap, (size_t)salen);
        client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
-#else  /* HAVE_CLNT_VC_CREATE */
+#else  /* !HAVE_LIBTIRPC */
        client = clntunix_create((struct sockaddr_un *)sap,
                                        program, version, &sock, 0, 0);
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
        if (client != NULL)
                CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
        else
@@ -173,6 +132,58 @@ static int nfs_bind(const int sock, const sa_family_t family)
        return -1;
 }
 
+#ifdef IPV6_SUPPORT
+
+/*
+ * Bind a socket using an unused privileged source port.
+ *
+ * Returns zero on success, or returns -1 on error.  errno is
+ * set to reflect the nature of the error.
+ */
+static int nfs_bindresvport(const int sock, const sa_family_t family)
+{
+       struct sockaddr_in sin = {
+               .sin_family             = AF_INET,
+               .sin_addr.s_addr        = htonl(INADDR_ANY),
+       };
+       struct sockaddr_in6 sin6 = {
+               .sin6_family            = AF_INET6,
+               .sin6_addr              = IN6ADDR_ANY_INIT,
+       };
+
+       switch (family) {
+       case AF_INET:
+               return bindresvport_sa(sock, (struct sockaddr *)&sin,
+                                       (socklen_t)sizeof(sin));
+       case AF_INET6:
+               return bindresvport_sa(sock, (struct sockaddr *)&sin6,
+                                       (socklen_t)sizeof(sin6));
+       }
+
+       errno = EAFNOSUPPORT;
+       return -1;
+}
+
+#else  /* !IPV6_SUPPORT */
+
+/*
+ * Bind a socket using an unused privileged source port.
+ *
+ * Returns zero on success, or returns -1 on error.  errno is
+ * set to reflect the nature of the error.
+ */
+static int nfs_bindresvport(const int sock, const sa_family_t family)
+{
+       if (family != AF_INET) {
+               errno = EAFNOSUPPORT;
+               return -1;
+       }
+
+       return bindresvport(sock, NULL);
+}
+
+#endif /* !IPV6_SUPPORT */
+
 /*
  * Perform a non-blocking connect on the socket fd.
  *
@@ -259,25 +270,26 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
                                 const socklen_t salen,
                                 const rpcprog_t program,
                                 const rpcvers_t version,
-                                struct timeval *timeout)
+                                struct timeval *timeout,
+                                const int resvport)
 {
-#ifdef HAVE_CLNT_DG_CREATE
+       CLIENT *client;
+       int ret, sock;
+#ifdef HAVE_LIBTIRPC
        struct sockaddr_storage address;
        const struct netbuf nbuf = {
                .maxlen         = salen,
                .len            = salen,
                .buf            = &address,
        };
-#endif /* HAVE_CLNT_DG_CREATE */
-       CLIENT *client;
-       int ret, sock;
 
-#ifndef HAVE_CLNT_DG_CREATE
+#else  /* !HAVE_LIBTIRPC */
+
        if (sap->sa_family != AF_INET) {
                rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
                return NULL;
        }
-#endif /* !HAVE_CLNT_DG_CREATE */
+#endif /* !HAVE_LIBTIRPC */
 
        sock = socket((int)sap->sa_family, SOCK_DGRAM, IPPROTO_UDP);
        if (sock == -1) {
@@ -286,7 +298,10 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
                return NULL;
        }
 
-       ret = nfs_bind(sock, sap->sa_family);
+       if (resvport)
+               ret = nfs_bindresvport(sock, sap->sa_family);
+       else
+               ret = nfs_bind(sock, sap->sa_family);
        if (ret < 0) {
                rpc_createerr.cf_stat = RPC_SYSTEMERROR;
                rpc_createerr.cf_error.re_errno = errno;
@@ -305,13 +320,13 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
                return NULL;
        }
 
-#ifdef HAVE_CLNT_DG_CREATE
+#ifdef HAVE_LIBTIRPC
        memcpy(nbuf.buf, sap, (size_t)salen);
        client = clnt_dg_create(sock, &nbuf, program, version, 0, 0);
-#else  /* HAVE_CLNT_DG_CREATE */
+#else  /* !HAVE_LIBTIRPC */
        client = clntudp_create((struct sockaddr_in *)sap, program,
                                        version, *timeout, &sock);
-#endif /* HAVE_CLNT_DG_CREATE */
+#endif /* !HAVE_LIBTIRPC */
        if (client != NULL) {
                CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)timeout);
                CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
@@ -335,25 +350,26 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
                                 const socklen_t salen,
                                 const rpcprog_t program,
                                 const rpcvers_t version,
-                                struct timeval *timeout)
+                                struct timeval *timeout,
+                                const int resvport)
 {
-#ifdef HAVE_CLNT_VC_CREATE
+       CLIENT *client;
+       int ret, sock;
+#ifdef HAVE_LIBTIRPC
        struct sockaddr_storage address;
        const struct netbuf nbuf = {
                .maxlen         = salen,
                .len            = salen,
                .buf            = &address,
        };
-#endif /* HAVE_CLNT_VC_CREATE */
-       CLIENT *client;
-       int ret, sock;
 
-#ifndef HAVE_CLNT_VC_CREATE
+#else  /* !HAVE_LIBTIRPC */
+
        if (sap->sa_family != AF_INET) {
                rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
                return NULL;
        }
-#endif /* !HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
 
        sock = socket((int)sap->sa_family, SOCK_STREAM, IPPROTO_TCP);
        if (sock == -1) {
@@ -362,7 +378,10 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
                return NULL;
        }
 
-       ret = nfs_bind(sock, sap->sa_family);
+       if (resvport)
+               ret = nfs_bindresvport(sock, sap->sa_family);
+       else
+               ret = nfs_bind(sock, sap->sa_family);
        if (ret < 0) {
                rpc_createerr.cf_stat = RPC_SYSTEMERROR;
                rpc_createerr.cf_error.re_errno = errno;
@@ -381,13 +400,13 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
                return NULL;
        }
 
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
        memcpy(nbuf.buf, sap, (size_t)salen);
        client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
-#else  /* HAVE_CLNT_VC_CREATE */
+#else  /* !HAVE_LIBTIRPC */
        client = clnttcp_create((struct sockaddr_in *)sap,
                                        program, version, &sock, 0, 0);
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
        if (client != NULL)
                CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
        else
@@ -406,7 +425,8 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
  * @timeout: pointer to request timeout (must not be NULL)
  *
  * Set up an RPC client for communicating with an RPC program @program
- * and @version on the server @sap over @transport.
+ * and @version on the server @sap over @transport.  An unprivileged
+ * source port is used.
  *
  * Returns a pointer to a prepared RPC client if successful, and
  * @timeout is initialized; caller must destroy a non-NULL returned RPC
@@ -446,10 +466,75 @@ CLIENT *nfs_get_rpcclient(const struct sockaddr *sap,
 
        switch (transport) {
        case IPPROTO_TCP:
-               return nfs_get_tcpclient(sap, salen, program, version, timeout);
+               return nfs_get_tcpclient(sap, salen, program, version,
+                                               timeout, 0);
+       case 0:
+       case IPPROTO_UDP:
+               return nfs_get_udpclient(sap, salen, program, version,
+                                               timeout, 0);
+       }
+
+       rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
+       return NULL;
+}
+
+/**
+ * nfs_get_priv_rpcclient - acquire an RPC client
+ * @sap: pointer to socket address of RPC server
+ * @salen: length of socket address
+ * @transport: IPPROTO_ value of transport protocol to use
+ * @program: RPC program number
+ * @version: RPC version number
+ * @timeout: pointer to request timeout (must not be NULL)
+ *
+ * Set up an RPC client for communicating with an RPC program @program
+ * and @version on the server @sap over @transport.  A privileged
+ * source port is used.
+ *
+ * Returns a pointer to a prepared RPC client if successful, and
+ * @timeout is initialized; caller must destroy a non-NULL returned RPC
+ * client.  Otherwise returns NULL, and rpc_createerr.cf_stat is set to
+ * reflect the error.
+ */
+CLIENT *nfs_get_priv_rpcclient(const struct sockaddr *sap,
+                              const socklen_t salen,
+                              const unsigned short transport,
+                              const rpcprog_t program,
+                              const rpcvers_t version,
+                              struct timeval *timeout)
+{
+       struct sockaddr_in *sin = (struct sockaddr_in *)sap;
+       struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
+
+       switch (sap->sa_family) {
+       case AF_LOCAL:
+               return nfs_get_localclient(sap, salen, program,
+                                               version, timeout);
+       case AF_INET:
+               if (sin->sin_port == 0) {
+                       rpc_createerr.cf_stat = RPC_UNKNOWNADDR;
+                       return NULL;
+               }
+               break;
+       case AF_INET6:
+               if (sin6->sin6_port == 0) {
+                       rpc_createerr.cf_stat = RPC_UNKNOWNADDR;
+                       return NULL;
+               }
+               break;
+       default:
+               rpc_createerr.cf_stat = RPC_UNKNOWNHOST;
+               return NULL;
+       }
+
+       switch (transport) {
+       case IPPROTO_TCP:
+               return nfs_get_tcpclient(sap, salen, program, version,
+                                               timeout, 1);
        case 0:
        case IPPROTO_UDP:
-               return nfs_get_udpclient(sap, salen, program, version, timeout);
+               return nfs_get_udpclient(sap, salen, program, version,
+                                               timeout, 1);
        }
 
        rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
index f21f5f058f9d15c5fdccb601cc68e7a44fab4a7f..5e2e1e95e7228d42ef81ed8b1f44bc7cc2db2d13 100644 (file)
@@ -17,6 +17,7 @@
 #include <ctype.h>
 #include <signal.h>
 #include <unistd.h>
+#include <errno.h>
 #include "xmalloc.h"
 #include "xlog.h"
 #include "xio.h"
@@ -54,16 +55,16 @@ xflock(char *fname, char *type)
 {
        struct sigaction sa, oldsa;
        int             readonly = !strcmp(type, "r");
-       mode_t  mode = (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
        struct flock    fl = { readonly? F_RDLCK : F_WRLCK, SEEK_SET, 0, 0, 0 };
        int             fd;
 
        if (readonly)
-               fd = open(fname, O_RDONLY);
+               fd = open(fname, (O_RDONLY|O_CREAT), 0600);
        else
-               fd = open(fname, (O_RDWR|O_CREAT), mode);
+               fd = open(fname, (O_RDWR|O_CREAT), 0600);
        if (fd < 0) {
-               xlog(L_WARNING, "could not open %s for locking", fname);
+               xlog(L_WARNING, "could not open %s for locking: errno %d (%s)",
+                               fname, errno, strerror(errno));
                return -1;
        }
 
@@ -74,7 +75,8 @@ xflock(char *fname, char *type)
        alarm(10);
        if (fcntl(fd, F_SETLKW, &fl) < 0) {
                alarm(0);
-               xlog(L_WARNING, "failed to lock %s", fname);
+               xlog(L_WARNING, "failed to lock %s: errno %d (%s)",
+                               fname, errno, strerror(errno));
                close(fd);
                fd = 0;
        } else {
index 41d542083e5b8b6370d1fd895cd90eccc40d358c..d0225b9ada989727bcbb94f158291cb71efb9714 100644 (file)
@@ -36,9 +36,15 @@ subdir = tools
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -66,6 +72,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -178,7 +185,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index bedfe46d2b372b8d13329b9cc2824bb958623b29..e56aebc8ac2d6b34179d1c2899927182d10743bf 100644 (file)
@@ -37,9 +37,15 @@ subdir = tools/locktest
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -76,6 +82,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -188,7 +195,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index b392f711fcb9eea9edfc3b62e42ae7750bfa2c35..82ed7657051d381e3e437a2dbcf0b4ba0005365e 100644 (file)
@@ -81,7 +81,7 @@ main(int argc, char **argv)
                if (fl.l_type == F_UNLCK) {
                        printf("%s: no conflicting lock\n", fname);
                } else {
-                       printf("%s: conflicting lock by %d on (%ld;%ld)\n",
+                       printf("%s: conflicting lock by %d on (%lld;%lld)\n",
                                fname, fl.l_pid, fl.l_start, fl.l_len);
                }
                return 0;
index ab2f269d742efc9f47a00df80753839ad86ed911..101f42fb78ef3d5eb610e77c41dc581cc90afe72 100644 (file)
@@ -35,9 +35,15 @@ subdir = tools/nlmtest
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -53,6 +59,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -165,7 +172,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index ae422f043d1655fccb2603ac0c722c7119147d18..858977405610426c7a5198d230173229be02efa6 100644 (file)
@@ -37,9 +37,15 @@ subdir = tools/rpcdebug
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,6 +87,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -193,7 +200,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 10ee6bfd17effa2aa4012de6f53971f5bf77225d..dc2817c8dbae3030348460941d31abe03b362e4f 100644 (file)
@@ -37,9 +37,15 @@ subdir = tools/rpcgen
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,6 +87,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -193,7 +200,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index fd94c2594e74cbb10a05882472a9c9587f993d78..69d1309ba461ee1cbb442258571835997ab51b96 100644 (file)
@@ -38,9 +38,15 @@ subdir = utils
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,6 +75,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -181,7 +188,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 2434e8dc3bb71606f3a459ad2d5e33cad83e325a..a93c3e8816d25a0ccc393da84cee7b67a2b6a65d 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/exportfs
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -84,6 +90,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -196,7 +203,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index e42b33972ee6eec15195ff5854cad2e1c5451e95..95a2bd0f8c6cc21247d71549680b04a52f01772e 100644 (file)
@@ -39,11 +39,11 @@ gssd_SOURCES = \
        write_bytes.h
 
 gssd_LDADD =   ../../support/nfs/libnfs.a \
-               $(RPCSECGSS_LIBS) $(KRBLIBS)
+               $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
 gssd_LDFLAGS = $(KRBLDFLAGS)
 
 gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-             $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+             $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 svcgssd_SOURCES = \
        $(COMMON_SRCS) \
@@ -56,18 +56,18 @@ svcgssd_SOURCES = \
 
 svcgssd_LDADD = \
        ../../support/nfs/libnfs.a \
-       $(RPCSECGSS_LIBS) -lnfsidmap \
+       $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
        $(KRBLIBS)
 
 svcgssd_LDFLAGS = $(KRBLDFLAGS)
 
 svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
 
 gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 MAINTAINERCLEANFILES = Makefile.in
 
index 00e6712c5c80eab94e250068f3c8b485b30d187c..9803c53e07d505b843fd89a4cf7db49670cd210b 100644 (file)
@@ -38,9 +38,15 @@ subdir = utils/gssd
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -71,7 +77,7 @@ am_gssd_OBJECTS = $(am__objects_1) gssd-gssd.$(OBJEXT) \
 gssd_OBJECTS = $(am_gssd_OBJECTS)
 am__DEPENDENCIES_1 =
 gssd_DEPENDENCIES = ../../support/nfs/libnfs.a $(am__DEPENDENCIES_1) \
-       $(am__DEPENDENCIES_1)
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 gssd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(gssd_CFLAGS) $(CFLAGS) $(gssd_LDFLAGS) \
        $(LDFLAGS) -o $@
@@ -87,7 +93,8 @@ am_svcgssd_OBJECTS = $(am__objects_2) svcgssd-svcgssd.$(OBJEXT) \
        svcgssd-svcgssd_proc.$(OBJEXT)
 svcgssd_OBJECTS = $(am_svcgssd_OBJECTS)
 svcgssd_DEPENDENCIES = ../../support/nfs/libnfs.a \
-       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1)
 svcgssd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(svcgssd_CFLAGS) $(CFLAGS) \
        $(svcgssd_LDFLAGS) $(LDFLAGS) -o $@
@@ -120,6 +127,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -232,7 +240,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -302,11 +309,11 @@ gssd_SOURCES = \
        write_bytes.h
 
 gssd_LDADD = ../../support/nfs/libnfs.a \
-               $(RPCSECGSS_LIBS) $(KRBLIBS)
+               $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
 
 gssd_LDFLAGS = $(KRBLDFLAGS)
 gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-             $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+             $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 svcgssd_SOURCES = \
        $(COMMON_SRCS) \
@@ -319,16 +326,16 @@ svcgssd_SOURCES = \
 
 svcgssd_LDADD = \
        ../../support/nfs/libnfs.a \
-       $(RPCSECGSS_LIBS) -lnfsidmap \
+       $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
        $(KRBLIBS)
 
 svcgssd_LDFLAGS = $(KRBLDFLAGS)
 svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
 gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
-                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
 
 MAINTAINERCLEANFILES = Makefile.in
 all: all-am
index ddf064d3974d537714c3d0ccb4f7ac3f4d3560eb..6f3b8fd03f37e12a048337eed1d0d80e3bdb3224 100644 (file)
@@ -69,19 +69,19 @@ int write_heimdal_enc_key(char **p, char *end, gss_ctx_id_t ctx)
        krb5_context context;
        krb5_error_code ret;
        int i;
-       char *skd, *dkd;
+       char *skd, *dkd, *k5err = NULL;
        int code = -1;
 
        if ((ret = krb5_init_context(&context))) {
-               printerr(0, "ERROR: initializing krb5_context: %s\n",
-                       gssd_k5_err_msg(NULL, ret));
+               k5err = gssd_k5_err_msg(NULL, ret);
+               printerr(0, "ERROR: initializing krb5_context: %s\n", k5err);
                goto out_err;
        }
 
        if ((ret = krb5_auth_con_getlocalsubkey(context,
                                                ctx->auth_context, &key))){
-               printerr(0, "ERROR: getting auth_context key: %s\n",
-                       gssd_k5_err_msg(context, ret));
+               k5err = gssd_k5_err_msg(context, ret);
+               printerr(0, "ERROR: getting auth_context key: %s\n", k5err);
                goto out_err_free_context;
        }
 
@@ -97,9 +97,9 @@ int write_heimdal_enc_key(char **p, char *end, gss_ctx_id_t ctx)
        enc_key.keyvalue.length = key->keyvalue.length;
        if ((enc_key.keyvalue.data =
                                calloc(1, enc_key.keyvalue.length)) == NULL) {
-
+               k5err = gssd_k5_err_msg(context, ENOMEM);
                printerr(0, "ERROR: allocating memory for enc key: %s\n",
-                       gssd_k5_err_msg(context, ENOMEM));
+                        k5err);
                goto out_err_free_key;
        }
        skd = (char *) key->keyvalue.data;
@@ -119,6 +119,7 @@ int write_heimdal_enc_key(char **p, char *end, gss_ctx_id_t ctx)
     out_err_free_context:
        krb5_free_context(context);
     out_err:
+       free(k5err);
        printerr(2, "write_heimdal_enc_key: %s\n", code ? "FAILED" : "SUCCESS");
        return(code);
 }
@@ -128,18 +129,19 @@ int write_heimdal_seq_key(char **p, char *end, gss_ctx_id_t ctx)
        krb5_keyblock *key;
        krb5_context context;
        krb5_error_code ret;
+       char *k5err = NULL;
        int code = -1;
 
        if ((ret = krb5_init_context(&context))) {
-               printerr(0, "ERROR: initializing krb5_context: %s\n",
-                       gssd_k5_err_msg(NULL, ret));
+               k5err = gssd_k5_err_msg(NULL, ret);
+               printerr(0, "ERROR: initializing krb5_context: %s\n", k5err);
                goto out_err;
        }
 
        if ((ret = krb5_auth_con_getlocalsubkey(context,
                                                ctx->auth_context, &key))){
-               printerr(0, "ERROR: getting auth_context key: %s\n",
-                       gssd_k5_err_msg(context, ret));
+               k5err = gssd_k5_err_msg(context, ret);
+               printerr(0, "ERROR: getting auth_context key: %s\n", k5err);
                goto out_err_free_context;
        }
 
@@ -162,6 +164,7 @@ int write_heimdal_seq_key(char **p, char *end, gss_ctx_id_t ctx)
     out_err_free_context:
        krb5_free_context(context);
     out_err:
+       free(k5err);
        printerr(2, "write_heimdal_seq_key: %s\n", code ? "FAILED" : "SUCCESS");
        return(code);
 }
index af7de589160448d028bfd6783dd86660ac785f93..4a682ae351273021f37197e6255a74fd10352587 100644 (file)
@@ -70,9 +70,10 @@ static int
 prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
        gss_buffer_desc *buf, int32_t *endtime)
 {
+#define FAKESEED_SIZE 16
        char *p, *end;
        static int constant_zero = 0;
-       unsigned char fakeseed[16];
+       unsigned char fakeseed[FAKESEED_SIZE];
        uint32_t word_send_seq;
        gss_krb5_lucid_key_t enc_key;
        int i;
@@ -88,6 +89,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
         */
        memset(&enc_key, 0, sizeof(enc_key));
        memset(&fakeoid, 0, sizeof(fakeoid));
+       memset(fakeseed, 0, FAKESEED_SIZE);
 
        if (!(buf->value = calloc(1, MAX_CTX_LEN)))
                goto out_err;
@@ -98,7 +100,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
 
        /* seed_init and seed not used by kernel anyway */
        if (WRITE_BYTES(&p, end, constant_zero)) goto out_err;
-       if (write_bytes(&p, end, &fakeseed, 16)) goto out_err;
+       if (write_bytes(&p, end, &fakeseed, FAKESEED_SIZE)) goto out_err;
 
        if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.sign_alg)) goto out_err;
        if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.seal_alg)) goto out_err;
index 082039a6783ba1343d480d0ebefc41eb19489347..3c52f46699de9ee1bd2ddcd6388f460b17ebf943 100644 (file)
@@ -83,7 +83,7 @@ struct clnt_info {
        int                     krb5_poll_index;
        int                     spkm3_fd;
        int                     spkm3_poll_index;
-       int                     port;
+       struct sockaddr_storage addr;
 };
 
 void init_client_list(void);
index d0d3f7ffa219b03501e5079f85d759c619013a5f..02239d29776ea769f161962870d5bebe8bb62b50 100644 (file)
@@ -70,9 +70,9 @@
 #include "gssd.h"
 #include "err_util.h"
 #include "gss_util.h"
-#include "gss_oids.h"
 #include "krb5_util.h"
 #include "context.h"
+#include "nfsrpc.h"
 
 /*
  * pollarray:
@@ -103,12 +103,90 @@ struct pollfd * pollarray;
 
 int pollsize;  /* the size of pollaray (in pollfd's) */
 
+/*
+ * convert a presentation address string to a sockaddr_storage struct. Returns
+ * true on success and false on failure.
+ *
+ * Note that we do not populate the sin6_scope_id field here for IPv6 addrs.
+ * gssd nececessarily relies on hostname resolution and DNS AAAA records
+ * do not generally contain scope-id's. This means that GSSAPI auth really
+ * can't work with IPv6 link-local addresses.
+ *
+ * We *could* consider changing this if we did something like adopt the
+ * Microsoft "standard" of using the ipv6-literal.net domainname, but it's
+ * not really feasible at present.
+ */
+static int
+addrstr_to_sockaddr(struct sockaddr *sa, const char *addr, const int port)
+{
+       struct sockaddr_in      *s4 = (struct sockaddr_in *) sa;
+#ifdef IPV6_SUPPORTED
+       struct sockaddr_in6     *s6 = (struct sockaddr_in6 *) sa;
+#endif /* IPV6_SUPPORTED */
+
+       if (inet_pton(AF_INET, addr, &s4->sin_addr)) {
+               s4->sin_family = AF_INET;
+               s4->sin_port = htons(port);
+#ifdef IPV6_SUPPORTED
+       } else if (inet_pton(AF_INET6, addr, &s6->sin6_addr)) {
+               s6->sin6_family = AF_INET6;
+               s6->sin6_port = htons(port);
+#endif /* IPV6_SUPPORTED */
+       } else {
+               printerr(0, "ERROR: unable to convert %s to address\n", addr);
+               return 0;
+       }
+
+       return 1;
+}
+
+/*
+ * convert a sockaddr to a hostname
+ */
+static char *
+sockaddr_to_hostname(const struct sockaddr *sa, const char *addr)
+{
+       socklen_t               addrlen;
+       int                     err;
+       char                    *hostname;
+       char                    hbuf[NI_MAXHOST];
+
+       switch (sa->sa_family) {
+       case AF_INET:
+               addrlen = sizeof(struct sockaddr_in);
+               break;
+#ifdef IPV6_SUPPORTED
+       case AF_INET6:
+               addrlen = sizeof(struct sockaddr_in6);
+               break;
+#endif /* IPV6_SUPPORTED */
+       default:
+               printerr(0, "ERROR: unrecognized addr family %d\n",
+                        sa->sa_family);
+               return NULL;
+       }
+
+       err = getnameinfo(sa, addrlen, hbuf, sizeof(hbuf), NULL, 0,
+                         NI_NAMEREQD);
+       if (err) {
+               printerr(0, "ERROR: unable to resolve %s to hostname: %s\n",
+                        addr, err == EAI_SYSTEM ? strerror(err) :
+                                                  gai_strerror(err));
+               return NULL;
+       }
+
+       hostname = strdup(hbuf);
+
+       return hostname;
+}
+
 /* XXX buffer problems: */
 static int
 read_service_info(char *info_file_name, char **servicename, char **servername,
-                 int *prog, int *vers, char **protocol, int *port) {
+                 int *prog, int *vers, char **protocol,
+                 struct sockaddr *addr) {
 #define INFOBUFLEN 256
-       char            buf[INFOBUFLEN];
+       char            buf[INFOBUFLEN + 1];
        static char     dummy[128];
        int             nbytes;
        static char     service[128];
@@ -118,10 +196,9 @@ read_service_info(char *info_file_name, char **servicename, char **servername,
        char            protoname[16];
        char            cb_port[128];
        char            *p;
-       in_addr_t       inaddr;
        int             fd = -1;
-       struct hostent  *ent = NULL;
        int             numfields;
+       int             port = 0;
 
        *servicename = *servername = *protocol = NULL;
 
@@ -133,6 +210,7 @@ read_service_info(char *info_file_name, char **servicename, char **servername,
        if ((nbytes = read(fd, buf, INFOBUFLEN)) == -1)
                goto fail;
        close(fd);
+       buf[nbytes] = '\0';
 
        numfields = sscanf(buf,"RPC server: %127s\n"
                   "service: %127s %15s version %15s\n"
@@ -160,21 +238,26 @@ read_service_info(char *info_file_name, char **servicename, char **servername,
        if((*prog != 100003) || ((*vers != 2) && (*vers != 3) && (*vers != 4)))
                goto fail;
 
-       /* create service name */
-       inaddr = inet_addr(address);
-       if (!(ent = gethostbyaddr(&inaddr, sizeof(inaddr), AF_INET))) {
-               printerr(0, "ERROR: can't resolve server %s name\n", address);
-               goto fail;
+       if (cb_port[0] != '\0') {
+               port = atoi(cb_port);
+               if (port < 0 || port > 65535)
+                       goto fail;
        }
-       if (!(*servername = calloc(strlen(ent->h_name) + 1, 1)))
+
+       if (!addrstr_to_sockaddr(addr, address, port))
                goto fail;
-       memcpy(*servername, ent->h_name, strlen(ent->h_name));
-       snprintf(buf, INFOBUFLEN, "%s@%s", service, ent->h_name);
+
+       *servername = sockaddr_to_hostname(addr, address);
+       if (*servername == NULL)
+               goto fail;
+
+       nbytes = snprintf(buf, INFOBUFLEN, "%s@%s", service, *servername);
+       if (nbytes > INFOBUFLEN)
+               goto fail;
+
        if (!(*servicename = calloc(strlen(buf) + 1, 1)))
                goto fail;
        memcpy(*servicename, buf, strlen(buf));
-       if (cb_port[0] != '\0')
-               *port = atoi(cb_port);
 
        if (!(*protocol = strdup(protoname)))
                goto fail;
@@ -182,9 +265,10 @@ read_service_info(char *info_file_name, char **servicename, char **servername,
 fail:
        printerr(0, "ERROR: failed to read service info\n");
        if (fd != -1) close(fd);
-       if (*servername) free(*servername);
-       if (*servicename) free(*servicename);
-       if (*protocol) free(*protocol);
+       free(*servername);
+       free(*servicename);
+       free(*protocol);
+       *servicename = *servername = *protocol = NULL;
        return -1;
 }
 
@@ -200,10 +284,10 @@ destroy_client(struct clnt_info *clp)
        if (clp->dir_fd != -1) close(clp->dir_fd);
        if (clp->krb5_fd != -1) close(clp->krb5_fd);
        if (clp->spkm3_fd != -1) close(clp->spkm3_fd);
-       if (clp->dirname) free(clp->dirname);
-       if (clp->servicename) free(clp->servicename);
-       if (clp->servername) free(clp->servername);
-       if (clp->protocol) free(clp->protocol);
+       free(clp->dirname);
+       free(clp->servicename);
+       free(clp->servername);
+       free(clp->protocol);
        free(clp);
 }
 
@@ -250,7 +334,7 @@ process_clnt_dir_files(struct clnt_info * clp)
        if ((clp->servicename == NULL) &&
             read_service_info(info_file_name, &clp->servicename,
                                &clp->servername, &clp->prog, &clp->vers,
-                               &clp->protocol, &clp->port))
+                               &clp->protocol, (struct sockaddr *) &clp->addr))
                return -1;
        return 0;
 }
@@ -479,6 +563,91 @@ out_err:
        return -1;
 }
 
+/*
+ * If the port isn't already set, do an rpcbind query to the remote server
+ * using the program and version and get the port. 
+ *
+ * Newer kernels send the value of the port= mount option in the "info"
+ * file for the upcall or '0' for NFSv2/3. For NFSv4 it sends the value
+ * of the port= option or '2049'. The port field in a new sockaddr should
+ * reflect the value that was sent by the kernel.
+ */
+static int
+populate_port(struct sockaddr *sa, const socklen_t salen,
+             const rpcprog_t program, const rpcvers_t version,
+             const unsigned short protocol)
+{
+       struct sockaddr_in      *s4 = (struct sockaddr_in *) sa;
+#ifdef IPV6_SUPPORTED
+       struct sockaddr_in6     *s6 = (struct sockaddr_in6 *) sa;
+#endif /* IPV6_SUPPORTED */
+       unsigned short          port;
+
+       /*
+        * Newer kernels send the port in the upcall. If we already have
+        * the port, there's no need to look it up.
+        */
+       switch (sa->sa_family) {
+       case AF_INET:
+               if (s4->sin_port != 0) {
+                       printerr(2, "DEBUG: port already set to %d\n",
+                                ntohs(s4->sin_port));
+                       return 1;
+               }
+               break;
+#ifdef IPV6_SUPPORTED
+       case AF_INET6:
+               if (s6->sin6_port != 0) {
+                       printerr(2, "DEBUG: port already set to %d\n",
+                                ntohs(s6->sin6_port));
+                       return 1;
+               }
+               break;
+#endif /* IPV6_SUPPORTED */
+       default:
+               printerr(0, "ERROR: unsupported address family %d\n",
+                           sa->sa_family);
+               return 0;
+       }
+
+       /*
+        * Newer kernels that send the port in the upcall set the value to
+        * 2049 for NFSv4 mounts when one isn't specified. The check below is
+        * only for kernels that don't send the port in the upcall. For those
+        * we either have to do an rpcbind query or set it to the standard
+        * port. Doing a query could be problematic (firewalls, etc), so take
+        * the latter approach.
+        */
+       if (program == 100003 && version == 4) {
+               port = 2049;
+               goto set_port;
+       }
+
+       port = nfs_getport(sa, salen, program, version, protocol);
+       if (!port) {
+               printerr(0, "ERROR: unable to obtain port for prog %ld "
+                           "vers %ld\n", program, version);
+               return 0;
+       }
+
+set_port:
+       printerr(2, "DEBUG: setting port to %hu for prog %lu vers %lu\n", port,
+                program, version);
+
+       switch (sa->sa_family) {
+       case AF_INET:
+               s4->sin_port = htons(port);
+               break;
+#ifdef IPV6_SUPPORTED
+       case AF_INET6:
+               s6->sin6_port = htons(port);
+               break;
+#endif /* IPV6_SUPPORTED */
+       }
+
+       return 1;
+}
+
 /*
  * Create an RPC connection and establish an authenticated
  * gss context with a server.
@@ -494,14 +663,12 @@ int create_auth_rpc_client(struct clnt_info *clp,
        AUTH                    *auth = NULL;
        uid_t                   save_uid = -1;
        int                     retval = -1;
-       int                     errcode;
        OM_uint32               min_stat;
        char                    rpc_errmsg[1024];
-       int                     sockp = RPC_ANYSOCK;
-       int                     sendsz = 32768, recvsz = 32768;
-       struct addrinfo         ai_hints, *a = NULL;
-       char                    service[64];
-       char                    *at_sign;
+       int                     protocol;
+       struct timeval          timeout = {5, 0};
+       struct sockaddr         *addr = (struct sockaddr *) &clp->addr;
+       socklen_t               salen;
 
        /* Create the context as the user (not as root) */
        save_uid = geteuid();
@@ -555,15 +722,10 @@ int create_auth_rpc_client(struct clnt_info *clp,
        printerr(2, "creating %s client for server %s\n", clp->protocol,
                        clp->servername);
 
-       memset(&ai_hints, '\0', sizeof(ai_hints));
-       ai_hints.ai_family = PF_INET;
-       ai_hints.ai_flags |= AI_CANONNAME;
        if ((strcmp(clp->protocol, "tcp")) == 0) {
-               ai_hints.ai_socktype = SOCK_STREAM;
-               ai_hints.ai_protocol = IPPROTO_TCP;
+               protocol = IPPROTO_TCP;
        } else if ((strcmp(clp->protocol, "udp")) == 0) {
-               ai_hints.ai_socktype = SOCK_DGRAM;
-               ai_hints.ai_protocol = IPPROTO_UDP;
+               protocol = IPPROTO_UDP;
        } else {
                printerr(0, "WARNING: unrecognized protocol, '%s', requested "
                         "for connection to server %s for user with uid %d\n",
@@ -571,72 +733,36 @@ int create_auth_rpc_client(struct clnt_info *clp,
                goto out_fail;
        }
 
-       /* extract the service name from clp->servicename */
-       if ((at_sign = strchr(clp->servicename, '@')) == NULL) {
-               printerr(0, "WARNING: servicename (%s) not formatted as "
-                       "expected with service@host\n", clp->servicename);
+       switch (addr->sa_family) {
+       case AF_INET:
+               salen = sizeof(struct sockaddr_in);
+               break;
+#ifdef IPV6_SUPPORTED
+       case AF_INET6:
+               salen = sizeof(struct sockaddr_in6);
+               break;
+#endif /* IPV6_SUPPORTED */
+       default:
+               printerr(1, "ERROR: Unknown address family %d\n",
+                        addr->sa_family);
                goto out_fail;
        }
-       if ((at_sign - clp->servicename) >= sizeof(service)) {
-               printerr(0, "WARNING: service portion of servicename (%s) "
-                       "is too long!\n", clp->servicename);
-               goto out_fail;
-       }
-       strncpy(service, clp->servicename, at_sign - clp->servicename);
-       service[at_sign - clp->servicename] = '\0';
 
-       errcode = getaddrinfo(clp->servername, service, &ai_hints, &a);
-       if (errcode) {
-               printerr(0, "WARNING: Error from getaddrinfo for server "
-                        "'%s': %s\n", clp->servername, gai_strerror(errcode));
+       if (!populate_port(addr, salen, clp->prog, clp->vers, protocol))
                goto out_fail;
-       }
 
-       if (a == NULL) {
-               printerr(0, "WARNING: No address information found for "
-                        "connection to server %s for user with uid %d\n",
+       rpc_clnt = nfs_get_rpcclient(addr, salen, protocol, clp->prog,
+                                    clp->vers, &timeout);
+       if (!rpc_clnt) {
+               snprintf(rpc_errmsg, sizeof(rpc_errmsg),
+                        "WARNING: can't create %s rpc_clnt to server %s for "
+                        "user with uid %d",
+                        protocol == IPPROTO_TCP ? "tcp" : "udp",
                         clp->servername, uid);
+               printerr(0, "%s\n",
+                        clnt_spcreateerror(rpc_errmsg));
                goto out_fail;
        }
-       if (clp->port)
-               ((struct sockaddr_in *)a->ai_addr)->sin_port = htons(clp->port);
-       if (a->ai_protocol == IPPROTO_TCP) {
-               if ((rpc_clnt = clnttcp_create(
-                                       (struct sockaddr_in *) a->ai_addr,
-                                       clp->prog, clp->vers, &sockp,
-                                       sendsz, recvsz)) == NULL) {
-                       snprintf(rpc_errmsg, sizeof(rpc_errmsg),
-                                "WARNING: can't create tcp rpc_clnt "
-                                "for server %s for user with uid %d",
-                                clp->servername, uid);
-                       printerr(0, "%s\n",
-                                clnt_spcreateerror(rpc_errmsg));
-                       goto out_fail;
-               }
-       } else if (a->ai_protocol == IPPROTO_UDP) {
-               const struct timeval timeout = {5, 0};
-               if ((rpc_clnt = clntudp_bufcreate(
-                                       (struct sockaddr_in *) a->ai_addr,
-                                       clp->prog, clp->vers, timeout,
-                                       &sockp, sendsz, recvsz)) == NULL) {
-                       snprintf(rpc_errmsg, sizeof(rpc_errmsg),
-                                "WARNING: can't create udp rpc_clnt "
-                                "for server %s for user with uid %d",
-                                clp->servername, uid);
-                       printerr(0, "%s\n",
-                                clnt_spcreateerror(rpc_errmsg));
-                       goto out_fail;
-               }
-       } else {
-               /* Shouldn't happen! */
-               printerr(0, "ERROR: requested protocol '%s', but "
-                        "got addrinfo with protocol %d\n",
-                        clp->protocol, a->ai_protocol);
-               goto out_fail;
-       }
-       /* We're done with this */
-       freeaddrinfo(a);
-       a = NULL;
 
        printerr(2, "creating context with server %s\n", clp->servicename);
        auth = authgss_create_default(rpc_clnt, clp->servicename, &sec);
@@ -658,7 +784,6 @@ int create_auth_rpc_client(struct clnt_info *clp,
   out:
        if (sec.cred != GSS_C_NO_CREDENTIAL)
                gss_release_cred(&min_stat, &sec.cred);
-       if (a != NULL) freeaddrinfo(a);
        /* Restore euid to original value */
        if ((save_uid != -1) && (setfsuid(save_uid) != uid)) {
                printerr(0, "WARNING: Failed to restore fsuid"
@@ -778,8 +903,10 @@ handle_krb5_upcall(struct clnt_info *clp)
 out:
        if (token.value)
                free(token.value);
+#ifndef HAVE_LIBTIRPC
        if (pd.pd_ctx_hndl.length != 0)
                authgss_free_private_data(&pd);
+#endif
        if (auth)
                AUTH_DESTROY(auth);
        if (rpc_clnt)
index 8923b3bc56227d5f626e9ba6c238d629cef69630..3009cc57b24f00ec83393b55e32578eb05b49eb2 100644 (file)
 #include "gssd.h"
 #include "err_util.h"
 #include "gss_util.h"
-#include "gss_oids.h"
 #include "krb5_util.h"
 
 /* Global list of principals/cache file names for machine credentials */
@@ -376,6 +375,7 @@ gssd_get_single_krb5_cred(krb5_context context,
        time_t now = time(0);
        char *cache_type;
        char *pname = NULL;
+       char *k5err = NULL;
 
        memset(&my_creds, 0, sizeof(my_creds));
 
@@ -398,8 +398,8 @@ gssd_get_single_krb5_cred(krb5_context context,
 #if HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS
        code = krb5_get_init_creds_opt_alloc(context, &init_opts);
        if (code) {
-               printerr(0, "ERROR: %s allocating gic options\n",
-                        gssd_k5_err_msg(context, code));
+               k5err = gssd_k5_err_msg(context, code);
+               printerr(0, "ERROR: %s allocating gic options\n", k5err);
                goto out;
        }
        if (krb5_get_init_creds_opt_set_addressless(context, init_opts, 1))
@@ -426,9 +426,9 @@ gssd_get_single_krb5_cred(krb5_context context,
 
        if ((code = krb5_get_init_creds_keytab(context, &my_creds, ple->princ,
                                               kt, 0, NULL, opts))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(1, "WARNING: %s while getting initial ticket for "
-                        "principal '%s' using keytab '%s'\n",
-                        gssd_k5_err_msg(context, code),
+                        "principal '%s' using keytab '%s'\n", k5err,
                         pname ? pname : "<unparsable>", kt_name);
                goto out;
        }
@@ -456,19 +456,21 @@ gssd_get_single_krb5_cred(krb5_context context,
                goto out;
        }
        if ((code = krb5_cc_resolve(context, cc_name, &ccache))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s while opening credential cache '%s'\n",
-                        gssd_k5_err_msg(context, code), cc_name);
+                        k5err, cc_name);
                goto out;
        }
        if ((code = krb5_cc_initialize(context, ccache, ple->princ))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s while initializing credential "
-                        "cache '%s'\n", gssd_k5_err_msg(context, code),
-                        cc_name);
+                        "cache '%s'\n", k5err, cc_name);
                goto out;
        }
        if ((code = krb5_cc_store_cred(context, ccache, &my_creds))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s while storing credentials in '%s'\n",
-                        gssd_k5_err_msg(context, code), cc_name);
+                        k5err, cc_name);
                goto out;
        }
 
@@ -485,6 +487,7 @@ gssd_get_single_krb5_cred(krb5_context context,
        if (ccache)
                krb5_cc_close(context, ccache);
        krb5_free_cred_contents(context, &my_creds);
+       free(k5err);
        return (code);
 }
 
@@ -708,6 +711,7 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
        int retval = -1;
        char kt_name[BUFSIZ];
        char *pname;
+       char *k5err = NULL;
 
        if (found == NULL) {
                retval = EINVAL;
@@ -721,15 +725,15 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
         * save info in the global principal list (gssd_k5_kt_princ_list).
         */
        if ((code = krb5_kt_get_name(context, kt, kt_name, BUFSIZ))) {
-               printerr(0, "ERROR: %s attempting to get keytab name\n",
-                        gssd_k5_err_msg(context, code));
+               k5err = gssd_k5_err_msg(context, code);
+               printerr(0, "ERROR: %s attempting to get keytab name\n", k5err);
                retval = code;
                goto out;
        }
        if ((code = krb5_kt_start_seq_get(context, kt, &cursor))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s while beginning keytab scan "
-                           "for keytab '%s'\n",
-                       gssd_k5_err_msg(context, code), kt_name);
+                           "for keytab '%s'\n", k5err, kt_name);
                retval = code;
                goto out;
        }
@@ -737,9 +741,10 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
        while ((code = krb5_kt_next_entry(context, kt, kte, &cursor)) == 0) {
                if ((code = krb5_unparse_name(context, kte->principal,
                                              &pname))) {
+                       k5err = gssd_k5_err_msg(context, code);
                        printerr(0, "WARNING: Skipping keytab entry because "
                                 "we failed to unparse principal name: %s\n",
-                                gssd_k5_err_msg(context, code));
+                                k5err);
                        k5_free_kt_entry(context, kte);
                        continue;
                }
@@ -773,13 +778,14 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
        }
 
        if ((code = krb5_kt_end_seq_get(context, kt, &cursor))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "WARNING: %s while ending keytab scan for "
-                           "keytab '%s'\n",
-                        gssd_k5_err_msg(context, code), kt_name);
+                           "keytab '%s'\n", k5err, kt_name);
        }
 
        retval = 0;
   out:
+       free(k5err);
        return retval;
 }
 
@@ -799,6 +805,7 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *hostname,
        int i, j, retval;
        char *default_realm = NULL;
        char *realm;
+       char *k5err = NULL;
        int tried_all = 0, tried_default = 0;
        krb5_principal princ;
 
@@ -812,8 +819,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *hostname,
        /* Get full local hostname */
        retval = gethostname(myhostname, sizeof(myhostname));
        if (retval) {
-               printerr(1, "%s while getting local hostname\n",
-                        gssd_k5_err_msg(context, retval));
+               k5err = gssd_k5_err_msg(context, retval);
+               printerr(1, "%s while getting local hostname\n", k5err);
                goto out;
        }
        retval = get_full_hostname(myhostname, myhostname, sizeof(myhostname));
@@ -823,8 +830,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *hostname,
        code = krb5_get_default_realm(context, &default_realm);
        if (code) {
                retval = code;
-               printerr(1, "%s while getting default realm name\n",
-                        gssd_k5_err_msg(context, code));
+               k5err = gssd_k5_err_msg(context, code);
+               printerr(1, "%s while getting default realm name\n", k5err);
                goto out;
        }
 
@@ -836,8 +843,9 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *hostname,
         */
        code = krb5_get_host_realm(context, targethostname, &realmnames);
        if (code) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s while getting realm(s) for host '%s'\n",
-                        gssd_k5_err_msg(context, code), targethostname);
+                        k5err, targethostname);
                retval = code;
                goto out;
        }
@@ -868,19 +876,19 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *hostname,
                                                        myhostname,
                                                        NULL);
                        if (code) {
+                               k5err = gssd_k5_err_msg(context, code);
                                printerr(1, "%s while building principal for "
-                                        "'%s/%s@%s'\n",
-                                        gssd_k5_err_msg(context, code),
-                                        svcnames[j], myhostname, realm);
+                                        "'%s/%s@%s'\n", k5err, svcnames[j],
+                                        myhostname, realm);
                                continue;
                        }
                        code = krb5_kt_get_entry(context, kt, princ, 0, 0, kte);
                        krb5_free_principal(context, princ);
                        if (code) {
+                               k5err = gssd_k5_err_msg(context, code);
                                printerr(3, "%s while getting keytab entry for "
-                                        "'%s/%s@%s'\n",
-                                        gssd_k5_err_msg(context, code),
-                                        svcnames[j], myhostname, realm);
+                                        "'%s/%s@%s'\n", k5err, svcnames[j],
+                                        myhostname, realm);
                        } else {
                                printerr(3, "Success getting keytab entry for "
                                         "'%s/%s@%s'\n",
@@ -915,6 +923,7 @@ out:
                k5_free_default_realm(context, default_realm);
        if (realmnames)
                krb5_free_host_realm(context, realmnames);
+       free(k5err);
        return retval;
 }
 
@@ -1140,11 +1149,12 @@ gssd_destroy_krb5_machine_creds(void)
        krb5_error_code code = 0;
        krb5_ccache ccache;
        struct gssd_k5_kt_princ *ple;
+       char *k5err = NULL;
 
        code = krb5_init_context(&context);
        if (code) {
-               printerr(0, "ERROR: %s while initializing krb5\n",
-                        gssd_k5_err_msg(NULL, code));
+               k5err = gssd_k5_err_msg(NULL, code);
+               printerr(0, "ERROR: %s while initializing krb5\n", k5err);
                goto out;
        }
 
@@ -1152,19 +1162,21 @@ gssd_destroy_krb5_machine_creds(void)
                if (!ple->ccname)
                        continue;
                if ((code = krb5_cc_resolve(context, ple->ccname, &ccache))) {
+                       k5err = gssd_k5_err_msg(context, code);
                        printerr(0, "WARNING: %s while resolving credential "
-                                   "cache '%s' for destruction\n",
-                                gssd_k5_err_msg(context, code), ple->ccname);
+                                   "cache '%s' for destruction\n", k5err,
+                                   ple->ccname);
                        continue;
                }
 
                if ((code = krb5_cc_destroy(context, ccache))) {
+                       k5err = gssd_k5_err_msg(context, code);
                        printerr(0, "WARNING: %s while destroying credential "
-                                   "cache '%s'\n",
-                                gssd_k5_err_msg(context, code), ple->ccname);
+                                   "cache '%s'\n", k5err, ple->ccname);
                }
        }
   out:
+       free(k5err);
        krb5_free_context(context);
 }
 
@@ -1179,22 +1191,24 @@ gssd_refresh_krb5_machine_credential(char *hostname,
        krb5_context context;
        krb5_keytab kt = NULL;;
        int retval = 0;
+       char *k5err = NULL;
 
        if (hostname == NULL && ple == NULL)
                return EINVAL;
 
        code = krb5_init_context(&context);
        if (code) {
+               k5err = gssd_k5_err_msg(NULL, code);
                printerr(0, "ERROR: %s: %s while initializing krb5 context\n",
-                        __FUNCTION__, gssd_k5_err_msg(NULL, code));
+                        __func__, k5err);
                retval = code;
                goto out;
        }
 
        if ((code = krb5_kt_resolve(context, keytabfile, &kt))) {
+               k5err = gssd_k5_err_msg(context, code);
                printerr(0, "ERROR: %s: %s while resolving keytab '%s'\n",
-                        __FUNCTION__, gssd_k5_err_msg(context, code),
-                        keytabfile);
+                        __func__, k5err, keytabfile);
                goto out;
        }
 
@@ -1231,29 +1245,35 @@ out:
        if (kt)
                krb5_kt_close(context, kt);
        krb5_free_context(context);
+       free(k5err);
        return retval;
 }
 
 /*
  * A common routine for getting the Kerberos error message
  */
-const char *
+char *
 gssd_k5_err_msg(krb5_context context, krb5_error_code code)
 {
-       const char *msg = NULL;
+       const char *origmsg;
+       char *msg = NULL;
+
 #if HAVE_KRB5_GET_ERROR_MESSAGE
-       if (context != NULL)
-               msg = krb5_get_error_message(context, code);
+       if (context != NULL) {
+               origmsg = krb5_get_error_message(context, code);
+               msg = strdup(origmsg);
+               krb5_free_error_message(context, origmsg);
+       }
 #endif
        if (msg != NULL)
                return msg;
 #if HAVE_KRB5
-       return error_message(code);
+       return strdup(error_message(code));
 #else
        if (context != NULL)
-               return krb5_get_err_text(context, code);
+               return strdup(krb5_get_err_text(context, code));
        else
-               return error_message(code);
+               return strdup(error_message(code));
 #endif
 }
 
index 4b2da6bb90f3d2d5e45d2602f16f7af616013fe9..3d39300b7e38b843b50928e117f55005cc5da6c5 100644 (file)
@@ -3,6 +3,12 @@
 
 #include <krb5.h>
 
+#ifdef HAVE_LIBTIRPC
+#include <rpc/auth_gss.h>
+#else
+#include "gss_oids.h"
+#endif
+
 /*
  * List of principals from our keytab that we
  * will try to use to obtain credentials
@@ -25,8 +31,7 @@ void gssd_setup_krb5_machine_gss_ccache(char *servername);
 void gssd_destroy_krb5_machine_creds(void);
 int  gssd_refresh_krb5_machine_credential(char *hostname,
                                          struct gssd_k5_kt_princ *ple);
-const char *
-gssd_k5_err_msg(krb5_context context, krb5_error_code code);
+char *gssd_k5_err_msg(krb5_context context, krb5_error_code code);
 void gssd_k5_get_default_realm(char **def_realm);
 
 #ifdef HAVE_SET_ALLOWABLE_ENCTYPES
index f97dcd37cfadf9c1fbf2021cc524b19f0b013a40..6ca0e8d762bf2ae36c321b97bb54f7efbfafd6cf 100644 (file)
@@ -132,7 +132,11 @@ release_parent(void)
        int status;
 
        if (pipefds[1] > 0) {
-               write(pipefds[1], &status, 1);
+               if (write(pipefds[1], &status, 1) != 1) {
+                       printerr(1, 
+                               "WARN: writing to parent pipe failed: errno %d (%s)\n",
+                               errno, strerror(errno));
+               }
                close(pipefds[1]);
                pipefds[1] = -1;
        }
index b390beae2fe90ef17908e816b976d34442d540f3..6f2ba61e31edfc62c5b60bf379c80b0631690299 100644 (file)
@@ -109,6 +109,10 @@ do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
        qword_print(f, fname);
        qword_printhex(f, context_token->value, context_token->length);
        err = qword_eol(f);
+       if (err) {
+               printerr(1, "WARNING: error writing to downcall channel "
+                        "%s: %s\n", SVCGSSD_CONTEXT_CHANNEL, strerror(errno));
+       }
        fclose(f);
        return err;
 out_err:
index 8e65acae8892becbf0b0b86f5f8fff718fe48868..cad99912fda54eba5566afb3d78ba53dd60d2c7f 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/idmapd
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,6 +87,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -193,7 +200,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index c1cf4eb40e09471a5ff3c58141b2bb276c3881c5..b690e21fae9697a4e9ec6d0dc5221759576cacb3 100644 (file)
@@ -169,7 +169,10 @@ flush_nfsd_cache(char *path, time_t now)
        fd = open(path, O_RDWR);
        if (fd == -1)
                return -1;
-       write(fd, stime, strlen(stime));
+       if (write(fd, stime, strlen(stime)) != strlen(stime)) {
+               errx(1, "Flushing nfsd cache failed: errno %d (%s)",
+                       errno, strerror(errno));
+       }
        close(fd);
        return 0;
 }
@@ -988,7 +991,10 @@ release_parent(void)
        int status;
 
        if (pipefds[1] > 0) {
-               write(pipefds[1], &status, 1);
+               if (write(pipefds[1], &status, 1) != 1) {
+                       err(1, "Writing to parent pipe failed: errno %d (%s)\n",
+                               errno, strerror(errno));
+               }
                close(pipefds[1]);
                pipefds[1] = -1;
        }
index a2f4df581ff5c62ba221c01d7d2477e92e64e747..f47868c09b0e64f1524e449e6d8518b9248e0d5b 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/mount
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -84,6 +90,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -196,7 +203,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index e19e58b0d95fa9d246e6a0034adf5480644bf6c2..7668167ba61edaec579c222b5e8ba3cd4d3f6068 100644 (file)
@@ -546,8 +546,12 @@ update_mtab (const char *dir, struct mntent *instead)
           * from the present mtab before renaming.
           */
            struct stat sbuf;
-           if (stat (MOUNTED, &sbuf) == 0)
-               chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid);
+           if (stat (MOUNTED, &sbuf) == 0) {
+                       if (chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid) < 0) {
+                               nfs_error(_("%s: error changing owner of %s: %s"),
+                                       progname, MOUNTED_TEMP, strerror (errno));
+                       }
+               }
        }
 
        /* rename mtemp to mtab */
index bcd0c0fc315bbc0546b3093db75d6b1e5e5b1039..72f4b845da4bf6f578eeb2cadd30fa0c31812621 100644 (file)
@@ -869,7 +869,7 @@ int nfs_advise_umount(const struct sockaddr *sap, const socklen_t salen,
        memcpy(saddr, sap, salen);
        nfs_set_port(saddr, mnt_pmap.pm_port);
 
-       client = nfs_get_rpcclient(saddr, salen, mnt_pmap.pm_prot,
+       client = nfs_get_priv_rpcclient(saddr, salen, mnt_pmap.pm_prot,
                                        mnt_pmap.pm_prog, mnt_pmap.pm_vers,
                                        &timeout);
        if (client == NULL)
@@ -1337,7 +1337,7 @@ static unsigned short nfs_mount_protocol(struct mount_options *options)
                        return IPPROTO_UDP;
        }
 
-       return nfs_nfs_version(options);
+       return nfs_nfs_protocol(options);
 }
 
 /*
index 535b9fcb5bdc2b48b80c1497c6fbf748da050eb0..8a0483b9a34463f09fc94436199060af1ed654ae 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/mountd
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,6 +91,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -197,7 +204,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 8084359e290edd34faf489d56ff7a268b649d1f1..25d292bdc5efeafc8f82362343723986018dd64d 100644 (file)
@@ -88,6 +88,14 @@ unregister_services (void)
                pmap_unset (MOUNTPROG, MOUNTVERS_NFSV3);
 }
 
+static void
+cleanup_lockfiles (void)
+{
+       unlink(_PATH_XTABLCK);
+       unlink(_PATH_ETABLCK);
+       unlink(_PATH_RMTABLCK);
+}
+
 /* Wait for all worker child processes to exit and reap them */
 static void
 wait_for_workers (void)
@@ -154,6 +162,7 @@ fork_workers(void)
        /* in parent */
        wait_for_workers();
        unregister_services();
+       cleanup_lockfiles();
        xlog(L_NOTICE, "mountd: no more workers, exiting\n");
        exit(0);
 }
@@ -170,6 +179,7 @@ killer (int sig)
                kill(0, SIGTERM);
                wait_for_workers();
        }
+       cleanup_lockfiles();
        xlog (L_FATAL, "Caught signal %d, un-registering and exiting.", sig);
 }
 
index 5787ed6a0bebacdc9f4bb270d933833e28f425bf..c371f8db8bef27bd8d9dd5e98807d026e754122d 100644 (file)
@@ -58,7 +58,7 @@ mountlist_add(char *host, const char *path)
        int             lockid;
        long            pos;
 
-       if ((lockid = xflock(_PATH_RMTAB, "a")) < 0)
+       if ((lockid = xflock(_PATH_RMTABLCK, "a")) < 0)
                return;
        setrmtabent("r+");
        while ((rep = getrmtabent(1, &pos)) != NULL) {
@@ -98,7 +98,7 @@ mountlist_del(char *hname, const char *path)
        int             lockid;
        int             match;
 
-       if ((lockid = xflock(_PATH_RMTAB, "w")) < 0)
+       if ((lockid = xflock(_PATH_RMTABLCK, "w")) < 0)
                return;
        if (!setrmtabent("r")) {
                xfunlock(lockid);
@@ -139,7 +139,7 @@ mountlist_del_all(struct sockaddr_in *sin)
        FILE            *fp;
        int             lockid;
 
-       if ((lockid = xflock(_PATH_RMTAB, "w")) < 0)
+       if ((lockid = xflock(_PATH_RMTABLCK, "w")) < 0)
                return;
        if (!(hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET))) {
                xlog(L_ERROR, "can't get hostname of %s", inet_ntoa(addr));
@@ -188,7 +188,7 @@ mountlist_list(void)
        struct in_addr          addr;
        struct hostent          *he;
 
-       if ((lockid = xflock(_PATH_RMTAB, "r")) < 0)
+       if ((lockid = xflock(_PATH_RMTABLCK, "r")) < 0)
                return NULL;
        if (stat(_PATH_RMTAB, &stb) < 0) {
                xlog(L_ERROR, "can't stat %s", _PATH_RMTAB);
index 422e839c171176638e66c32b53fa2af8a63f3886..5ba5af6ddc7eb10915b3695f623e4ba6e47ceeca 100644 (file)
 #include <errno.h>
 #include <time.h>
 
+#ifdef HAVE_LIBTIRPC
+#include <rpc/rpc_com.h>
+#endif
+
 void cache_set_fds(fd_set *fdset);
 int cache_process_req(fd_set *readfds);
 
index fbba8de862fa2f07b624b287c271405f1ff32271..90315d6fc29927857f1325ce819579a39f4d6f93 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/nfsd
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +85,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -191,7 +198,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index aaf8d298e3ad9c589c1d0d0c31df7cd64d36da27..c97c81f83f919d414734739904c44470825ae067 100644 (file)
@@ -86,7 +86,7 @@ main(int argc, char **argv)
                                NFSCTL_VERUNSET(versbits, c);
                                break;
                        default:
-                               fprintf(stderr, "%c: Unsupported version\n", c);
+                               fprintf(stderr, "%s: Unsupported version\n", optarg);
                                exit(1);
                        }
                        break;
index 35fa28cf280ba0efdbb6ae191124ba6137fcb576..6ab7db489fcd81dd0be6e2df83337b91d72fe1c5 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/nfsstat
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +85,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -191,7 +198,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 1517414fa0e596bcab9b5c4e3ff46bfc6c49ceb3..7e9f3273da68ef374ee57c8049441d6bec18da78 100644 (file)
@@ -167,10 +167,16 @@ DECLARE_SRV(srvinfo, _old);
 DECLARE_CLT(cltinfo);
 DECLARE_CLT(cltinfo, _old);
 
+static void            print_all_stats(int, int, int);
+static void            print_server_stats(int, int);
+static void            print_client_stats(int, int);
+static void            print_stats_list(int, int, int);
 static void            print_numbers(const char *, unsigned int *,
                                        unsigned int);
 static void            print_callstats(const char *, const char **,
                                        unsigned int *, unsigned int);
+static void            print_callstats_list(const char *, const char **,
+                                       unsigned int *, unsigned int);
 static int             parse_raw_statfile(const char *, struct statinfo *);
 static int             parse_pretty_statfile(const char *, struct statinfo *);
 
@@ -181,8 +187,10 @@ static int         mounts(const char *);
 static void            get_stats(const char *, struct statinfo *, int *, int,
                                        int);
 static int             has_stats(const unsigned int *);
+static int             has_rpcstats(const unsigned int *, int);
 static void            diff_stats(struct statinfo *, struct statinfo *, int);
 static void            unpause(int);
+static void            update_old_counters(struct statinfo *, struct statinfo *);
 
 static time_t          starttime;
 
@@ -207,26 +215,30 @@ void usage(char *name)
 {
        printf("Usage: %s [OPTION]...\n\
 \n\
-  -m, --mounts\t\tShow statistics on mounted NFS filesystems\n\
-  -c, --client\t\tShow NFS client statistics\n\
-  -s, --server\t\tShow NFS server statistics\n\
-  -2\t\t\tShow NFS version 2 statistics\n\
-  -3\t\t\tShow NFS version 3 statistics\n\
-  -4\t\t\tShow NFS version 4 statistics\n\
-  -o [facility]\t\tShow statistics on particular facilities.\n\
-     nfs\tNFS protocol information\n\
-     rpc\tGeneral RPC information\n\
-     net\tNetwork layer statistics\n\
-     fh\t\tUsage information on the server's file handle cache\n\
-     rc\t\tUsage information on the server's request reply cache\n\
-     all\tSelect all of the above\n\
-  -v, --verbose, --all\tSame as '-o all'\n\
-  -r, --rpc\t\tShow RPC statistics\n\
-  -n, --nfs\t\tShow NFS statistics\n\
-  -Z, --sleep\t\tSaves stats, pauses, diffs current and saved\n\
-  -S, --since file\tShows difference between current stats and those in 'file'\n\
-  --version\t\tShow program version\n\
-  --help\t\tWhat you just did\n\
+  -m, --mounts         Show statistics on mounted NFS filesystems\n\
+  -c, --client         Show NFS client statistics\n\
+  -s, --server         Show NFS server statistics\n\
+  -2                   Show NFS version 2 statistics\n\
+  -3                   Show NFS version 3 statistics\n\
+  -4                   Show NFS version 4 statistics\n\
+  -o [facility]                Show statistics on particular facilities.\n\
+     nfs               NFS protocol information\n\
+     rpc               General RPC information\n\
+     net               Network layer statistics\n\
+     fh                        Usage information on the server's file handle cache\n\
+     rc                        Usage information on the server's request reply cache\n\
+     all               Select all of the above\n\
+  -v, --verbose, --all Same as '-o all'\n\
+  -r, --rpc            Show RPC statistics\n\
+  -n, --nfs            Show NFS statistics\n\
+  -Z[#], --sleep[=#]   Collects stats until interrupted.\n\
+                           Cumulative stats are then printed\n\
+                           If # is provided, stats will be output every\n\
+                           # seconds.\n\
+  -S, --since file     Shows difference between current stats and those in 'file'\n\
+  -l, --list           Prints stats in list format\n\
+  --version            Show program version\n\
+  --help               What you just did\n\
 \n", name);
        exit(0);
 }
@@ -245,10 +257,12 @@ static struct option longopts[] =
        { "zero", 0, 0, 'z' },
        { "help", 0, 0, '\1' },
        { "version", 0, 0, '\2' },
-       { "sleep", 0, 0, 'Z' },
+       { "sleep", 2, 0, 'Z' },
        { "since", 1, 0, 'S' },
+       { "list", 0, 0, 'l' },
        { NULL, 0, 0, 0 }
 };
+int opt_sleep;
 
 int
 main(int argc, char **argv)
@@ -257,7 +271,8 @@ main(int argc, char **argv)
                        opt_srv = 0,
                        opt_clt = 0,
                        opt_prt = 0,
-                       opt_sleep = 0,
+                       sleep_time = 0,
+                       opt_list =0,
                        opt_since = 0;
        int             c;
        char           *progname,
@@ -279,7 +294,7 @@ main(int argc, char **argv)
        else
                progname = argv[0];
 
-       while ((c = getopt_long(argc, argv, "234acmno:ZS:vrsz\1\2", longopts, NULL)) != EOF) {
+       while ((c = getopt_long(argc, argv, "234acmno:Z::S:vrslz\1\2", longopts, NULL)) != EOF) {
                switch (c) {
                case 'a':
                        fprintf(stderr, "nfsstat: nfs acls are not yet supported.\n");
@@ -311,6 +326,9 @@ main(int argc, char **argv)
                        break;
                case 'Z':
                        opt_sleep = 1;
+                       if (optarg) {
+                               sleep_time = atoi(optarg);
+                       }
                        break;
                case 'S':
                        opt_since = 1;
@@ -334,6 +352,9 @@ main(int argc, char **argv)
                case 's':
                        opt_srv = 1;
                        break;
+               case 'l':
+                       opt_list = 1;
+                       break;
                case 'z':
                        fprintf(stderr, "nfsstat: zeroing of nfs statistics "
                                        "not yet supported\n");
@@ -384,7 +405,7 @@ main(int argc, char **argv)
        if (opt_clt)
                get_stats(clientfile, clientinfo, &opt_clt, opt_srv, 0);
 
-       if (opt_sleep) {
+       if (opt_sleep && !sleep_time) {
                starttime = time(NULL);
                printf("Collecting statistics; press CTRL-C to view results from interval (i.e., from pause to CTRL-C).\n");
                if (sigaction(SIGINT, &act, NULL) != 0) {
@@ -404,119 +425,288 @@ main(int argc, char **argv)
                        diff_stats(clientinfo_tmp, clientinfo, 0);
                }
        }
+       if(sleep_time) {
+               while(1) {
+                       if (opt_srv) {
+                               get_stats(NFSSRVSTAT, serverinfo_tmp , &opt_srv, opt_clt, 1);
+                               diff_stats(serverinfo_tmp, serverinfo, 1);
+                       }
+                       if (opt_clt) {
+                               get_stats(NFSCLTSTAT, clientinfo_tmp, &opt_clt, opt_srv, 0);
+                               diff_stats(clientinfo_tmp, clientinfo, 0);
+                       }
+                       if (opt_list) {
+                               print_stats_list(opt_srv, opt_clt, opt_prt);
+                       } else {
+                               print_all_stats(opt_srv, opt_clt, opt_prt);
+                       }
+                       fflush(stdout);
+
+                       if (opt_srv)
+                               update_old_counters(serverinfo_tmp, serverinfo);
+                       if (opt_clt)
+                               update_old_counters(clientinfo_tmp, clientinfo);
+
+                       sleep(sleep_time);
+               }       
+       } else {
+               if (opt_list) {
+                       print_stats_list(opt_srv, opt_clt, opt_prt);
+               } else {
+                       print_all_stats(opt_srv, opt_clt, opt_prt);
+               }
+       }
 
-       if (opt_srv) {
-               if (opt_prt & PRNT_NET) {
-                       print_numbers(
-                       LABEL_srvnet
-                       "packets    udp        tcp        tcpconn\n",
-                       srvnetinfo, 4
-                       );
+       return 0;
+}
+
+static void
+print_all_stats (int opt_srv, int opt_clt, int opt_prt)
+{
+       print_server_stats(opt_srv, opt_prt);
+       print_client_stats(opt_clt, opt_prt);
+}
+
+static void 
+print_server_stats(int opt_srv, int opt_prt) 
+{
+       if (!opt_srv)
+               return;
+
+       if (opt_prt & PRNT_NET) {
+               if (opt_sleep && !has_rpcstats(srvnetinfo, 4)) {
+               } else {
+                       print_numbers( LABEL_srvnet
+                               "packets    udp        tcp        tcpconn\n",
+                       srvnetinfo, 4);
                        printf("\n");
                }
-               if (opt_prt & PRNT_RPC) {
-                       print_numbers(
-                       LABEL_srvrpc
-                       "calls      badcalls   badauth    badclnt    xdrcall\n",
-                       srvrpcinfo, 5
-                       );
+       }
+       if (opt_prt & PRNT_RPC) {
+               if (opt_sleep && !has_rpcstats(srvrpcinfo, 5)) {
+                       ;
+               } else {
+                       print_numbers(LABEL_srvrpc
+                               "calls      badcalls   badauth    badclnt    xdrcall\n",
+                               srvrpcinfo, 5);
                        printf("\n");
                }
-               if (opt_prt & PRNT_RC) {
-                       print_numbers(
-                       LABEL_srvrc
-                       "hits       misses     nocache\n",
-                       srvrcinfo, 3
-                       );
+       }
+       if (opt_prt & PRNT_RC) {
+               if (opt_sleep && !has_rpcstats(srvrcinfo, 3)) {
+                       ;
+               } else {
+                       print_numbers(LABEL_srvrc
+                               "hits       misses     nocache\n",
+                               srvrcinfo, 3);
                        printf("\n");
                }
+       }
 
-               /*
-                * 2.2 puts all fh-related info after the 'rc' header
-                * 2.4 puts all fh-related info after the 'fh' header, but relocates
-                *     'stale' to the start and swaps dir and nondir :-(  
-                *     We preseve the 2.2 order
-                */
-               if (opt_prt & PRNT_FH) {
-                       if (get_stat_info("fh", srvinfo)) {     /* >= 2.4 */
-                               int t = srvfhinfo[3];
-                               srvfhinfo[3]=srvfhinfo[4];
-                               srvfhinfo[4]=t;
-                               
-                               srvfhinfo[5]=srvfhinfo[0]; /* relocate 'stale' */
-                               
-                               print_numbers(
-                                       LABEL_srvfh
-                                       "lookup     anon       ncachedir  ncachedir  stale\n",
-                                       srvfhinfo + 1, 5);
-                       } else                                  /* < 2.4 */
-                               print_numbers(
-                                       LABEL_srvfh
-                                       "lookup     anon       ncachedir  ncachedir  stale\n",
-                                       srvrcinfo + 3, 5);
-                       printf("\n");
+       /*
+        * 2.2 puts all fh-related info after the 'rc' header
+        * 2.4 puts all fh-related info after the 'fh' header, but relocates
+        *     'stale' to the start and swaps dir and nondir :-(  
+        *     We preseve the 2.2 order
+        */
+       if (opt_prt & PRNT_FH) {
+               if (get_stat_info("fh", srvinfo)) {     /* >= 2.4 */
+                       int t = srvfhinfo[3];
+                       srvfhinfo[3]=srvfhinfo[4];
+                       srvfhinfo[4]=t;
+                       
+                       srvfhinfo[5]=srvfhinfo[0]; /* relocate 'stale' */
+                       
+                       print_numbers(
+                               LABEL_srvfh
+                               "lookup     anon       ncachedir  ncachedir  stale\n",
+                               srvfhinfo + 1, 5);
+               } else                                  /* < 2.4 */
+                       print_numbers(
+                               LABEL_srvfh
+                               "lookup     anon       ncachedir  ncachedir  stale\n",
+                               srvrcinfo + 3, 5);
+               printf("\n");
+       }
+       if (opt_prt & PRNT_CALLS) {
+               if ((opt_prt & PRNT_V2) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc2info))) {
+                       if (opt_sleep && !has_stats(srvproc2info)) {
+                               ;
+                       } else {
+                               print_callstats(LABEL_srvproc2,
+                                       nfsv2name, srvproc2info + 1, 
+                                       sizeof(nfsv2name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V3) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc3info))) {
+                       if (opt_sleep && !has_stats(srvproc3info)) {
+                               ;
+                       } else {
+                               print_callstats(LABEL_srvproc3,
+                                       nfsv3name, srvproc3info + 1, 
+                                       sizeof(nfsv3name)/sizeof(char *));
+                       }
                }
-               if (opt_prt & PRNT_CALLS) {
-                       if ((opt_prt & PRNT_V2) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc2info)))
-                               print_callstats(
-                               LABEL_srvproc2,
-                               nfsv2name, srvproc2info + 1, sizeof(nfsv2name)/sizeof(char *)
-                               );
-                       if ((opt_prt & PRNT_V3) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc3info)))
-                               print_callstats(
-                               LABEL_srvproc3,
-                               nfsv3name, srvproc3info + 1, sizeof(nfsv3name)/sizeof(char *)
-                               );
-                       if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc4info))) {
-                               print_callstats(
-                               LABEL_srvproc4,
-                               nfssrvproc4name, srvproc4info + 1, sizeof(nfssrvproc4name)/sizeof(char *)
-                               );
-                               print_callstats(
-                               LABEL_srvproc4ops,
-                               nfssrvproc4opname, srvproc4opsinfo + 1, sizeof(nfssrvproc4opname)/sizeof(char *)
-                               );
+               if ((opt_prt & PRNT_V4) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc4info))) {
+                       if (opt_sleep && !has_stats(srvproc4info)) {
+                               ;
+                       } else {
+                               print_callstats( LABEL_srvproc4,
+                                       nfssrvproc4name, srvproc4info + 1, 
+                                       sizeof(nfssrvproc4name)/sizeof(char *));
+                               print_callstats(LABEL_srvproc4ops,
+                                       nfssrvproc4opname, srvproc4opsinfo + 1, 
+                                       sizeof(nfssrvproc4opname)/sizeof(char *));
                        }
                }
        }
-
-       if (opt_clt) {
-               if (opt_prt & PRNT_NET) {
-                       print_numbers(
-                       LABEL_cltnet
-                       "packets    udp        tcp        tcpconn\n",
-                       cltnetinfo, 4
-                       );
+}
+static void
+print_client_stats(int opt_clt, int opt_prt) 
+{
+       if (!opt_clt)
+               return;
+
+       if (opt_prt & PRNT_NET) {
+               if (opt_sleep && !has_rpcstats(cltnetinfo, 4)) {
+                       ;
+               } else { 
+                       print_numbers(LABEL_cltnet
+                               "packets    udp        tcp        tcpconn\n",
+                               cltnetinfo, 4);
                        printf("\n");
                }
-               if (opt_prt & PRNT_RPC) {
-                       print_numbers(
-                       LABEL_cltrpc
-                       "calls      retrans    authrefrsh\n",
-                       cltrpcinfo, 3
-                       );
+       }
+       if (opt_prt & PRNT_RPC) {
+               if (opt_sleep && !has_rpcstats(cltrpcinfo, 3)) {
+                       ;
+               } else {
+                       print_numbers(LABEL_cltrpc
+                               "calls      retrans    authrefrsh\n",
+                               cltrpcinfo, 3);
                        printf("\n");
                }
-               if (opt_prt & PRNT_CALLS) {
-                       if ((opt_prt & PRNT_V2) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc2info)))
-                               print_callstats(
-                               LABEL_cltproc2,
-                               nfsv2name, cltproc2info + 1,  sizeof(nfsv2name)/sizeof(char *)
-                               );
-                       if ((opt_prt & PRNT_V3) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc3info)))
-                               print_callstats(
-                               LABEL_cltproc3,
-                               nfsv3name, cltproc3info + 1, sizeof(nfsv3name)/sizeof(char *)
-                               );
-                       if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc4info)))
-                               print_callstats(
-                               LABEL_cltproc4,
-                               nfscltproc4name, cltproc4info + 1,  sizeof(nfscltproc4name)/sizeof(char *)
-                               );
+       }
+       if (opt_prt & PRNT_CALLS) {
+               if ((opt_prt & PRNT_V2) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc2info))) {
+                       if (opt_sleep && !has_stats(cltproc2info)) {
+                               ;
+                       } else {
+                               print_callstats(LABEL_cltproc2,
+                                       nfsv2name, cltproc2info + 1,  
+                                       sizeof(nfsv2name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V3) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc3info))) {
+                       if (opt_sleep && !has_stats(cltproc3info)) {
+                               ;
+                       } else {
+                               print_callstats(LABEL_cltproc3,
+                                       nfsv3name, cltproc3info + 1, 
+                                       sizeof(nfsv3name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V4) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc4info))) {
+                       if (opt_sleep && !has_stats(cltproc4info)) {
+                               ;
+                       } else {
+                               print_callstats(LABEL_cltproc4,
+                                       nfscltproc4name, cltproc4info + 1,  
+                                       sizeof(nfscltproc4name)/sizeof(char *));
+                       }
                }
        }
+}
 
-       return 0;
+static void
+print_clnt_list(int opt_prt) 
+{
+       if (opt_prt & PRNT_CALLS) {
+               if ((opt_prt & PRNT_V2) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc2info))) {
+                       if (opt_sleep && !has_stats(cltproc2info)) {
+                               ;
+                       } else {
+                               print_callstats_list("nfs v2 client",
+                                       nfsv2name, cltproc2info + 1,  
+                                       sizeof(nfsv2name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V3) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc3info))) {
+                       if (opt_sleep && !has_stats(cltproc3info)) {
+                               ;
+                       } else { 
+                               print_callstats_list("nfs v3 client",
+                                       nfsv3name, cltproc3info + 1, 
+                                       sizeof(nfsv3name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V4) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(cltproc4info))) {
+                       if (opt_sleep && !has_stats(cltproc4info)) {
+                               ;
+                       } else {
+                               print_callstats_list("nfs v4 ops",
+                                       nfssrvproc4opname, srvproc4opsinfo + 1, 
+                                       sizeof(nfssrvproc4opname)/sizeof(char *));
+                               print_callstats_list("nfs v4 client",
+                                       nfscltproc4name, cltproc4info + 1,  
+                                       sizeof(nfscltproc4name)/sizeof(char *));
+                       }
+               }
+       }
+}
+static void
+print_serv_list(int opt_prt) 
+{
+       if (opt_prt & PRNT_CALLS) {
+               if ((opt_prt & PRNT_V2) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc2info))) {
+                       if (opt_sleep && !has_stats(srvproc2info)) {
+                               ;
+                       } else {
+                               print_callstats_list("nfs v2 server",
+                                       nfsv2name, srvproc2info + 1, 
+                                       sizeof(nfsv2name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V3) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc3info))) {
+                       if (opt_sleep && !has_stats(srvproc3info)) {
+                               ;
+                       } else {
+                               print_callstats_list("nfs v3 server",
+                                       nfsv3name, srvproc3info + 1, 
+                                       sizeof(nfsv3name)/sizeof(char *));
+                       }
+               }
+               if ((opt_prt & PRNT_V4) || 
+                               ((opt_prt & PRNT_AUTO) && has_stats(srvproc4opsinfo))) {
+                       if (opt_sleep && !has_stats(srvproc4info)) {
+                               ;
+                       } else {
+                               print_callstats_list("nfs v4 ops",
+                                       nfssrvproc4opname, srvproc4opsinfo + 1, 
+                                       sizeof(nfssrvproc4opname)/sizeof(char *));
+                       }
+               }
+       }
+}
+static void
+print_stats_list(int opt_srv, int opt_clt, int opt_prt) 
+{
+       if (opt_srv)
+               print_serv_list(opt_prt);
+
+       if (opt_clt)
+               print_clnt_list(opt_prt);
 }
 
 static statinfo *
@@ -569,6 +759,29 @@ print_callstats(const char *hdr, const char **names,
        printf("\n");
 }
 
+static void
+print_callstats_list(const char *hdr, const char **names,
+                       unsigned int *callinfo, unsigned int nr)
+{
+       unsigned long long      calltotal;
+       int                     i;
+
+       for (i = 0, calltotal = 0; i < nr; i++) {
+               calltotal += callinfo[i];
+       }
+       if (!calltotal)
+               return;
+       printf("%13s %13s %8llu \n", hdr, "total:", calltotal);
+       printf("------------- ------------- --------\n");
+       for (i = 0; i < nr; i++) {
+                       if (callinfo[i])
+                               printf("%13s %12s: %8u \n", hdr, names[i], callinfo[i]);
+       }
+       printf("\n");
+               
+}
+
+
 /* returns 0 on success, 1 otherwise */
 static int
 parse_raw_statfile(const char *name, struct statinfo *statp)
@@ -792,6 +1005,15 @@ has_stats(const unsigned int *info)
 {
        return (info[0] && info[info[0] + 1] > info[0]);
 }
+static int
+has_rpcstats(const unsigned int *info, int size)
+{
+       int i, cnt;
+
+       for (i=0, cnt=0; i < size; i++)
+               cnt += info[i];
+       return cnt;
+}
 
 /*
  * take the difference of each individual stat value in 'new' and 'old'
@@ -846,3 +1068,13 @@ unpause(int sig)
        seconds = (int)time_diff % 60;
        printf("Signal received; displaying (only) statistics gathered over the last %d minutes, %d seconds:\n\n", minutes, seconds);
 }
+
+static void
+update_old_counters(struct statinfo *new, struct statinfo *old)
+{
+       int z, i;
+       for (z = 0; old[z].tag; z++) 
+               for (i = 0; i <= old[z].nrvals; i++) 
+                       old[z].valptr[i] += new[z].valptr[i];
+
+}
index cb5f89f24ba32d7dfc2a82f91cf65f52eace21a1..52215a9293a5ff90915517a715e381230be9aa91 100644 (file)
@@ -72,6 +72,9 @@ Display all of the above facilities.
 .B \-v, \-\-verbose
 This is equivalent to \fB\-o all\fR.
 .TP
+.B \-l, \-\-list
+Print information in list form.
+.TP
 .BI "\-S, \-\-since " file
 Instead of printing current statistics, 
 .B nfsstat
@@ -91,7 +94,7 @@ output
 .I file
 are treated as zeroes.
 .TP
-.B \-Z, \-\-sleep
+.B \-Z[interval], \-\-sleep=[interval]
 Instead of printing current statistics and immediately exiting,
 .B nfsstat
 takes a snapshot of the current statistics and pauses until it receives
@@ -100,6 +103,10 @@ takes a snapshot of the current statistics and pauses until it receives
 .BR Ctrl-C ),
 at which point it takes another snapshot and displays the difference
 between the two.
+If \fIinterval\fR is specified, 
+.B nfsstat
+will print the number of \fBNFS\fR calls made since the previous report.
+Stats will be printed repeatedly every \fIinterval\fR seconds.
 .\" --------------------- EXAMPLES -------------------------------
 .SH EXAMPLES
 .TP
index 43fcb9ed91eef0fa65a20f79729f007f9d631258..a0dc9566e0981b33da8be83798fdbf99ed796037 100644 (file)
@@ -37,9 +37,15 @@ subdir = utils/showmount
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +85,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -191,7 +198,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index c7d474f8ccfc16698a1ba717a70a9e13479c6f7b..10e404797087de379443983a5430548e5a88930e 100644 (file)
@@ -39,9 +39,15 @@ DIST_COMMON = $(dist_sbin_SCRIPTS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in COPYING TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/bsdsignals.m4 \
+       $(top_srcdir)/aclocal/ipv6.m4 \
        $(top_srcdir)/aclocal/kerberos5.m4 \
        $(top_srcdir)/aclocal/libblkid.m4 \
+       $(top_srcdir)/aclocal/libevent.m4 \
+       $(top_srcdir)/aclocal/libnfsidmap.m4 \
+       $(top_srcdir)/aclocal/librpcsecgss.m4 \
+       $(top_srcdir)/aclocal/libtirpc.m4 \
        $(top_srcdir)/aclocal/nfs-utils.m4 \
+       $(top_srcdir)/aclocal/rpcsec_vers.m4 \
        $(top_srcdir)/aclocal/tcp-wrappers.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -93,6 +99,7 @@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -205,7 +212,6 @@ enable_gss = @enable_gss@
 enable_ipv6 = @enable_ipv6@
 enable_nfsv3 = @enable_nfsv3@
 enable_nfsv4 = @enable_nfsv4@
-enable_tirpc = @enable_tirpc@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
index 169cd78ac82b17a99c5ce90850bb97f4d4fac901..a2c9e2b091c126d2d24b84a870f946f1f479ca68 100644 (file)
@@ -204,7 +204,10 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp)
                        e += sprintf(e, "%02x", 0xff & (argp->priv[i]));
                if (e+1-buf != LINELEN) abort();
                e += sprintf(e, " %s %s\n", mon_name, my_name);
-               write(fd, buf, e-buf);
+               if (write(fd, buf, e-buf) != (e-buf)) {
+                       note(N_WARNING, "writing to %s failed: errno %d (%s)",
+                               path, errno, strerror(errno));
+               }
        }
 
        free(path);
index d58e0be421859ed6c59880e917d53a53a874b877..f1fc619a9b4c3ab9398e27d073af588d81bdf31a 100644 (file)
@@ -782,7 +782,10 @@ static int record_pid(void)
        fd = open("/var/run/sm-notify.pid", O_CREAT|O_EXCL|O_WRONLY, 0600);
        if (fd < 0)
                return 0;
-       write(fd, pid, strlen(pid));
+       if (write(fd, pid, strlen(pid)) != strlen(pid))  {
+               nsm_log(LOG_WARNING, "Writing to pid file failed: errno %d(%s)",
+                       errno, strerror(errno));
+       }
        close(fd);
        return 1;
 }
@@ -818,12 +821,16 @@ static void drop_privs(void)
 static void set_kernel_nsm_state(int state)
 {
        int fd;
+       const char *file = "/proc/sys/fs/nfs/nsm_local_state";
 
-       fd = open("/proc/sys/fs/nfs/nsm_local_state",O_WRONLY);
+       fd = open(file ,O_WRONLY);
        if (fd >= 0) {
                char buf[20];
                snprintf(buf, sizeof(buf), "%d", state);
-               write(fd, buf, strlen(buf));
+               if (write(fd, buf, strlen(buf)) != strlen(buf)) {
+                       nsm_log(LOG_WARNING, "Writing to '%s' failed: errno %d (%s)",
+                               file, errno, strerror(errno));
+               }
                close(fd);
        }
 }
index 6da2ab283d145284d2f919e7c3ec3faf35933463..1c5247ea2365aa0112ecda69956b95e04862d014 100644 (file)
@@ -179,14 +179,20 @@ static void create_pidfile(void)
                    pidfile, strerror(errno));
        fprintf(fp, "%d\n", getpid());
        pidfd = dup(fileno(fp));
-       if (fclose(fp) < 0)
-               note(N_WARNING, "Flushing pid file failed.\n");
+       if (fclose(fp) < 0) {
+               note(N_WARNING, "Flushing pid file failed: errno %d (%s)\n",
+                       errno, strerror(errno));
+       }
 }
 
 static void truncate_pidfile(void)
 {
-       if (pidfd >= 0)
-               ftruncate(pidfd, 0);
+       if (pidfd >= 0) {
+               if (ftruncate(pidfd, 0) < 0) {
+                       note(N_WARNING, "truncating pid file failed: errno %d (%s)\n",
+                               errno, strerror(errno));
+               }
+       }
 }
 
 static void drop_privs(void)
@@ -207,9 +213,12 @@ static void drop_privs(void)
        /* better chown the pid file before dropping, as if it
         * if over nfs we might loose access
         */
-       if (pidfd >= 0)
-               fchown(pidfd, st.st_uid, st.st_gid);
-
+       if (pidfd >= 0) {
+               if (fchown(pidfd, st.st_uid, st.st_gid) < 0) {
+                       note(N_ERROR, "Unable to change owner of %s: %d (%s)",
+                                       SM_DIR, strerror (errno));
+               }
+       }
        setgroups(0, NULL);
        if (setgid(st.st_gid) == -1
            || setuid(st.st_uid) == -1) {
@@ -495,7 +504,10 @@ int main (int argc, char **argv)
        /* If we got this far, we have successfully started, so notify parent */
        if (pipefds[1] > 0) {
                status = 0;
-               write(pipefds[1], &status, 1);
+               if (write(pipefds[1], &status, 1) != 1) {
+                       note(N_WARNING, "writing to parent pipe failed: errno %d (%s)\n",
+                               errno, strerror(errno));
+               }
                close(pipefds[1]);
                pipefds[1] = -1;
        }
@@ -534,17 +546,23 @@ static void
 load_state_number(void)
 {
        int fd;
+       const char *file = "/proc/sys/fs/nfs/nsm_local_state";
 
        if ((fd = open(SM_STAT_PATH, O_RDONLY)) == -1)
                return;
 
-       read(fd, &MY_STATE, sizeof(MY_STATE));
+       if (read(fd, &MY_STATE, sizeof(MY_STATE)) != sizeof(MY_STATE)) {
+               note(N_WARNING, "Unable to read state from '%s': errno %d (%s)",
+                               SM_STAT_PATH, errno, strerror(errno));
+       }
        close(fd);
-       fd = open("/proc/sys/fs/nfs/nsm_local_state",O_WRONLY);
+       fd = open(file, O_WRONLY);
        if (fd >= 0) {
                char buf[20];
                snprintf(buf, sizeof(buf), "%d", MY_STATE);
-               write(fd, buf, strlen(buf));
+               if (write(fd, buf, strlen(buf)) != strlen(buf))
+                       note(N_WARNING, "Writing to '%s' failed: errno %d (%s)",
+                               file, errno, strerror(errno));
                close(fd);
        }