]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Merge branch 'upstream'
authorBen Hutchings <ben@decadent.org.uk>
Wed, 14 Jul 2010 01:57:29 +0000 (02:57 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 14 Jul 2010 01:57:29 +0000 (02:57 +0100)
Conflicts:
Makefile.in
autom4te.cache/output.0
autom4te.cache/output.1
autom4te.cache/traces.0
autom4te.cache/traces.1
config.guess
config.sub
configure
linux-nfs/Makefile.in
support/Makefile.in
support/export/Makefile.in
support/include/Makefile.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

65 files changed:
Makefile.in
autom4te.cache/output.0
autom4te.cache/output.1
autom4te.cache/traces.0
autom4te.cache/traces.1
config.guess
config.sub
configure
configure.ac
linux-nfs/Makefile.in
support/Makefile.in
support/export/Makefile.in
support/export/client.c
support/export/export.c
support/export/rmtab.c
support/export/xtab.c
support/include/Makefile.in
support/include/exportfs.h
support/include/nfs/Makefile.in
support/include/nfslib.h
support/include/rpcsvc/Makefile.in
support/include/sys/Makefile.in
support/include/sys/fs/Makefile.in
support/include/xcommon.h
support/misc/Makefile.in
support/nfs/Makefile.in
support/nfs/exports.c
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/gssd/gssd.c
utils/idmapd/Makefile.in
utils/mount/Makefile.am
utils/mount/Makefile.in
utils/mount/error.c
utils/mount/error.h
utils/mount/mount.c
utils/mount/mount.nfs.man
utils/mount/network.c
utils/mount/network.h
utils/mount/nfs.man
utils/mount/nfs4mount.c
utils/mount/nfsmount.c
utils/mount/nfsumount.c
utils/mount/parse_opt.c [new file with mode: 0644]
utils/mount/parse_opt.h [new file with mode: 0644]
utils/mount/stropts.c [new file with mode: 0644]
utils/mount/stropts.h [new file with mode: 0644]
utils/mount/token.c [new file with mode: 0644]
utils/mount/token.h [new file with mode: 0644]
utils/mount/umount.nfs.man
utils/mountd/Makefile.in
utils/mountd/auth.c
utils/mountd/cache.c
utils/mountd/mountd.c
utils/nfsd/Makefile.in
utils/nfsstat/Makefile.in
utils/nfsstat/nfsstat.c
utils/showmount/Makefile.in
utils/statd/Makefile.in

index 2e69faa5b537f087766cddb2f5e4e735e9ea767a..2d4c4f36ec77f52e46e23ba862507607f8c14169 100644 (file)
@@ -122,9 +122,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 6fc7732ea0140543d663234f26023b74f4456ce3..fd2267a843146c5296414e6dad350d93b9086876 100644 (file)
@@ -904,8 +904,8 @@ LIBNSL
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
 LIBSOCKET
 LIBCRYPT
 LIBBSD
@@ -944,8 +944,8 @@ FFLAGS
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1583,9 +1583,10 @@ Some influential environment variables:
               C compiler flags for RPCSECGSS, overriding pkg-config
   RPCSECGSS_LIBS 
               linker flags for RPCSECGSS, overriding pkg-config
-  GSSAPI_CFLAGS 
-              C compiler flags for GSSAPI, overriding pkg-config
-  GSSAPI_LIBS linker flags for GSSAPI, overriding pkg-config
+  GSSGLUE_CFLAGS 
+              C compiler flags for GSSGLUE, overriding pkg-config
+  GSSGLUE_LIBS 
+              linker flags for GSSGLUE, 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.
@@ -22643,12 +22644,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_CFLAGS="$RPCSECGSS_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22661,12 +22662,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_LIBS="$RPCSECGSS_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22685,9 +22686,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         else 
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$RPCSECGSS_PKG_ERRORS" >&5
@@ -22714,20 +22715,20 @@ echo "${ECHO_T}yes" >&6; }
 fi
     
 pkg_failed=no
-{ echo "$as_me:$LINENO: checking for GSSAPI" >&5
-echo $ECHO_N "checking for GSSAPI... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for GSSGLUE" >&5
+echo $ECHO_N "checking for GSSGLUE... $ECHO_C" >&6; }
 
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_CFLAGS"; then
-        pkg_cv_GSSAPI_CFLAGS="$GSSAPI_CFLAGS"
+    if test -n "$GSSGLUE_CFLAGS"; then
+        pkg_cv_GSSGLUE_CFLAGS="$GSSGLUE_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_CFLAGS=`$PKG_CONFIG --cflags "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_CFLAGS=`$PKG_CONFIG --cflags "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22736,16 +22737,16 @@ else
        pkg_failed=untried
 fi
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_LIBS"; then
-        pkg_cv_GSSAPI_LIBS="$GSSAPI_LIBS"
+    if test -n "$GSSGLUE_LIBS"; then
+        pkg_cv_GSSGLUE_LIBS="$GSSGLUE_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_LIBS=`$PKG_CONFIG --libs "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_LIBS=`$PKG_CONFIG --libs "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22764,33 +22765,33 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         else 
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$GSSAPI_PKG_ERRORS" >&5
+       echo "$GSSGLUE_PKG_ERRORS" >&5
 
-       { { echo "$as_me:$LINENO: error: Package requirements (libgssapi >= 0.11) were not met:
+       { { echo "$as_me:$LINENO: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&5
-echo "$as_me: error: Package requirements (libgssapi >= 0.11) were not met:
+echo "$as_me: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&2;}
    { (exit 1); exit 1; }; }
@@ -22799,8 +22800,8 @@ elif test $pkg_failed = untried; then
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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/>.
@@ -22809,16 +22810,16 @@ echo "$as_me: error: The pkg-config script could not be found or is too old.  Ma
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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
-       GSSAPI_CFLAGS=$pkg_cv_GSSAPI_CFLAGS
-       GSSAPI_LIBS=$pkg_cv_GSSAPI_LIBS
+       GSSGLUE_CFLAGS=$pkg_cv_GSSGLUE_CFLAGS
+       GSSGLUE_LIBS=$pkg_cv_GSSGLUE_LIBS
         { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
        :
@@ -24032,7 +24033,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24101,7 +24102,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30881,8 +30882,8 @@ LIBNSL!$LIBNSL$ac_delim
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 RPCSECGSS_CFLAGS!$RPCSECGSS_CFLAGS$ac_delim
 RPCSECGSS_LIBS!$RPCSECGSS_LIBS$ac_delim
-GSSAPI_CFLAGS!$GSSAPI_CFLAGS$ac_delim
-GSSAPI_LIBS!$GSSAPI_LIBS$ac_delim
+GSSGLUE_CFLAGS!$GSSGLUE_CFLAGS$ac_delim
+GSSGLUE_LIBS!$GSSGLUE_LIBS$ac_delim
 LIBSOCKET!$LIBSOCKET$ac_delim
 LIBCRYPT!$LIBCRYPT$ac_delim
 LIBBSD!$LIBBSD$ac_delim
index 91167b982f7eadefe467611781f077a700f668f0..98bdfe8e28c64bc8d4c251617cc8da2cd2889ab7 100644 (file)
@@ -904,8 +904,8 @@ LIBNSL
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
 LIBSOCKET
 LIBCRYPT
 LIBBSD
@@ -944,8 +944,8 @@ FFLAGS
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1583,9 +1583,10 @@ Some influential environment variables:
               C compiler flags for RPCSECGSS, overriding pkg-config
   RPCSECGSS_LIBS 
               linker flags for RPCSECGSS, overriding pkg-config
-  GSSAPI_CFLAGS 
-              C compiler flags for GSSAPI, overriding pkg-config
-  GSSAPI_LIBS linker flags for GSSAPI, overriding pkg-config
+  GSSGLUE_CFLAGS 
+              C compiler flags for GSSGLUE, overriding pkg-config
+  GSSGLUE_LIBS 
+              linker flags for GSSGLUE, 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.
@@ -22631,12 +22632,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_CFLAGS="$RPCSECGSS_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22649,12 +22650,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_LIBS="$RPCSECGSS_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22673,9 +22674,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         else 
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$RPCSECGSS_PKG_ERRORS" >&5
@@ -22702,20 +22703,20 @@ echo "${ECHO_T}yes" >&6; }
 fi
     
 pkg_failed=no
-{ echo "$as_me:$LINENO: checking for GSSAPI" >&5
-echo $ECHO_N "checking for GSSAPI... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for GSSGLUE" >&5
+echo $ECHO_N "checking for GSSGLUE... $ECHO_C" >&6; }
 
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_CFLAGS"; then
-        pkg_cv_GSSAPI_CFLAGS="$GSSAPI_CFLAGS"
+    if test -n "$GSSGLUE_CFLAGS"; then
+        pkg_cv_GSSGLUE_CFLAGS="$GSSGLUE_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_CFLAGS=`$PKG_CONFIG --cflags "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_CFLAGS=`$PKG_CONFIG --cflags "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22724,16 +22725,16 @@ else
        pkg_failed=untried
 fi
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_LIBS"; then
-        pkg_cv_GSSAPI_LIBS="$GSSAPI_LIBS"
+    if test -n "$GSSGLUE_LIBS"; then
+        pkg_cv_GSSGLUE_LIBS="$GSSGLUE_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_LIBS=`$PKG_CONFIG --libs "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_LIBS=`$PKG_CONFIG --libs "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22752,33 +22753,33 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         else 
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$GSSAPI_PKG_ERRORS" >&5
+       echo "$GSSGLUE_PKG_ERRORS" >&5
 
-       { { echo "$as_me:$LINENO: error: Package requirements (libgssapi >= 0.11) were not met:
+       { { echo "$as_me:$LINENO: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&5
-echo "$as_me: error: Package requirements (libgssapi >= 0.11) were not met:
+echo "$as_me: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&2;}
    { (exit 1); exit 1; }; }
@@ -22787,8 +22788,8 @@ elif test $pkg_failed = untried; then
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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/>.
@@ -22797,16 +22798,16 @@ echo "$as_me: error: The pkg-config script could not be found or is too old.  Ma
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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
-       GSSAPI_CFLAGS=$pkg_cv_GSSAPI_CFLAGS
-       GSSAPI_LIBS=$pkg_cv_GSSAPI_LIBS
+       GSSGLUE_CFLAGS=$pkg_cv_GSSGLUE_CFLAGS
+       GSSGLUE_LIBS=$pkg_cv_GSSGLUE_LIBS
         { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
        :
@@ -24020,7 +24021,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24089,7 +24090,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30869,8 +30870,8 @@ LIBNSL!$LIBNSL$ac_delim
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 RPCSECGSS_CFLAGS!$RPCSECGSS_CFLAGS$ac_delim
 RPCSECGSS_LIBS!$RPCSECGSS_LIBS$ac_delim
-GSSAPI_CFLAGS!$GSSAPI_CFLAGS$ac_delim
-GSSAPI_LIBS!$GSSAPI_LIBS$ac_delim
+GSSGLUE_CFLAGS!$GSSGLUE_CFLAGS$ac_delim
+GSSGLUE_LIBS!$GSSGLUE_LIBS$ac_delim
 LIBSOCKET!$LIBSOCKET$ac_delim
 LIBCRYPT!$LIBCRYPT$ac_delim
 LIBBSD!$LIBBSD$ac_delim
index f4a3acde80dc698f6c32897a919bf4b64bb4cf4c..79a7fc20b7e02c6fda43f5195d5a28ba828be8e9 100644 (file)
@@ -9721,7 +9721,7 @@ aclocal/bsdsignals.m4:2: AC_BSD_SIGNALS is expanded from...
 configure.ac:163: the top level])
 m4trace:configure.ac:163: -1- m4_pattern_allow([^HAVE_BSD_SIGNALS$])
 m4trace:configure.ac:169: -1- m4_pattern_allow([^LIBNSL$])
-m4trace:configure.ac:184: -1- PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.10], [], [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])
+m4trace:configure.ac:184: -1- 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])
       
      ])
 m4trace:configure.ac:184: -1- PKG_PROG_PKG_CONFIG
@@ -9731,14 +9731,14 @@ m4trace:configure.ac:184: -1- m4_pattern_allow([^PKG_CONFIG$])
 m4trace:configure.ac:184: -1- m4_pattern_allow([^PKG_CONFIG$])
 m4trace:configure.ac:184: -1- m4_pattern_allow([^RPCSECGSS_CFLAGS$])
 m4trace:configure.ac:184: -1- m4_pattern_allow([^RPCSECGSS_LIBS$])
-m4trace:configure.ac:184: -1- PKG_CHECK_EXISTS([librpcsecgss >= 0.10], [pkg_cv_[]RPCSECGSS_CFLAGS=`$PKG_CONFIG --[]cflags "librpcsecgss >= 0.10" 2>/dev/null`], [pkg_failed=yes])
-m4trace:configure.ac:184: -1- PKG_CHECK_EXISTS([librpcsecgss >= 0.10], [pkg_cv_[]RPCSECGSS_LIBS=`$PKG_CONFIG --[]libs "librpcsecgss >= 0.10" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.ac:184: -1- PKG_CHECK_EXISTS([librpcsecgss >= 0.16], [pkg_cv_[]RPCSECGSS_CFLAGS=`$PKG_CONFIG --[]cflags "librpcsecgss >= 0.16" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.ac:184: -1- PKG_CHECK_EXISTS([librpcsecgss >= 0.16], [pkg_cv_[]RPCSECGSS_LIBS=`$PKG_CONFIG --[]libs "librpcsecgss >= 0.16" 2>/dev/null`], [pkg_failed=yes])
 m4trace:configure.ac:184: -1- _PKG_SHORT_ERRORS_SUPPORTED
-m4trace:configure.ac:188: -1- PKG_CHECK_MODULES([GSSAPI], [libgssapi >= 0.11])
-m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSAPI_CFLAGS$])
-m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSAPI_LIBS$])
-m4trace:configure.ac:188: -1- PKG_CHECK_EXISTS([libgssapi >= 0.11], [pkg_cv_[]GSSAPI_CFLAGS=`$PKG_CONFIG --[]cflags "libgssapi >= 0.11" 2>/dev/null`], [pkg_failed=yes])
-m4trace:configure.ac:188: -1- PKG_CHECK_EXISTS([libgssapi >= 0.11], [pkg_cv_[]GSSAPI_LIBS=`$PKG_CONFIG --[]libs "libgssapi >= 0.11" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.ac:188: -1- PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
+m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSGLUE_CFLAGS$])
+m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSGLUE_LIBS$])
+m4trace:configure.ac:188: -1- PKG_CHECK_EXISTS([libgssglue >= 0.1], [pkg_cv_[]GSSGLUE_CFLAGS=`$PKG_CONFIG --[]cflags "libgssglue >= 0.1" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.ac:188: -1- PKG_CHECK_EXISTS([libgssglue >= 0.1], [pkg_cv_[]GSSGLUE_LIBS=`$PKG_CONFIG --[]libs "libgssglue >= 0.1" 2>/dev/null`], [pkg_failed=yes])
 m4trace:configure.ac:188: -1- _PKG_SHORT_ERRORS_SUPPORTED
 m4trace:configure.ac:199: -1- AC_BLKID_VERS
 m4trace:configure.ac:199: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
index bd95e99a1a15faf5b9f9a0ba2c26c5944405cf23..9aea8fa287ba7609e056b31c0b242f7dafd899e2 100644 (file)
@@ -846,12 +846,12 @@ m4trace:configure.ac:184: -1- m4_pattern_allow([^RPCSECGSS_CFLAGS$])
 m4trace:configure.ac:184: -1- AC_SUBST([RPCSECGSS_LIBS])
 m4trace:configure.ac:184: -1- AC_SUBST_TRACE([RPCSECGSS_LIBS])
 m4trace:configure.ac:184: -1- m4_pattern_allow([^RPCSECGSS_LIBS$])
-m4trace:configure.ac:188: -1- AC_SUBST([GSSAPI_CFLAGS])
-m4trace:configure.ac:188: -1- AC_SUBST_TRACE([GSSAPI_CFLAGS])
-m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSAPI_CFLAGS$])
-m4trace:configure.ac:188: -1- AC_SUBST([GSSAPI_LIBS])
-m4trace:configure.ac:188: -1- AC_SUBST_TRACE([GSSAPI_LIBS])
-m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSAPI_LIBS$])
+m4trace:configure.ac:188: -1- AC_SUBST([GSSGLUE_CFLAGS])
+m4trace:configure.ac:188: -1- AC_SUBST_TRACE([GSSGLUE_CFLAGS])
+m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSGLUE_CFLAGS$])
+m4trace:configure.ac:188: -1- AC_SUBST([GSSGLUE_LIBS])
+m4trace:configure.ac:188: -1- AC_SUBST_TRACE([GSSGLUE_LIBS])
+m4trace:configure.ac:188: -1- m4_pattern_allow([^GSSGLUE_LIBS$])
 m4trace:configure.ac:199: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
 You should run autoupdate.], [../../lib/autoconf/general.m4:2478: AC_TRY_RUN is expanded from...
 ../../lib/m4sugar/m4sh.m4:516: AS_IF is expanded from...
index 0f0fe712ae6d6e0cfa6d50da3b1812ef530de814..278f9e9e07c1d1a3bda668e6529bcce3006cfbdf 100755 (executable)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2007-03-06'
+timestamp='2007-07-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
-    i86pc:SunOS:5.*:*)
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
@@ -793,7 +793,7 @@ EOF
        exit ;;
     *:Interix*:[3456]*)
        case ${UNAME_MACHINE} in
-           x86) 
+           x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
            EM64T | authenticamd)
index 5defff65a6e4cd091921d9bcab0ab286092ec39e..1761d8bdf6307c02067b3581e183ba2fdef7e1fa 100755 (executable)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2007-01-18'
+timestamp='2007-06-28'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -475,8 +475,8 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16c)
-               basic_machine=cr16c-unknown
+       cr16)
+               basic_machine=cr16-unknown
                os=-elf
                ;;
        crds | unos)
@@ -683,6 +683,10 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-mingw32
                ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
index 6d9581844363ee3bcca59b2ee96e5145d52c840e..aec643115575bfd968b705ab49b9c2d5b1bc0349 100755 (executable)
--- a/configure
+++ b/configure
@@ -904,8 +904,8 @@ LIBNSL
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
 LIBSOCKET
 LIBCRYPT
 LIBBSD
@@ -944,8 +944,8 @@ FFLAGS
 PKG_CONFIG
 RPCSECGSS_CFLAGS
 RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1583,9 +1583,10 @@ Some influential environment variables:
               C compiler flags for RPCSECGSS, overriding pkg-config
   RPCSECGSS_LIBS
               linker flags for RPCSECGSS, overriding pkg-config
-  GSSAPI_CFLAGS
-              C compiler flags for GSSAPI, overriding pkg-config
-  GSSAPI_LIBS linker flags for GSSAPI, overriding pkg-config
+  GSSGLUE_CFLAGS
+              C compiler flags for GSSGLUE, overriding pkg-config
+  GSSGLUE_LIBS
+              linker flags for GSSGLUE, 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.
@@ -6686,7 +6687,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6689 "configure"' > conftest.$ac_ext
+  echo '#line 6690 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -8726,11 +8727,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:8729: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8730: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8733: \$? = $ac_status" >&5
+   echo "$as_me:8734: \$? = $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.
@@ -9016,11 +9017,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:9019: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9020: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9023: \$? = $ac_status" >&5
+   echo "$as_me:9024: \$? = $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.
@@ -9120,11 +9121,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:9123: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9124: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9127: \$? = $ac_status" >&5
+   echo "$as_me:9128: \$? = $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
@@ -11482,7 +11483,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11485 "configure"
+#line 11486 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11582,7 +11583,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11585 "configure"
+#line 11586 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14002,11 +14003,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:14005: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14006: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14009: \$? = $ac_status" >&5
+   echo "$as_me:14010: \$? = $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.
@@ -14106,11 +14107,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:14109: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14110: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14113: \$? = $ac_status" >&5
+   echo "$as_me:14114: \$? = $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
@@ -15683,11 +15684,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:15686: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15687: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15690: \$? = $ac_status" >&5
+   echo "$as_me:15691: \$? = $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.
@@ -15787,11 +15788,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:15790: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15791: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15794: \$? = $ac_status" >&5
+   echo "$as_me:15795: \$? = $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
@@ -17987,11 +17988,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:17990: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17991: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17994: \$? = $ac_status" >&5
+   echo "$as_me:17995: \$? = $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.
@@ -18277,11 +18278,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:18280: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18281: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18284: \$? = $ac_status" >&5
+   echo "$as_me:18285: \$? = $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.
@@ -18381,11 +18382,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:18384: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18385: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18388: \$? = $ac_status" >&5
+   echo "$as_me:18389: \$? = $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
@@ -22631,12 +22632,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_CFLAGS="$RPCSECGSS_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_CFLAGS=`$PKG_CONFIG --cflags "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22649,12 +22650,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_RPCSECGSS_LIBS="$RPCSECGSS_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"librpcsecgss >= 0.10\"") >&5
-  ($PKG_CONFIG --exists --print-errors "librpcsecgss >= 0.10") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.10" 2>/dev/null`
+  pkg_cv_RPCSECGSS_LIBS=`$PKG_CONFIG --libs "librpcsecgss >= 0.16" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22673,9 +22674,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         else
-               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.10"`
+               RPCSECGSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "librpcsecgss >= 0.16"`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$RPCSECGSS_PKG_ERRORS" >&5
@@ -22702,20 +22703,20 @@ echo "${ECHO_T}yes" >&6; }
 fi
 
 pkg_failed=no
-{ echo "$as_me:$LINENO: checking for GSSAPI" >&5
-echo $ECHO_N "checking for GSSAPI... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for GSSGLUE" >&5
+echo $ECHO_N "checking for GSSGLUE... $ECHO_C" >&6; }
 
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_CFLAGS"; then
-        pkg_cv_GSSAPI_CFLAGS="$GSSAPI_CFLAGS"
+    if test -n "$GSSGLUE_CFLAGS"; then
+        pkg_cv_GSSGLUE_CFLAGS="$GSSGLUE_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_CFLAGS=`$PKG_CONFIG --cflags "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_CFLAGS=`$PKG_CONFIG --cflags "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22724,16 +22725,16 @@ else
        pkg_failed=untried
 fi
 if test -n "$PKG_CONFIG"; then
-    if test -n "$GSSAPI_LIBS"; then
-        pkg_cv_GSSAPI_LIBS="$GSSAPI_LIBS"
+    if test -n "$GSSGLUE_LIBS"; then
+        pkg_cv_GSSGLUE_LIBS="$GSSGLUE_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgssapi >= 0.11\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libgssapi >= 0.11") 2>&5
+    { (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=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_GSSAPI_LIBS=`$PKG_CONFIG --libs "libgssapi >= 0.11" 2>/dev/null`
+  pkg_cv_GSSGLUE_LIBS=`$PKG_CONFIG --libs "libgssglue >= 0.1" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -22752,33 +22753,33 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         else
-               GSSAPI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssapi >= 0.11"`
+               GSSGLUE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgssglue >= 0.1"`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$GSSAPI_PKG_ERRORS" >&5
+       echo "$GSSGLUE_PKG_ERRORS" >&5
 
-       { { echo "$as_me:$LINENO: error: Package requirements (libgssapi >= 0.11) were not met:
+       { { echo "$as_me:$LINENO: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&5
-echo "$as_me: error: Package requirements (libgssapi >= 0.11) were not met:
+echo "$as_me: error: Package requirements (libgssglue >= 0.1) were not met:
 
-$GSSAPI_PKG_ERRORS
+$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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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.
 " >&2;}
    { (exit 1); exit 1; }; }
@@ -22787,8 +22788,8 @@ elif test $pkg_failed = untried; then
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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/>.
@@ -22797,16 +22798,16 @@ echo "$as_me: error: The pkg-config script could not be found or is too old.  Ma
 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 GSSAPI_CFLAGS
-and GSSAPI_LIBS to avoid the need to call 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
-       GSSAPI_CFLAGS=$pkg_cv_GSSAPI_CFLAGS
-       GSSAPI_LIBS=$pkg_cv_GSSAPI_LIBS
+       GSSGLUE_CFLAGS=$pkg_cv_GSSGLUE_CFLAGS
+       GSSGLUE_LIBS=$pkg_cv_GSSGLUE_LIBS
         { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
        :
@@ -24020,7 +24021,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24089,7 +24090,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpcsecgss -lgssapi -ldl $LIBS"
+LIBS="-lrpcsecgss -lgssglue -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30869,8 +30870,8 @@ LIBNSL!$LIBNSL$ac_delim
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 RPCSECGSS_CFLAGS!$RPCSECGSS_CFLAGS$ac_delim
 RPCSECGSS_LIBS!$RPCSECGSS_LIBS$ac_delim
-GSSAPI_CFLAGS!$GSSAPI_CFLAGS$ac_delim
-GSSAPI_LIBS!$GSSAPI_LIBS$ac_delim
+GSSGLUE_CFLAGS!$GSSGLUE_CFLAGS$ac_delim
+GSSGLUE_LIBS!$GSSGLUE_LIBS$ac_delim
 LIBSOCKET!$LIBSOCKET$ac_delim
 LIBCRYPT!$LIBCRYPT$ac_delim
 LIBBSD!$LIBBSD$ac_delim
index 1d07cd79f5f16ac008160e2ba3b41afa61df5788..a3789536ce69488e3044be8a9353199b49a72ce8 100644 (file)
@@ -181,11 +181,11 @@ if test "$enable_nfsv4" = yes; then
     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.10, ,
+     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(GSSAPI, libgssapi >= 0.11)
+    PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
     fi
 
 fi
@@ -228,9 +228,9 @@ if test "$enable_gss" = yes; then
 
   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]), -lgssapi -ldl)
+  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]),, -lgssapi -ldl)
+              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
 
@@ -284,7 +284,7 @@ AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
 
 
 dnl *************************************************************
-dnl Check for data sizes (XXX These should go away with libgssapi pkg-config)
+dnl Check for data sizes
 dnl *************************************************************
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
index 50c2bc8d1f1aa57eb3727ab7e2044dd422ef497e..6306c27c3b249da77aa4de896b960f46f47bbc27 100644 (file)
@@ -99,9 +99,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 89ef2213a5d0cfa4d3b006e0df59426e0b63025c..9797edfca9fd2bd7eb24b261ce95d2a7ca037e70 100644 (file)
@@ -107,9 +107,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 36c5607e379a41ed8d6a45428adb69a04bbb9b4b..cc540877e126bfffe10f2aea1ce7db2d6eb2b6b2 100644 (file)
@@ -123,9 +123,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 19b53aaa5f831be97aa859ea27470e0c70a95b40..1cb242f33fa62b993695df7c8623c7d9d9318a45 100644 (file)
@@ -118,6 +118,7 @@ client_dup(nfs_client *clp, struct hostent *hp)
        new = (nfs_client *) xmalloc(sizeof(*new));
        memcpy(new, clp, sizeof(*new));
        new->m_type = MCL_FQDN;
+       new->m_hostname = NULL;
 
        client_init(new, (char *) hp->h_name, hp);
        client_add(new);
@@ -127,14 +128,11 @@ client_dup(nfs_client *clp, struct hostent *hp)
 static void
 client_init(nfs_client *clp, const char *hname, struct hostent *hp)
 {
-       if (hp) {
-               strncpy(clp->m_hostname, hp->h_name,
-                       sizeof (clp->m_hostname) -  1);
-       } else {
-               strncpy(clp->m_hostname, hname,
-                       sizeof (clp->m_hostname) - 1);
-       }
-       clp->m_hostname[sizeof (clp->m_hostname) - 1] = '\0';
+       xfree(clp->m_hostname);
+       if (hp)
+               clp->m_hostname = xstrdup(hp->h_name);
+       else
+               clp->m_hostname = xstrdup(hname);
 
        clp->m_exported = 0;
        clp->m_count = 0;
@@ -207,6 +205,7 @@ client_freeall(void)
                head = clientlist + i;
                while (*head) {
                        *head = (clp = *head)->m_next;
+                       xfree(clp->m_hostname);
                        xfree(clp);
                }
        }
@@ -234,6 +233,19 @@ client_find(struct hostent *hp)
        return NULL;
 }
 
+struct hostent *
+client_resolve(struct in_addr addr)
+{
+       struct hostent *he = NULL;
+
+       if (clientlist[MCL_WILDCARD] || clientlist[MCL_NETGROUP])
+               he = get_reliable_hostbyaddr((const char*)&addr, sizeof(addr), AF_INET);
+       if (he == NULL)
+               he = get_hostent((const char*)&addr, sizeof(addr), AF_INET);
+
+       return he;
+}
+
 /*
  * Find client name given an IP address
  * This is found by gathering all known names that match that IP address,
@@ -243,17 +255,11 @@ client_find(struct hostent *hp)
 static char *add_name(char *old, char *add);
 
 char *
-client_compose(struct in_addr addr)
+client_compose(struct hostent *he)
 {
-       struct hostent *he = NULL;
        char *name = NULL;
        int i;
 
-       if (clientlist[MCL_WILDCARD] || clientlist[MCL_NETGROUP])
-               he = get_reliable_hostbyaddr((const char*)&addr, sizeof(addr), AF_INET);
-       if (he == NULL)
-               he = get_hostent((const char*)&addr, sizeof(addr), AF_INET);
-
        for (i = 0 ; i < MCL_MAXTYPES; i++) {
                nfs_client      *clp;
                for (clp = clientlist[i]; clp ; clp = clp->m_next) {
@@ -262,7 +268,6 @@ client_compose(struct in_addr addr)
                        name = add_name(name, clp->m_hostname);
                }
        }
-       free(he);
        return name;
 }
 
index 74e1d1b1bc46c68ace868e87775eed3580e46372..93c58b62c61f750a7c41247ed982097a4fa63971 100644 (file)
@@ -85,6 +85,8 @@ export_init(nfs_export *exp, nfs_client *clp, struct exportent *nep)
        struct exportent        *e = &exp->m_export;
 
        dupexportent(e, nep);
+       if (nep->e_hostname)
+               e->e_hostname = xstrdup(nep->e_hostname);
 
        exp->m_exported = 0;
        exp->m_xtabent = 0;
@@ -109,6 +111,8 @@ export_dup(nfs_export *exp, struct hostent *hp)
        new = (nfs_export *) xmalloc(sizeof(*new));
        memcpy(new, exp, sizeof(*new));
        dupexportent(&new->m_export, &exp->m_export);
+       if (exp->m_export.e_hostname)
+               new->m_export.e_hostname = xstrdup(exp->m_export.e_hostname);
        clp = client_dup(exp->m_client, hp);
        clp->m_count++;
        new->m_client = clp;
@@ -244,6 +248,7 @@ export_freeall(void)
                                free(exp->m_export.e_mountpoint);
                        if (exp->m_export.e_fslocdata)
                                xfree(exp->m_export.e_fslocdata);
+                       xfree(exp->m_export.e_hostname);
                        xfree(exp);
                }
                exportlist[i] = NULL;
index 15aab155ff18791c15d6ab68ba32f82d7909a5f6..2a882aaac0803177646b92acaa2061588e180ac9 100644 (file)
@@ -43,9 +43,7 @@ rmtab_read(void)
                        if (!exp2) {
                                struct exportent ee;
                                dupexportent(&ee, &exp->m_export);
-                               strncpy (ee.e_hostname, rep->r_client,
-                                        sizeof (ee.e_hostname) - 1);
-                               ee.e_hostname[sizeof (ee.e_hostname) -1] = '\0';
+                               ee.e_hostname = rep->r_client;
                                exp2 = export_create(&ee, 0);
                                exp2->m_changed = exp->m_changed;
                        }
index 292087b8c656bc07bd2cd5adea7f76815a7732f8..990113e14bf471da86269867a8b4b4ef4fb7528b 100644 (file)
@@ -108,10 +108,7 @@ xtab_write(char *xtab, char *xtabtmp, int is_export)
 
                        /* write out the export entry using the FQDN */
                        xe = exp->m_export;
-                       strncpy(xe.e_hostname,
-                               exp->m_client->m_hostname,
-                               sizeof (xe.e_hostname) - 1);
-                       xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0';
+                       xe.e_hostname = exp->m_client->m_hostname;
                        putexportent(&xe);
                }
        }
@@ -146,9 +143,7 @@ xtab_append(nfs_export *exp)
                return;
        setexportent(_PATH_XTAB, "a");
        xe = exp->m_export;
-       strncpy(xe.e_hostname, exp->m_client->m_hostname,
-              sizeof (xe.e_hostname) - 1);
-       xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0';
+       xe.e_hostname = exp->m_client->m_hostname;
        putexportent(&xe);
        endexportent();
        xfunlock(lockid);
index 4a9892baacd3399b237316ec9a4c2e590d7f4a2f..ad3030543ddba2f67ca1fb658824492989869c8e 100644 (file)
@@ -110,9 +110,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 431b5ce7701c0036668d8a61b31367f7b654c44f..c1ba54357fa677f9d9eb48cb5e2517ff8d63a0c3 100644 (file)
@@ -32,7 +32,7 @@ enum {
 
 typedef struct mclient {
        struct mclient *        m_next;
-       char                    m_hostname[NFSCLNT_IDMAX+1];
+       char *                  m_hostname;
        int                     m_type;
        int                     m_naddr;
        struct in_addr          m_addrlist[NFSCLNT_ADDRMAX];
@@ -64,7 +64,8 @@ int                           client_check(nfs_client *, struct hostent *);
 int                            client_match(nfs_client *, char *hname);
 void                           client_release(nfs_client *);
 void                           client_freeall(void);
-char *                         client_compose(struct in_addr addr);
+char *                         client_compose(struct hostent *he);
+struct hostent *               client_resolve(struct in_addr addr);
 int                            client_member(char *client, char *name);
 
 int                            export_read(char *fname);
index d9c71cfb74f9f018be9d3e407cbde8e9de26be6d..5c23c4824d3114d2c578aefacefbfcb6a9aab1cd 100644 (file)
@@ -103,9 +103,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 5af9c30c33b18d70864cde8c25a70cda1cb6cbf2..ffa2440a9e30e47ced11fef8878e9aaaee1b5b8d 100644 (file)
@@ -65,7 +65,7 @@ struct sec_entry {
  * allow overrides when using exportfs.
  */
 struct exportent {
-       char            e_hostname[NFSCLNT_IDMAX+1];
+       char *          e_hostname;
        char            e_path[NFS_MAXPATHLEN+1];
        /* The mount path may be different from the exported path due
           to submount. It may change for every mount. The idea is we
index 12356dadc8bb86480a9c3537d7c791621a4ca588..49a956b478abeb507a3ed5108adf789d39669513 100644 (file)
@@ -103,9 +103,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index f86258d6c6fc8bf6f1ccc50c1b8e1bfd1c20a4d0..4ffe5c4b3a6507e71b33a6e7c64269d56bdfea7a 100644 (file)
@@ -107,9 +107,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index bcf909090736d6107efe9c602185d286fbabe515..66ea7cefe30518943c6fb64d616f331630d7f9d7 100644 (file)
@@ -103,9 +103,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 9e23d12fb77c7465028eb9e62d7d1729532c447e..d1a4b18cae655611e8fbba8d7f5d62432f129a74 100644 (file)
@@ -36,6 +36,7 @@ extern void die(int err, const char *fmt, ...);
 extern void (*at_die)(void);
 
 /* exit status - bits below are ORed */
+#define EX_SUCCESS     0       /* no failure occurred */
 #define EX_USAGE       1       /* incorrect invocation or permission */
 #define EX_SYSERR      2       /* out of memory, cannot fork, ... */
 #define EX_SOFTWARE    4       /* internal mount bug or wrong version */
index 52e7a2cd8adcbb43ede8af9ab702284c9253368a..df28366dc1cd1128b04b2e4203ab0814bdc01c4b 100644 (file)
@@ -119,9 +119,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 87fb41d59b5789b6aeb00a51714419df385184c2..8a0a46e9c233971aa9433dcefe52529857f86ebb 100644 (file)
@@ -123,9 +123,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index c82bb0ef29433048bf4b5b3e1eccecc0be9d79b5..6b567081123edee90f976fd508847df6381ff4c6 100644 (file)
@@ -176,13 +176,8 @@ getexportent(int fromkernel, int fromexports)
                if (!has_default_opts)
                        xlog(L_WARNING, "No options for %s %s: suggest %s(sync) to avoid warning", ee.e_path, exp, exp);
        }
-       if (strlen(hostname) >= sizeof(ee.e_hostname)) {
-               syntaxerr("client name too long");
-               export_errno = EINVAL;
-               return NULL;
-       }
-       strncpy(ee.e_hostname, hostname, sizeof (ee.e_hostname) - 1);
-       ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0';
+       xfree(ee.e_hostname);
+       ee.e_hostname = xstrdup(hostname);
 
        if (parseopts(opt, &ee, fromexports && !has_default_subtree_opts, NULL) < 0)
                return NULL;
@@ -335,6 +330,7 @@ dupexportent(struct exportent *dst, struct exportent *src)
                dst->e_mountpoint = strdup(src->e_mountpoint);
        if (src->e_fslocdata)
                dst->e_fslocdata = strdup(src->e_fslocdata);
+       dst->e_hostname = NULL;
 }
 
 struct exportent *
@@ -355,12 +351,9 @@ mkexportent(char *hname, char *path, char *options)
        ee.e_nsqgids = 0;
        ee.e_uuid = NULL;
 
-       if (strlen(hname) >= sizeof(ee.e_hostname)) {
-               xlog(L_WARNING, "client name %s too long", hname);
-               return NULL;
-       }
-       strncpy(ee.e_hostname, hname, sizeof (ee.e_hostname) - 1);
-       ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0';
+       xfree(ee.e_hostname);
+       ee.e_hostname = xstrdup(hname);
+
        if (strlen(path) >= sizeof(ee.e_path)) {
                xlog(L_WARNING, "path name %s too long", path);
                return NULL;
index 7760ee895f4aed6541721156f9eaee2c3b720769..5e22fef5ce7b8ae91ba02c2f97c597d8eab73488 100644 (file)
@@ -108,9 +108,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 63e3cf75b09c952be3f4d4d577bb07c6e13c3021..59e30601655b63c998ad35f57f7e0a0ac9789eb2 100644 (file)
@@ -117,9 +117,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 599ab63c95525a7c6a0c660d07405499823f251b..8b719e546122111c873f2a1308dfad85fa3417a0 100644 (file)
@@ -98,9 +98,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index a5c6bad7e73ee3fa740485f676c4c64d11ad3626..868566007054763b4794278bd165cceed8959f1b 100644 (file)
@@ -122,9 +122,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 3e8619345ed6749d7bd6ad097b3e89e7218b8405..7439cd0e242e09a051aa7ef33e6df89aa6cd795c 100644 (file)
@@ -122,9 +122,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index c3cfd2867613d6f3945eefe70a317f7c9d9dc93b..e2027d67df101d52dd015746dda730925af2d3a9 100644 (file)
@@ -111,9 +111,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 05dd2aedad931337a869b267c66b6e9409ad2f66..90812c665ae08070decaeab0dd085bb502dac1fe 100644 (file)
@@ -128,9 +128,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 3873dba5ebc65a9d01e6c9428b7fbd070a4e9914..d7c32d98e232028ff618148cff325b011702c49c 100644 (file)
@@ -153,9 +153,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index b6c4ee429f3dbb6af3543986334ef5e154982d4c..bbcad20d1c7ae50882edd8f6afba93141c475c09 100644 (file)
@@ -81,7 +81,7 @@ sig_hup(int signal)
 static void
 usage(char *progname)
 {
-       fprintf(stderr, "usage: %s [-f] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir]\n",
+       fprintf(stderr, "usage: %s [-f] [-M] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir]\n",
                progname);
        exit(1);
 }
index 5a4ccc4c754672113810710e188d0503340d525b..dfba09145b463e0f655726d3947f10110bb650d0 100644 (file)
@@ -125,9 +125,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index a5d72924a65c7cf5f9d994cf20b2d041698612f4..27a01dec8d0481ba69b120b384901181ea2ff3f7 100644 (file)
@@ -9,11 +9,11 @@ man5_MANS     = nfs.man
 
 sbin_PROGRAMS  = mount.nfs
 EXTRA_DIST = nfsmount.x $(man8_MANS) $(man5_MANS)
-mount_nfs_SOURCES = mount.c error.c network.c fstab.c \
-                   nfsmount.c nfs4mount.c \
+mount_nfs_SOURCES = mount.c error.c network.c fstab.c token.c parse_opt.c \
+                   nfsmount.c nfs4mount.c stropts.c\
                    nfsumount.c \
-                   mount_constants.h error.h network.h fstab.h \
-                   nfs4_mount.h nfs_mount4.h
+                   mount_constants.h error.h network.h fstab.h token.h parse_opt.h \
+                   nfs4_mount.h nfs_mount4.h stropts.h
 
 mount_nfs_LDADD = ../../support/nfs/libnfs.a \
                  ../../support/export/libexport.a
index 244a7873ade5f9782572f2cb60ede97025fb710c..50eafa6006a48a4e6ca8515f71dd3c2d61b2ce91 100644 (file)
@@ -56,8 +56,9 @@ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(sbin_PROGRAMS)
 am_mount_nfs_OBJECTS = mount.$(OBJEXT) error.$(OBJEXT) \
-       network.$(OBJEXT) fstab.$(OBJEXT) nfsmount.$(OBJEXT) \
-       nfs4mount.$(OBJEXT) nfsumount.$(OBJEXT)
+       network.$(OBJEXT) fstab.$(OBJEXT) token.$(OBJEXT) \
+       parse_opt.$(OBJEXT) nfsmount.$(OBJEXT) nfs4mount.$(OBJEXT) \
+       stropts.$(OBJEXT) nfsumount.$(OBJEXT)
 mount_nfs_OBJECTS = $(am_mount_nfs_OBJECTS)
 mount_nfs_DEPENDENCIES = ../../support/nfs/libnfs.a \
        ../../support/export/libexport.a
@@ -127,9 +128,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
@@ -241,11 +242,11 @@ target_alias = @target_alias@
 man8_MANS = mount.nfs.man umount.nfs.man
 man5_MANS = nfs.man
 EXTRA_DIST = nfsmount.x $(man8_MANS) $(man5_MANS)
-mount_nfs_SOURCES = mount.c error.c network.c fstab.c \
-                   nfsmount.c nfs4mount.c \
+mount_nfs_SOURCES = mount.c error.c network.c fstab.c token.c parse_opt.c \
+                   nfsmount.c nfs4mount.c stropts.c\
                    nfsumount.c \
-                   mount_constants.h error.h network.h fstab.h \
-                   nfs4_mount.h nfs_mount4.h
+                   mount_constants.h error.h network.h fstab.h token.h parse_opt.h \
+                   nfs4_mount.h nfs_mount4.h stropts.h
 
 mount_nfs_LDADD = ../../support/nfs/libnfs.a \
                  ../../support/export/libexport.a
@@ -329,6 +330,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfs4mount.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfsmount.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfsumount.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_opt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stropts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
index cab84c97125ab88df4921fc995c7d4b20f2eaea6..10d4ed28e187ee9c224b3432ce600163a9543ed0 100644 (file)
@@ -76,7 +76,16 @@ static int rpc_strerror(int spos)
        return pos;
 }
 
-void mount_errors(char *server, int will_retry, int bg)
+/**
+ * rpc_mount_errors - log an RPC error that occurred during a user-space mount
+ * @server: C string containing name of server we are attempting to mount
+ * @will_retry: one indicates mount will retry at some later point
+ * @bg: one indicates this is a background mount
+ *
+ * Extracts the error code from the user-space RPC library, and reports it
+ * on stderr (fg mount) or in the system log (bg mount).
+ */
+void rpc_mount_errors(char *server, int will_retry, int bg)
 {
        int pos = 0;
        char *tmp;
@@ -121,15 +130,89 @@ void mount_errors(char *server, int will_retry, int bg)
                fprintf(stderr, "%s\n", errbuf);
 }
 
+/**
+ * sys_mount_errors - log an error that occurred during a mount system call
+ * @server: C string containing name of server we are attempting to mount
+ * @error: errno value to report
+ * @will_retry: one indicates mount will retry at some later point
+ * @bg: one indicates this is a background mount
+ *
+ * Passed an errno value generated by a mount system call, and reports it
+ * on stderr (fg mount) or in the system log (bg mount).
+ */
+void sys_mount_errors(char *server, int error, int will_retry, int bg)
+{
+       int pos = 0;
+       char *tmp;
+       static int onlyonce = 0;
+
+       tmp = &errbuf[pos];
+       if (bg)
+               pos = snprintf(tmp, (erreob - tmp),
+                               _("mount to NFS server '%s' failed: "),
+                                       server);
+       else
+               pos = snprintf(tmp, (erreob - tmp),
+                               _("%s: mount to NFS server '%s' failed: "),
+                                       progname, server);
+
+       tmp = &errbuf[pos];
+       if (error == ETIMEDOUT) {
+               if (will_retry)
+                       pos = snprintf(tmp, (erreob - tmp),
+                                       _("timed out, retrying"));
+               else
+                       pos = snprintf(tmp, (erreob - tmp),
+                                       _("timed out, giving up"));
+       } else {
+               if (bg) {
+                       if (will_retry)
+                               pos = snprintf(tmp, (erreob - tmp),
+                                               _("%s, retrying"),
+                                               strerror(error));
+                       else
+                               pos = snprintf(tmp, (erreob - tmp),
+                                               _("%s, giving up"),
+                                               strerror(error));
+               }
+       }
+
+       if (bg) {
+               if (onlyonce++ < 1)
+                       openlog("mount", LOG_CONS|LOG_PID, LOG_AUTH);
+               syslog(LOG_ERR, "%s", errbuf);
+       } else
+               fprintf(stderr, "%s\n", errbuf);
+}
+
+/**
+ * mount_error - report a foreground mount error
+ * @spec: C string containing the device name being mounted
+ * @mount_point: C string containing the pathname of the local mounted on dir
+ * @error: errno value to report
+ *
+ */
 void mount_error(const char *spec, const char *mount_point, int error)
 {
        switch(error) {
+       case EACCES:
+               nfs_error(_("%s: access denied by server while mounting %s"),
+                               progname, spec);
+               break;
+       case EINVAL:
+               nfs_error(_("%s: an incorrect mount option was specified"), progname);
+               break;
+       case EOPNOTSUPP:
+               nfs_error(_("%s: requested NFS version or transport"
+                               " protocol is not supported"),
+                               progname);
+               break;
        case ENOTDIR:
                nfs_error(_("%s: mount point %s is not a directory"),
                                progname, mount_point);
                break;
        case EBUSY:
-               nfs_error(_("%s: %s is already mounted or busy"),
+               nfs_error(_("%s: %s is busy or already mounted"),
                        progname, mount_point);
                break;
        case ENOENT:
@@ -141,6 +224,10 @@ void mount_error(const char *spec, const char *mount_point, int error)
                        nfs_error(_("%s: mount point %s does not exist"),
                                progname, mount_point);
                break;
+       case EIO:
+       case EFAULT:
+               nfs_error(_("%s: internal error"), progname);
+               break;
        default:
                nfs_error(_("%s: %s"),
                        progname, strerror(error));
@@ -148,7 +235,10 @@ void mount_error(const char *spec, const char *mount_point, int error)
 }
 
 /*
- * Report a failed umount
+ * umount_error - report a failed umount request
+ * @err: errno value to report
+ * @dev: C string containing the pathname of the local mounted on dir
+ *
  */
 void umount_error(int err, const char *dev)
 {
index 5e4b01b188d4e30f7b86c3ef4b644f7b83399c5b..8b8e9ae40ca8295cb7fe0598058555bdad04e1ef 100644 (file)
@@ -24,5 +24,7 @@
 char *nfs_strerror(int);
 
 void mount_error(const char *, const char *, int);
-void mount_errors(char *, int, int);
+void rpc_mount_errors(char *, int, int);
+void sys_mount_errors(char *, int, int, int);
+
 void umount_error(int, const char *);
index a2325196160067ef6129fe15da05543cf414558b..e6222317530da30c1ad56e2a217861d60cc2cdab 100644 (file)
 #include "mount.h"
 #include "error.h"
 #include "network.h"
+#include "stropts.h"
 
 char *progname;
 int nfs_mount_data_version;
 int nomtab;
 int verbose;
 int sloppy;
+int string;
 
 #define FOREGROUND     (0)
 #define BACKGROUND     (1)
@@ -62,6 +64,7 @@ static struct option longopts[] = {
   { "version", 0, 0, 'V' },
   { "read-write", 0, 0, 'w' },
   { "rw", 0, 0, 'w' },
+  { "string", 0, 0, 'i' },
   { "options", 1, 0, 'o' },
   { NULL, 0, 0, 0 }
 };
@@ -234,7 +237,8 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,
 
        if (flags & MS_REMOUNT) {
                update_mtab(ment.mnt_dir, &ment);
-               return 0;
+               free(ment.mnt_opts);
+               return EX_SUCCESS;
        }
 
        lock_mtab();
@@ -258,19 +262,20 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,
                goto fail_close;
        }
 
-       result = 0;
+       result = EX_SUCCESS;
 
 fail_close:
        endmntent(mtab);
 fail_unlock:
        unlock_mtab();
+       free(ment.mnt_opts);
 
        return result;
 }
 
 void mount_usage(void)
 {
-       printf(_("usage: %s remotetarget dir [-rvVwfnh] [-o nfsoptions]\n"),
+       printf(_("usage: %s remotetarget dir [-rvVwfnsih] [-o nfsoptions]\n"),
                progname);
        printf(_("options:\n"));
        printf(_("\t-r\t\tMount file system readonly\n"));
@@ -279,7 +284,8 @@ void mount_usage(void)
        printf(_("\t-w\t\tMount file system read-write\n"));
        printf(_("\t-f\t\tFake mount, do not actually mount\n"));
        printf(_("\t-n\t\tDo not update /etc/mtab\n"));
-       printf(_("\t-s\t\tTolerate sloppy mount options rather than failing.\n"));
+       printf(_("\t-s\t\tTolerate sloppy mount options rather than fail\n"));
+       printf(_("\t-i\t\tPass mount options to the kernel via a string\n"));
        printf(_("\t-h\t\tPrint this help\n"));
        printf(_("\tnfsoptions\tRefer to mount.nfs(8) or nfs(5)\n\n"));
 }
@@ -370,12 +376,21 @@ static int try_mount(char *spec, char *mount_point, int flags,
 {
        int ret;
 
-       if (strcmp(fs_type, "nfs4") == 0)
-               ret = nfs4mount(spec, mount_point, flags,
-                               extra_opts, fake, bg);
-       else
-               ret = nfsmount(spec, mount_point, flags,
-                               extra_opts, fake, bg);
+       if (string) {
+               if (strcmp(fs_type, "nfs4") == 0)
+                       ret = nfs4mount_s(spec, mount_point, flags,
+                                               extra_opts, fake, bg);
+               else
+                       ret = nfsmount_s(spec, mount_point, flags,
+                                               extra_opts, fake, bg);
+       } else {
+               if (strcmp(fs_type, "nfs4") == 0)
+                       ret = nfs4mount(spec, mount_point, flags,
+                                       extra_opts, fake, bg);
+               else
+                       ret = nfsmount(spec, mount_point, flags,
+                                       extra_opts, fake, bg);
+       }
 
        if (ret)
                return ret;
@@ -408,7 +423,7 @@ int main(int argc, char *argv[])
                        printf("%s ("PACKAGE_STRING")\n", progname);
                else
                        mount_usage();
-               exit(0);
+               exit(EX_SUCCESS);
        }
 
        if ((argc < 3)) {
@@ -420,7 +435,7 @@ int main(int argc, char *argv[])
        mount_point = argv[2];
 
        argv[2] = argv[0]; /* so that getopt error messages are correct */
-       while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hs",
+       while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hsi",
                                longopts, NULL)) != -1) {
                switch (c) {
                case 'r':
@@ -431,7 +446,7 @@ int main(int argc, char *argv[])
                        break;
                case 'V':
                        printf("%s: ("PACKAGE_STRING")\n", progname);
-                       return 0;
+                       exit(EX_SUCCESS);
                case 'w':
                        flags &= ~MS_RDONLY;
                        break;
@@ -450,10 +465,24 @@ int main(int argc, char *argv[])
                case 's':
                        ++sloppy;
                        break;
+               case 'i':
+                       if (linux_version_code() < MAKE_VERSION(2, 6, 23)) {
+                               nfs_error(_("%s: Passing mount options via a"
+                                       " string is unsupported by this"
+                                       " kernel\n"), progname);
+                               goto out_usage;
+                       }
+                       if (uid != 0) {
+                               nfs_error(_("%s: -i option is restricted to 'root'\n"),
+                                       progname);
+                               goto out_usage;
+                       }
+                       ++string;
+                       break;
                case 'h':
                default:
                        mount_usage();
-                       exit(EX_USAGE);
+                       goto out_usage;
                }
        }
 
@@ -462,7 +491,7 @@ int main(int argc, char *argv[])
         */
        if (optind != argc - 2) {
                mount_usage();
-               exit(EX_USAGE);
+               goto out_usage;
        }
 
        if (strcmp(progname, "mount.nfs4") == 0)
@@ -481,7 +510,7 @@ int main(int argc, char *argv[])
                    strcmp(mc->m.mnt_type, fs_type) != 0) {
                        nfs_error(_("%s: permission denied: no match for %s "
                                "found in /etc/fstab"), progname, mount_point);
-                       exit(EX_USAGE);
+                       goto out_usage;
                }
 
                /*
@@ -496,7 +525,7 @@ int main(int argc, char *argv[])
        mount_point = canonicalize(mount_point);
        if (!mount_point) {
                nfs_error(_("%s: no mount point provided"), progname);
-               exit(EX_USAGE);
+               goto out_usage;
        }
        if (mount_point[0] != '/') {
                nfs_error(_("%s: unrecognized mount point %s"),
@@ -523,15 +552,19 @@ int main(int argc, char *argv[])
        mnt_err = try_mount(spec, mount_point, flags, fs_type, &extra_opts,
                                mount_opts, fake, nomtab, FOREGROUND);
        if (mnt_err == EX_BG) {
-               printf(_("mount: backgrounding \"%s\"\n"), spec);
+               printf(_("%s: backgrounding \"%s\"\n"),
+                       progname, spec);
                fflush(stdout);
 
                /*
-                * Parent exits immediately with success.  Make
-                * sure not to free "mount_point"
+                * Parent exits immediately with success.
                 */
-               if (fork() > 0)
-                       exit(0);
+               if (daemon(0, 0)) {
+                       nfs_error(_("%s: failed to start "
+                                       "background process: %s\n"),
+                                               progname, strerror(errno));
+                       exit(EX_FAIL);
+               }
 
                mnt_err = try_mount(spec, mount_point, flags, fs_type,
                                        &extra_opts, mount_opts, fake,
@@ -539,10 +572,15 @@ int main(int argc, char *argv[])
                if (verbose && mnt_err)
                        printf(_("%s: giving up \"%s\"\n"),
                                progname, spec);
-               exit(0);
        }
 
 out:
+       free(mount_opts);
+       free(extra_opts);
        free(mount_point);
        exit(mnt_err);
+
+out_usage:
+       free(mount_opts);
+       exit(EX_USAGE);
 }
index 231e04f70efb0d8d9a91fe1b68d8a1b0c7ea37fb..624358ccdf78db00235d35c01420fff6f22f7418 100644 (file)
@@ -3,7 +3,7 @@
 .SH NAME
 mount.nfs, mount.nfs4 \- mount a Network File System
 .SH SYNOPSIS
-.BI "mount.nfs" " remotetarget dir" " [\-rvVwfnh ] [\-t " version "] [\-o " options "]
+.BI "mount.nfs" " remotetarget dir" " [\-rvVwfnsh ] [\-o " options "]
 .SH DESCRIPTION
 .BR mount.nfs
 is a part of 
@@ -49,27 +49,17 @@ By default, an entry is created in
 .I /etc/mtab 
 for every mounted file system. Use this option to skip making an entry.
 .TP
+.BI "\-s"
+Tolerate sloppy mount options rather than fail.
+.TP
 .BI "\-h"
 Print help message.
 .TP
-.BI "version"
-Specify NFS file system version. Either
-.BR nfs4 
-or 
-.BR nfs.
-If the command is 
-.BR mount.nfs4 
-or the 
-.I vfstype 
-option of 
-.BR mount(8) 
-command is nfs4, then version 4 is used, else version 3 or 2 is used.
-.TP
 .BI "nfsoptions"
 Refer to 
-.BR nfs(5)
+.BR nfs (5)
 or
-.BR mount(8) 
+.BR mount (8) 
 manual pages.
 
 .SH NOTE
@@ -92,9 +82,8 @@ table of mounted file systems
 .BR nfs (5),
 .BR mount (8),
 
-.SH BUGS
-Please notify current developers of NFS of any bugs in the current software or mail nfs@lists.sourceforge.net
+.SH "BUGS"
+Please notify nfs@lists.sourceforge.net of any bugs found in this software.
 
 .SH "AUTHOR"
 Amit Gud <agud@redhat.com>
-
index 5a56c23ce20f9b9ca6333d9f1e08f837a8d18925..49d3c6b26d63c33c4b83ae6f497e1fb2a809f87f 100644 (file)
@@ -139,6 +139,13 @@ static const unsigned long probe_mnt3_first[] = {
        0,
 };
 
+/**
+ * nfs_gethostbyname - resolve a hostname to an IPv4 address
+ * @hostname: pointer to a C string containing a DNS hostname
+ * @saddr: returns an IPv4 address 
+ *
+ * Returns 1 if successful, otherwise zero.
+ */
 int nfs_gethostbyname(const char *hostname, struct sockaddr_in *saddr)
 {
        struct hostent *hp;
@@ -303,14 +310,16 @@ static unsigned short getport(struct sockaddr_in *saddr,
                                unsigned long version,
                                unsigned int proto)
 {
+       struct sockaddr_in bind_saddr;
        unsigned short port = 0;
        int socket;
        CLIENT *clnt = NULL;
        enum clnt_stat stat;
+       bind_saddr = *saddr;
+       bind_saddr.sin_port = htons(PMAPPORT);
 
-       saddr->sin_port = htons(PMAPPORT);
-
-       socket = get_socket(saddr, proto, PMAP_TIMEOUT, FALSE, FALSE);
+       socket = get_socket(&bind_saddr, proto, PMAP_TIMEOUT, FALSE, FALSE);
        if (socket == RPC_ANYSOCK) {
                if (proto == IPPROTO_TCP &&
                    rpc_createerr.cf_error.re_errno == ETIMEDOUT)
@@ -320,14 +329,16 @@ static unsigned short getport(struct sockaddr_in *saddr,
 
        switch (proto) {
        case IPPROTO_UDP:
-               clnt = clntudp_bufcreate(saddr,
+               clnt = clntudp_bufcreate(&bind_saddr,
                                         PMAPPROG, PMAPVERS,
                                         RETRY_TIMEOUT, &socket,
                                         RPCSMALLMSGSIZE,
                                         RPCSMALLMSGSIZE);
                break;
        case IPPROTO_TCP:
-               clnt = clnttcp_create(saddr, PMAPPROG, PMAPVERS, &socket,
+               clnt = clnttcp_create(&bind_saddr,
+                                     PMAPPROG, PMAPVERS,
+                                     &socket,
                                      RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
                break;
        }
@@ -388,7 +399,7 @@ static int probe_port(clnt_addr_t *server, const unsigned long *versions,
                                                inet_ntoa(saddr->sin_addr),
                                                prog, *p_vers,
                                                *p_prot == IPPROTO_UDP ?
-                                                       "udp" : "tcp",
+                                                       _("UDP") : _("TCP"),
                                                p_port);
                                 }
                                if (clnt_ping(saddr, prog, *p_vers, *p_prot, NULL))
@@ -453,6 +464,16 @@ static int probe_mntport(clnt_addr_t *mnt_server)
                return probe_port(mnt_server, probe_mnt1_first, probe_udp_only);
 }
 
+/**
+ * probe_bothports - discover the RPC endpoints of mountd and NFS server
+ * @mnt_server: pointer to address and pmap argument for mountd results
+ * @nfs_server: pointer to address and pmap argument for NFS server
+ *
+ * Returns 1 if successful, otherwise zero if some error occurred.
+ * Note that the arguments are both input and output arguments.
+ *
+ * A side effect of calling this function is that rpccreateerr is set.
+ */
 int probe_bothports(clnt_addr_t *mnt_server, clnt_addr_t *nfs_server)
 {
        struct pmap *nfs_pmap = &nfs_server->pmap;
@@ -520,8 +541,10 @@ static int probe_statd(void)
        return 1;
 }
 
-/*
- * Attempt to start rpc.statd
+/**
+ * start_statd - attempt to start rpc.statd
+ *
+ * Returns 1 if statd is running; otherwise zero.
  */
 int start_statd(void)
 {
@@ -545,7 +568,7 @@ int start_statd(void)
        return 0;
 }
 
-/*
+/**
  * nfs_call_umount - ask the server to remove a share from it's rmtab
  * @mnt_server: address of RPC MNT program server
  * @argp: directory path of share to "unmount"
@@ -589,6 +612,13 @@ int nfs_call_umount(clnt_addr_t *mnt_server, dirpath *argp)
        return 0;
 }
 
+/**
+ * mnt_openclnt - get a handle for a remote mountd service
+ * @mnt_server: address and pmap arguments of mountd service
+ * @msock: returns a file descriptor of the underlying transport socket
+ *
+ * Returns an active handle for the remote's mountd service
+ */
 CLIENT *mnt_openclnt(clnt_addr_t *mnt_server, int *msock)
 {
        struct sockaddr_in *mnt_saddr = &mnt_server->saddr;
@@ -630,6 +660,12 @@ CLIENT *mnt_openclnt(clnt_addr_t *mnt_server, int *msock)
        return NULL;
 }
 
+/**
+ * mnt_closeclnt - terminate a handle for a remote mountd service
+ * @clnt: pointer to an active handle for a remote mountd service
+ * @msock: file descriptor of the underlying transport socket
+ *
+ */
 void mnt_closeclnt(CLIENT *clnt, int msock)
 {
        auth_destroy(clnt->cl_auth);
@@ -637,11 +673,24 @@ void mnt_closeclnt(CLIENT *clnt, int msock)
        close(msock);
 }
 
-/*
+/**
+ * clnt_ping - send an RPC ping to the remote RPC service endpoint
+ * @saddr: server's address
+ * @prog: target RPC program number
+ * @vers: target RPC version number
+ * @prot: target RPC protocol
+ * @caddr: filled in with our network address
+ *
  * Sigh... getport() doesn't actually check the version number.
  * In order to make sure that the server actually supports the service
  * we're requesting, we open and RPC client, and fire off a NULL
  * RPC call.
+ *
+ * caddr is the network address that the server will use to call us back.
+ * On multi-homed clients, this address depends on which NIC we use to
+ * route requests to the server.
+ *
+ * Returns one if successful, otherwise zero.
  */
 int clnt_ping(struct sockaddr_in *saddr, const unsigned long prog,
                const unsigned long vers, const unsigned int prot,
@@ -711,3 +760,36 @@ int clnt_ping(struct sockaddr_in *saddr, const unsigned long prog,
        else
                return 0;
 }
+
+/**
+ * get_client_address - acquire our local network address
+ * @saddr: server's address
+ * @caddr: filled in with our network address
+ *
+ * Discover a network address that the server will use to call us back.
+ * On multi-homed clients, this address depends on which NIC we use to
+ * route requests to the server.
+ *
+ * Use a connected datagram socket so as not to leave a socket in TIME_WAIT.
+ *
+ * Returns one if successful, otherwise zero.
+ */
+int get_client_address(struct sockaddr_in *saddr, struct sockaddr_in *caddr)
+{
+       socklen_t len = sizeof(*caddr);
+       int socket, err;
+
+       socket = get_socket(saddr, IPPROTO_UDP, CONNECT_TIMEOUT, FALSE, TRUE);
+       if (socket == RPC_ANYSOCK)
+               return 0;
+
+       err = getsockname(socket, caddr, &len);
+       close(socket);
+
+       if (err && verbose) {
+               nfs_error(_("%s: getsockname failed: %s"),
+                               progname, strerror(errno));
+               return 0;
+       }
+       return 1;
+}
index 2e4dbbc578ed370682ce1d72acdeaf9ec59275e1..99ecc1ece6c753d6c8de99e2fa4dda6b6727675f 100644 (file)
@@ -48,6 +48,7 @@ static const struct timeval RETRY_TIMEOUT = { 3, 0 };
 
 int probe_bothports(clnt_addr_t *, clnt_addr_t *);
 int nfs_gethostbyname(const char *, struct sockaddr_in *);
+int get_client_address(struct sockaddr_in *, struct sockaddr_in *);
 int nfs_call_umount(clnt_addr_t *, dirpath *);
 int clnt_ping(struct sockaddr_in *, const unsigned long,
                const unsigned long, const unsigned int,
index e66daba57886bd7ff31a9abe3ee7aa57f0cd8d77..d92da1905a74a64cdc882e93ac90176abcacce52 100644 (file)
@@ -411,11 +411,23 @@ Valid protocol types are
 and
 .IR tcp .
 .TP 1.5i
-.I clientaddr=n
-On a multi-homed client, this
-causes the client to use a specific callback address when
-communicating with an NFS version 4 server.
-This option is currently ignored.
+.I clientaddr=n.n.n.n
+Specifies a single IPv4 address in dotted-quad form that
+the NFS client advertises to allow servers to perform
+NFSv4 callback requests against files on this mount point.
+If the server is not able to establish callback connections
+to clients, performance may degrade, or accesses to
+files may temporarily hang.
+.IP
+If this option is not specified, the
+.BR mount (8)
+command attempts to discover an appropriate callback
+address automatically.
+The automatic discovery process is not perfect, however.
+In the presence of multiple client network interfaces, special
+routing policies, or atypical network topologies, the exact
+address to use for callbacks may be nontrivial to determine,
+and should be explicitly set using this mount option.
 .TP 1.5i
 .I sec=mode
 Same as \f3sec=mode\f1 for the nfs filesystem type (see above).
index c4e8bfb0a3ba7d1a04339604d8e6db55fbeb13a7..0a32c3c4f644444e135ebb2405b6130077960fc3 100644 (file)
@@ -428,15 +428,15 @@ int nfs4mount(const char *spec, const char *node, int flags,
                        if (errno == ETIMEDOUT)
                                break;
                default:
-                       mount_errors(hostname, 0, bg);
+                       rpc_mount_errors(hostname, 0, bg);
                        goto fail;
                }
                t = time(NULL);
                if (t >= timeout) {
-                       mount_errors(hostname, 0, bg);
+                       rpc_mount_errors(hostname, 0, bg);
                        goto fail;
                }
-               mount_errors(hostname, 1, bg);
+               rpc_mount_errors(hostname, 1, bg);
                continue;
        }
 
@@ -448,7 +448,7 @@ int nfs4mount(const char *spec, const char *node, int flags,
                }
        }
 
-       return 0;
+       return EX_SUCCESS;
 
 fail:
        return retval;
index 583948208e0b43e741ec152dfadac84d04519cb8..23dd2f607eafcbb739bc6d0e461dd28cb0666f79 100644 (file)
@@ -688,15 +688,15 @@ nfsmount(const char *spec, const char *node, int flags,
                                if (errno == ETIMEDOUT)
                                        break;
                        default:
-                               mount_errors(*nfs_server.hostname, 0, bg);
+                               rpc_mount_errors(*nfs_server.hostname, 0, bg);
                        goto fail;
                        }
                        t = time(NULL);
                        if (t >= timeout) {
-                               mount_errors(*nfs_server.hostname, 0, bg);
+                               rpc_mount_errors(*nfs_server.hostname, 0, bg);
                                goto fail;
                        }
-                       mount_errors(*nfs_server.hostname, 1, bg);
+                       rpc_mount_errors(*nfs_server.hostname, 1, bg);
                        continue;
                }
                if (!running_bg) {
@@ -707,11 +707,11 @@ nfsmount(const char *spec, const char *node, int flags,
                }
                t = time(NULL);
                if (t >= timeout) {
-                       mount_errors(*nfs_server.hostname, 0, bg);
+                       rpc_mount_errors(*nfs_server.hostname, 0, bg);
                        goto fail;
                }
                if (doonce++ < 1)
-                       mount_errors(*nfs_server.hostname, 1, bg);
+                       rpc_mount_errors(*nfs_server.hostname, 1, bg);
        }
 
        if (nfs_pmap->pm_vers == 2) {
@@ -863,7 +863,7 @@ noauth_flavors:
                }
        }
 
-       return 0;
+       return EX_SUCCESS;
 
        /* abort */
  fail:
index a78ab266f6664fbf42b6a91998121e6d1713ede7..8902f0088a0533abdd3a0d64a06ac938d4231d86 100644 (file)
@@ -51,72 +51,85 @@ int force;
 int lazy;
 int remount;
 
+
+static int try_remount(const char *spec, const char *node)
+{
+       int res;
+
+       res = mount(spec, node, NULL,
+                   MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
+       if (res == 0) {
+               struct mntent remnt;
+               nfs_error(_("%s: %s busy - remounted read-only"),
+                               progname, spec);
+               remnt.mnt_type = remnt.mnt_fsname = NULL;
+               remnt.mnt_dir = xstrdup(node);
+               remnt.mnt_opts = xstrdup("ro");
+               if (!nomtab)
+                       update_mtab(node, &remnt);
+       } else if (errno != EBUSY) {    /* hmm ... */
+               perror(_("remount"));
+               nfs_error(_("%s: could not remount %s read-only"),
+                               progname, spec);
+       }
+       return res;
+}
+
 static int del_mtab(const char *spec, const char *node)
 {
        int umnt_err, res;
 
-        umnt_err = 0;
-        if (lazy) {
-                res = umount2 (node, MNT_DETACH);
-                if (res < 0)
-                        umnt_err = errno;
-                goto writemtab;
-        }
-
-        if (force) {
-                res = umount2 (node, MNT_FORCE);
-                if (res == -1) {
-                        int errsv = errno;
-                        perror(_("umount2"));
-                        errno = errsv;
-                        if (errno == ENOSYS) {
-                                if (verbose)
-                                        printf(_("no umount2, trying umount...\n"));
-                                res = umount (node);
-                        }
-                }
-        } else
-                res = umount (node);
-
-        if (res < 0 && remount && errno == EBUSY && spec) {
-                /* Umount failed - let us try a remount */
-                res = mount(spec, node, NULL,
-                            MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
-                if (res == 0) {
-                        struct mntent remnt;
-                        nfs_error(_("%s: %s busy - remounted read-only"),
-                                       progname, spec);
-                        remnt.mnt_type = remnt.mnt_fsname = NULL;
-                        remnt.mnt_dir = xstrdup(node);
-                        remnt.mnt_opts = xstrdup("ro");
-                        if (!nomtab)
-                                update_mtab(node, &remnt);
-                        return 0;
-                } else if (errno != EBUSY) {    /* hmm ... */
-                        perror(_("remount"));
-                        nfs_error(_("%s: could not remount %s read-only"),
-                                       progname, spec);
-                }
-        }
-
-        if (res >= 0) {
-                /* Umount succeeded */
-                if (verbose)
-                        printf(_("%s umounted\n"), spec ? spec : node);
-        }
+       umnt_err = 0;
+       if (lazy) {
+               res = umount2 (node, MNT_DETACH);
+               if (res < 0)
+                       umnt_err = errno;
+               goto writemtab;
+       }
+
+       if (force) {
+               res = umount2 (node, MNT_FORCE);
+               if (res == -1) {
+                       int errsv = errno;
+                       perror(_("umount2"));
+                       errno = errsv;
+                       if (errno == ENOSYS) {
+                               if (verbose)
+                                       printf(_("no umount2, trying umount...\n"));
+                               res = umount (node);
+                       }
+               }
+       } else
+               res = umount (node);
+
+       if (res < 0) {
+               if (remount && errno == EBUSY && spec) {
+                       res = try_remount(spec, node);
+                       if (res)
+                               goto writemtab;
+                       return 0;
+               } else
+                       umnt_err = errno;
+       }
+
+       if (res >= 0) {
+               /* Umount succeeded */
+               if (verbose)
+                       printf(_("%s umounted\n"), spec ? spec : node);
+       }
 
  writemtab:
-        if (!nomtab &&
-            (umnt_err == 0 || umnt_err == EINVAL || umnt_err == ENOENT)) {
-               update_mtab(node, NULL);
-        }
+       if (!nomtab &&
+           (umnt_err == 0 || umnt_err == EINVAL || umnt_err == ENOENT)) {
+               update_mtab(node, NULL);
+       }
 
-        if (res >= 0)
-                return 0;
+       if (res >= 0)
+               return 0;
 
-        if (umnt_err)
-                umount_error(umnt_err, node);
-        return EX_FILEIO;
+       if (umnt_err)
+               umount_error(umnt_err, node);
+       return EX_FILEIO;
 }
 
 /*
@@ -209,7 +222,7 @@ static int do_nfs_umount(const char *spec, char *opts)
                return EX_USAGE;
        }
 
-       return 0;
+       return EX_SUCCESS;
 }
 
 static struct option umount_longopts[] =
@@ -305,7 +318,7 @@ int nfsumount(int argc, char *argv[])
                        /* umount might call us twice.  The second time there will
                         * be no entry in mtab and we should just exit quietly
                         */
-                       return 0;
+                       return EX_SUCCESS;
 
                only_root:
                        nfs_error(_("%s: You are not permitted to unmount %s"),
@@ -335,7 +348,7 @@ int nfsumount(int argc, char *argv[])
 
        ret = 0;
        if (mc) {
-               if (!lazy)
+               if (!lazy && strcmp(mc->m.mnt_type, "nfs4") != 0)
                        ret = do_nfs_umount(mc->m.mnt_fsname, mc->m.mnt_opts);
                if (!ret || force)
                        ret = del_mtab(mc->m.mnt_fsname, mc->m.mnt_dir);
diff --git a/utils/mount/parse_opt.c b/utils/mount/parse_opt.c
new file mode 100644 (file)
index 0000000..fb4a0e4
--- /dev/null
@@ -0,0 +1,430 @@
+/*
+ * parse_opt.c -- mount option string parsing helpers
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+/*
+ * Converting a C string containing mount options to a data object
+ * and manipulating that object is cleaner in C than manipulating
+ * the C string itself.  This is similar to the way Python handles
+ * string manipulation.
+ *
+ * The current implementation uses a linked list as the data object
+ * since lists are simple, and we don't need to worry about more
+ * than ten or twenty options at a time.
+ *
+ * Hopefully the interface is abstract enough that the underlying
+ * data structure can be replaced if needed without changing the API.
+ */
+
+
+#include <ctype.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include "parse_opt.h"
+#include "token.h"
+
+
+struct mount_option {
+       struct mount_option *next, *prev;
+       char *keyword;
+       char *value;
+};
+
+struct mount_options {
+       struct mount_option *head, *tail;
+       unsigned int count;
+};
+
+static struct mount_option *option_create(char *str)
+{
+       struct mount_option *option;
+       char *opteq;
+
+       if (!str)
+               return NULL;
+
+       option = malloc(sizeof(*option));
+       if (!option)
+               return NULL;
+       
+       option->next = NULL;
+       option->prev = NULL;
+
+       opteq = strchr(str, '=');
+       if (opteq) {
+               option->keyword = strndup(str, opteq - str);
+               if (!option->keyword)
+                       goto fail;
+               option->value = strdup(opteq + 1);
+               if (!option->value) {
+                       free(option->keyword);
+                       goto fail;
+               }
+       } else {
+               option->keyword = strdup(str);
+               if (!option->keyword)
+                       goto fail;
+               option->value = NULL;
+       }
+
+       return option;
+
+fail:
+       free(option);
+       return NULL;
+}
+
+static void option_destroy(struct mount_option *option)
+{
+       free(option->keyword);
+       free(option->value);
+       free(option);
+}
+
+static void options_init(struct mount_options *options)
+{
+       options->head = options->tail = NULL;
+       options->count = 0;
+}
+
+static struct mount_options *options_create(void)
+{
+       struct mount_options *options;
+
+       options = malloc(sizeof(*options));
+       if (options)
+               options_init(options);
+
+       return options;
+}
+
+static int options_empty(struct mount_options *options)
+{
+       return options->count == 0;
+}
+
+static void options_tail_insert(struct mount_options *options,
+                               struct mount_option *option)
+{
+       struct mount_option *prev = options->tail;
+
+       option->next = NULL;
+       option->prev = prev;
+
+       if (prev)
+               prev->next = option;
+       else
+               options->head = option;
+       options->tail = option;
+
+       options->count++;
+}
+
+static void options_delete(struct mount_options *options,
+                          struct mount_option *option)
+{
+       struct mount_option *prev = option->prev;
+       struct mount_option *next = option->next;
+
+       if (!options_empty(options)) {
+               if (prev)
+                       prev->next = option->next;
+               if (next)
+                       next->prev = option->prev;
+
+               if (options->head == option)
+                       options->head = option->next;
+               if (options->tail == option)
+                       options->tail = prev;
+
+               options->count--;
+
+               option_destroy(option);
+       }
+}
+
+
+/**
+ * po_destroy - deallocate a group of mount options
+ * @options: pointer to mount options to free
+ *
+ */
+void po_destroy(struct mount_options *options)
+{
+       if (options) {
+               while (!options_empty(options))
+                       options_delete(options, options->head);
+               free(options);
+       }
+}
+
+/**
+ * po_split - split options string into group of options
+ * @options: pointer to C string containing zero or more comma-delimited options
+ *
+ * Convert our mount options string to a list to make it easier
+ * to adjust the options as we go.  This is just an exercise in
+ * lexical parsing -- this function doesn't pay attention to the
+ * meaning of the options themselves.
+ *
+ * Returns a new group of mount options if successful; otherwise NULL
+ * is returned if some failure occurred.
+ */
+struct mount_options *po_split(char *str)
+{
+       struct mount_options *options;
+       struct tokenizer_state *tstate;
+       char *opt;
+
+       if (!str)
+               return options_create();
+
+       options = options_create();
+       if (options) {
+               tstate = init_tokenizer(str, ',');
+               for (opt = next_token(tstate); opt; opt = next_token(tstate)) {
+                       struct mount_option *option = option_create(opt);
+                       free(opt);
+                       if (!option)
+                               goto fail;
+                       options_tail_insert(options, option);
+               }
+               if (tokenizer_error(tstate))
+                       goto fail;
+               end_tokenizer(tstate);
+       }
+       return options;
+
+fail:
+       end_tokenizer(tstate);
+       po_destroy(options);
+       return NULL;
+}
+
+/**
+ * po_replace - replace mount options in one mount_options object with another
+ * @target: pointer to previously instantiated object to replace
+ * @source: pointer to object containing source mount options
+ *
+ * Side effect: the object referred to by source is emptied.
+ */
+void po_replace(struct mount_options *target, struct mount_options *source)
+{
+       if (target) {
+               while (!options_empty(target))
+                       options_delete(target, target->head);
+
+               if (source) {
+                       target->head = source->head;
+                       target->tail = source->tail;
+                       target->count = source->count;
+
+                       options_init(source);
+               }
+       }
+}
+
+/**
+ * po_join - recombine group of mount options into a C string
+ * @options: pointer to mount options to recombine
+ * @str: handle on string to replace (input and output)
+ *
+ * Convert our mount options object back into a string that the
+ * rest of the world can use.
+ *
+ * Returns 1 if the string was successfully created; otherwise
+ * zero.  Upon return, @string contains the address of a
+ * replacement C string containing a comma-delimited list of
+ * mount options and values; or the passed-in string is freed
+ * and NULL is returned if some failure occurred.
+ */
+int po_join(struct mount_options *options, char **str)
+{
+       size_t len = 0;
+       struct mount_option *option;
+
+       if (!str || !options)
+               return PO_FAILED;
+               
+       free(*str);
+       *str = NULL;
+
+       if (options_empty(options)) {
+               *str = strdup("");
+               return *str ? PO_SUCCEEDED : PO_FAILED;
+       }
+
+       for (option = options->head; option; option = option->next) {
+               len += strlen(option->keyword);
+               if (option->value)
+                       len +=strlen(option->value) + 1;  /* equals sign */
+               if (option->next)
+                       len++;  /* comma */
+       }
+
+       len++;  /* NULL on the end */
+
+       *str = malloc(len);
+       if (!*str)
+               return PO_FAILED;
+       *str[0] = '\0';
+
+       for (option = options->head; option; option = option->next) {
+               strcat(*str, option->keyword);
+               if (option->value) {
+                       strcat(*str, "=");
+                       strcat(*str, option->value);
+               }
+               if (option->next)
+                       strcat(*str, ",");
+       }
+
+       return PO_SUCCEEDED;
+}
+
+/**
+ * po_append - concatenate an option onto a group of options
+ * @options: pointer to mount options
+ * @option: pointer to a C string containing the option to add
+ *
+ * Returns 1 if the list was successfully concatenated; otherwise
+ * zero.
+ */
+int po_append(struct mount_options *options, char *str)
+{
+       struct mount_option *option = option_create(str);
+
+       if (option) {
+               options_tail_insert(options, option);
+               return PO_SUCCEEDED;
+       }
+       return PO_FAILED;
+}
+
+/**
+ * po_contains - check for presense of an option in a group
+ * @options: pointer to mount options
+ * @keyword: pointer to a C string containing option keyword for which to search
+ *
+ * Returns 1 if the option is present in the list; otherwise zero.
+ */
+int po_contains(struct mount_options *options, char *keyword)
+{
+       struct mount_option *option;
+
+       if (options && keyword) {
+               for (option = options->head; option; option = option->next)
+                       if (strcmp(option->keyword, keyword) == 0)
+                               return PO_FOUND;
+       }
+
+       return PO_NOT_FOUND;
+}
+
+/**
+ * po_get - return the value of the rightmost instance of an option
+ * @options: pointer to mount options
+ * @keyword: pointer to a C string containing option keyword for which to search
+ *
+ * If multiple instances of the same option are present in a mount option
+ * list, the rightmost instance is always the effective one.
+ *
+ * Returns pointer to C string containing the value of the option.
+ * Returns NULL if the option isn't found, or if the option doesn't
+ * have a value.
+ */
+char *po_get(struct mount_options *options, char *keyword)
+{
+       struct mount_option *option;
+
+       if (options && keyword) {
+               for (option = options->tail; option; option = option->prev)
+                       if (strcmp(option->keyword, keyword) == 0)
+                               return option->value;
+       }
+
+       return NULL;
+}
+
+/**
+ * po_rightmost - determine the relative position of two options
+ * @options: pointer to mount options
+ * @key1: pointer to a C string containing an option keyword
+ * @key2: pointer to a C string containing another option keyword
+ *
+ * The kernel parses the mount option string from left to right.
+ * If an option is specified more than once (for example, "intr"
+ * and "nointr", the rightmost option is the last to be parsed,
+ * and it therefore takes precedence over previous similar options.
+ *
+ * This function can be used to determine which of two similar
+ * options will be the one to take effect.
+ *
+ * Returns 1 if key2 is rightmost or key1 is not present.
+ * Returns -1 if key1 is rightmost or key2 is not present.
+ * Returns 0 if neither key is present.
+ */
+int po_rightmost(struct mount_options *options, char *key1, char *key2)
+{
+       struct mount_option *option;
+
+       if (options) {
+               for (option = options->tail; option; option = option->prev) {
+                       if (key2 && strcmp(option->keyword, key2) == 0)
+                               return 1;
+                       if (key1 && strcmp(option->keyword, key1) == 0)
+                               return -1;
+               }
+       }
+
+       return PO_NOT_FOUND;
+}
+
+/**
+ * po_remove_all - remove instances of an option from a group
+ * @options: pointer to mount options
+ * @keyword: pointer to a C string containing an option keyword to remove
+ *
+ * Returns 1 if the option was found and removed; passed-in list is
+ * truncated upon return; otherwise zero.
+ */
+int po_remove_all(struct mount_options *options, char *keyword)
+{
+       struct mount_option *option, *next;
+       int found = PO_NOT_FOUND;
+
+       if (options && keyword) {
+               for (option = options->head; option; option = next) {
+                       next = option->next;
+                       if (strcmp(option->keyword, keyword) == 0) {
+                               options_delete(options, option);
+                               found = PO_FOUND;
+                       }
+               }
+       }
+
+       return found;
+}
diff --git a/utils/mount/parse_opt.h b/utils/mount/parse_opt.h
new file mode 100644 (file)
index 0000000..93430d9
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * parse_opt.h -- mount option string parsing helpers
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+enum {
+       PO_FAILED = 0,
+       PO_SUCCEEDED = 1,
+};
+
+enum {
+       PO_NOT_FOUND = 0,
+       PO_FOUND = 1,
+};
+
+struct mount_options;
+
+struct mount_options * po_split(char *);
+void                   po_replace(struct mount_options *,
+                                  struct mount_options *);
+int                    po_join(struct mount_options *, char **);
+
+int                    po_append(struct mount_options *, char *);
+int                    po_contains(struct mount_options *, char *);
+char *                 po_get(struct mount_options *, char *);
+int                    po_rightmost(struct mount_options *, char *, char *);
+int                    po_remove_all(struct mount_options *, char *);
+void                   po_destroy(struct mount_options *);
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
new file mode 100644 (file)
index 0000000..b31b3a2
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * stropts.c -- NFS mount using C string to pass options to kernel
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+#include <ctype.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <netdb.h>
+#include <time.h>
+#include <sys/socket.h>
+#include <sys/mount.h>
+
+#include "xcommon.h"
+#include "mount.h"
+#include "nls.h"
+#include "nfs_mount.h"
+#include "mount_constants.h"
+#include "stropts.h"
+#include "error.h"
+#include "network.h"
+#include "parse_opt.h"
+
+#ifdef HAVE_RPCSVC_NFS_PROT_H
+#include <rpcsvc/nfs_prot.h>
+#else
+#include <linux/nfs.h>
+#define nfsstat nfs_stat
+#endif
+
+#ifndef NFS_PORT
+#define NFS_PORT 2049
+#endif
+
+#ifndef NFS_MAXHOSTNAME
+#define NFS_MAXHOSTNAME                (255)
+#endif
+
+#ifndef NFS_MAXPATHNAME
+#define NFS_MAXPATHNAME                (1024)
+#endif
+
+extern int nfs_mount_data_version;
+extern char *progname;
+extern int verbose;
+
+static int parse_devname(const char *spec, char **hostname)
+{
+       int ret = 0;
+       char *dev, *pathname, *s;
+
+       dev = xstrdup(spec);
+
+       if (!(pathname = strchr(dev, ':'))) {
+               nfs_error(_("%s: remote share not in 'host:dir' format"),
+                               progname);
+               goto out;
+       }
+       *pathname = '\0';
+       pathname++;
+
+       /*
+        * We don't need a copy of the pathname, but let's
+        * sanity check it anyway.
+        */
+       if (strlen(pathname) > NFS_MAXPATHNAME) {
+               nfs_error(_("%s: export pathname is too long"),
+                               progname);
+               goto out;
+       }
+
+       /*
+        * Ignore all but first hostname in replicated mounts
+        * until they can be fully supported. (mack@sgi.com)
+        */
+       if ((s = strchr(dev, ','))) {
+               *s = '\0';
+               nfs_error(_("%s: warning: multiple hostnames not supported"),
+                               progname);
+               nfs_error(_("%s: ignoring hostnames that follow the first one"),
+                               progname);
+       }
+       *hostname = xstrdup(dev);
+       if (strlen(*hostname) > NFS_MAXHOSTNAME) {
+               nfs_error(_("%s: server hostname is too long"),
+                               progname);
+               free(*hostname);
+               goto out;
+       }
+
+       ret = 1;
+
+out:
+       free(dev);
+       return ret;
+}
+
+static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
+{
+       struct hostent *hp;
+       addr->sin_family = AF_INET;
+
+       if (inet_aton(hostname, &addr->sin_addr))
+               return 1;
+       if ((hp = gethostbyname(hostname)) == NULL) {
+               nfs_error(_("%s: can't get address for %s\n"),
+                               progname, hostname);
+               return 0;
+       }
+       if (hp->h_length > sizeof(struct in_addr)) {
+               nfs_error(_("%s: got bad hp->h_length"), progname);
+               hp->h_length = sizeof(struct in_addr);
+       }
+       memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
+       return 1;
+}
+
+/*
+ * Append the 'addr=' option to the options string to pass a resolved
+ * server address to the kernel.  After a successful mount, this address
+ * is also added to /etc/mtab for use when unmounting.
+ *
+ * If 'addr=' is already present, we strip it out.  This prevents users
+ * from setting a bogus 'addr=' option themselves, and also allows bg
+ * retries to recompute the server's address, in case it has changed.
+ *
+ * Returns 1 if 'addr=' option appended successfully;
+ * otherwise zero.
+ */
+static int append_addr_option(struct sockaddr_in *saddr,
+                          struct mount_options *options)
+{
+       char new_option[24];
+
+       po_remove_all(options, "addr");
+
+       snprintf(new_option, sizeof(new_option) - 1,
+                       "addr=%s", inet_ntoa(saddr->sin_addr));
+
+       if (po_append(options, new_option) == PO_SUCCEEDED)
+               return 1;
+       return 0;
+}
+
+/*
+ * Called to discover our address and append an appropriate 'clientaddr='
+ * option to the options string.
+ *
+ * Returns 1 if 'clientaddr=' option created successfully or if
+ * 'clientaddr=' option is already present; otherwise zero.
+ */
+static int append_clientaddr_option(struct sockaddr_in *saddr,
+                                   struct mount_options *options)
+{
+       struct sockaddr_in my_addr;
+       char new_option[32];
+
+       if (po_contains(options, "clientaddr") == PO_SUCCEEDED)
+               return 1;
+
+       if (!get_client_address(saddr, &my_addr))
+               return 0;
+
+       snprintf(new_option, sizeof(new_option) - 1,
+                       "clientaddr=%s", inet_ntoa(my_addr.sin_addr));
+
+       if (po_append(options, new_option) == PO_SUCCEEDED)
+               return 1;
+       return 0;
+}
+
+/*
+ * Called to resolve the 'mounthost=' hostname and append a new
+ * option using an IPv4 address.
+ */
+static int fix_up_mounthost_opt(struct mount_options *options)
+{
+       struct sockaddr_in maddr;
+       char *mounthost, new_option[32];
+
+       mounthost = po_get(options, "mounthost");
+       if (!mounthost)
+               return 1;
+
+       if (!fill_ipv4_sockaddr(mounthost, &maddr))
+               return 0;
+
+       snprintf(new_option, sizeof(new_option) - 1,
+                       "mountaddr=%s", inet_ntoa(maddr.sin_addr));
+
+       if (po_append(options, new_option) == PO_SUCCEEDED)
+               return 1;
+       return 0;
+}
+
+/*
+ * nfsmount_s - Mount an NFSv2 or v3 file system using C string options
+ *
+ * @spec:      C string hostname:path specifying remoteshare to mount
+ * @node:      C string pathname of local mounted on directory
+ * @flags:     MS_ style flags
+ * @extra_opts:        pointer to C string containing fs-specific mount options
+ *             (possibly also a return argument)
+ * @fake:      flag indicating whether to carry out the whole operation
+ * @child:     one if this is a backgrounded mount
+ *
+ * XXX: need to handle bg, fg, and retry options.
+ */
+int nfsmount_s(const char *spec, const char *node, int flags,
+               char **extra_opts, int fake, int child)
+{
+       struct mount_options *options = NULL;
+       struct sockaddr_in saddr;
+       char *hostname;
+       int err, retval = EX_FAIL;
+
+       if (!parse_devname(spec, &hostname))
+               goto out;
+       err = fill_ipv4_sockaddr(hostname, &saddr);
+       free(hostname);
+       if (!err)
+               goto out;
+
+       options = po_split(*extra_opts);
+       if (!options) {
+               nfs_error(_("%s: internal option parsing error"), progname);
+               goto out;
+       }
+
+       if (!append_addr_option(&saddr, options))
+               goto out;
+
+       if (!fix_up_mounthost_opt(options))
+               goto out;
+
+       if (po_join(options, extra_opts) == PO_FAILED) {
+               nfs_error(_("%s: internal option parsing error"), progname);
+               goto out;
+       }
+
+       if (verbose)
+               printf(_("%s: text-based options: '%s'\n"),
+                       progname, *extra_opts);
+
+       if (!fake) {
+               if (mount(spec, node, "nfs",
+                               flags & ~(MS_USER|MS_USERS), *extra_opts)) {
+                       mount_error(spec, node, errno);
+                       goto out;
+               }
+       }
+
+       retval = EX_SUCCESS;
+
+out:
+       po_destroy(options);
+       return retval;
+}
+
+/*
+ * nfs4mount_s - Mount an NFSv4 file system using C string options
+ *
+ * @spec:      C string hostname:path specifying remoteshare to mount
+ * @node:      C string pathname of local mounted on directory
+ * @flags:     MS_ style flags
+ * @extra_opts:        pointer to C string containing fs-specific mount options
+ *             (possibly also a return argument)
+ * @fake:      flag indicating whether to carry out the whole operation
+ * @child:     one if this is a backgrounded mount
+ *
+ * XXX: need to handle bg, fg, and retry options.
+ *
+ */
+int nfs4mount_s(const char *spec, const char *node, int flags,
+               char **extra_opts, int fake, int child)
+{
+       struct mount_options *options = NULL;
+       struct sockaddr_in saddr;
+       char *hostname;
+       int err, retval = EX_FAIL;
+
+       if (!parse_devname(spec, &hostname))
+               goto out;
+       err = fill_ipv4_sockaddr(hostname, &saddr);
+       free(hostname);
+       if (!err)
+               goto out;
+
+       options = po_split(*extra_opts);
+       if (!options) {
+               nfs_error(_("%s: internal option parsing error"), progname);
+               goto out;
+       }
+
+       if (!append_addr_option(&saddr, options))
+               goto out;
+
+       if (!append_clientaddr_option(&saddr, options))
+               goto out;
+
+       if (po_join(options, extra_opts) == PO_FAILED) {
+               nfs_error(_("%s: internal option parsing error"), progname);
+               goto out;
+       }
+
+       if (verbose)
+               printf(_("%s: text-based options: '%s'\n"),
+                       progname, *extra_opts);
+
+       if (!fake) {
+               if (mount(spec, node, "nfs4",
+                               flags & ~(MS_USER|MS_USERS), *extra_opts)) {
+                       mount_error(spec, node, errno);
+                       goto out;
+               }
+       }
+
+       retval = EX_SUCCESS;
+
+out:
+       po_destroy(options);
+       return retval;
+}
diff --git a/utils/mount/stropts.h b/utils/mount/stropts.h
new file mode 100644 (file)
index 0000000..a2a0604
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * stropts.h -- Provide common network functions for NFS mount/umount
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+int nfsmount_s(const char *, const char *, int , char **, int, int);
+int nfs4mount_s(const char *, const char *, int, char **, int, int);
diff --git a/utils/mount/token.c b/utils/mount/token.c
new file mode 100644 (file)
index 0000000..5ef9604
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * token.c -- tokenize strings, a la strtok(3)
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+/*
+ * We've constructed a simple string tokenizer that is better than
+ * strtok(3) in several ways:
+ *
+ * 1.  It doesn't interfere with ongoing tokenizations using strtok(3).
+ * 2.  It's re-entrant so we can nest tokenizations, if needed.
+ * 3.  It can handle double-quoted delimiters (needed for 'context="sd,fslj"').
+ * 4.  It doesn't alter the string we're tokenizing, so it can work
+ *     on write-protected strings as well as writable strings.
+ */
+
+
+#include <ctype.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include "token.h"
+
+
+struct tokenizer_state {
+       char *pos;
+       char delimiter;
+       int error;
+};
+
+static void find_next_nondelimiter(struct tokenizer_state *tstate)
+{
+       while (*tstate->pos != '\0' && *tstate->pos == tstate->delimiter)
+               tstate->pos++;
+}
+
+static size_t find_next_delimiter(struct tokenizer_state *tstate)
+{
+       size_t len = 0;
+       int quote_seen = 0;
+
+       while (*tstate->pos != '\0') {
+               if (*tstate->pos == '"')
+                       quote_seen ^= 1;
+
+               if (!quote_seen && *tstate->pos == tstate->delimiter)
+                       break;
+
+               len++;
+               tstate->pos++;
+       }
+
+       /* did the string terminate before the close quote? */
+       if (quote_seen) {
+               tstate->error = EINVAL;
+               return 0;
+       }
+
+       return len;
+}
+
+/**
+ * next_token - find the next token in a string and return it
+ * @tstate: pointer to tokenizer context object
+ *
+ * Returns the next token found in the current string.
+ * Returns NULL if there are no more tokens in the string,
+ * or if an error occurs.
+ *
+ * Side effect: tstate is updated
+ */
+char *next_token(struct tokenizer_state *tstate)
+{
+       char *token;
+       size_t len;
+
+       if (!tstate || !tstate->pos || tstate->error)
+               return NULL;
+
+       find_next_nondelimiter(tstate);
+       if (*tstate->pos == '\0')
+               goto fail;
+       token = tstate->pos;
+
+       len = find_next_delimiter(tstate);
+       if (len) {
+               token = strndup(token, len);
+               if (token)
+                       return token;
+               tstate->error = ENOMEM;
+       }
+
+fail:
+       tstate->pos = NULL;
+       return NULL;                    /* no tokens found in this string */
+}
+
+/**
+ * init_tokenizer - return an initialized tokenizer context object
+ * @string: pointer to C string
+ * @delimiter: single character that delimits tokens in @string
+ *
+ * Returns an initialized tokenizer context object
+ */
+struct tokenizer_state *init_tokenizer(char *string, char delimiter)
+{
+       struct tokenizer_state *tstate;
+
+       tstate = malloc(sizeof(*tstate));
+       if (tstate) {
+               tstate->pos = string;
+               tstate->delimiter = delimiter;
+               tstate->error = 0;
+       }
+       return tstate;
+}
+
+/**
+ * tokenizer_error - digs error value out of tokenizer context
+ * @tstate: pointer to tokenizer context object
+ *
+ */
+int tokenizer_error(struct tokenizer_state *tstate)
+{
+       return tstate ? tstate->error : 0;
+}
+
+/**
+ * end_tokenizer - free a tokenizer context object
+ * @tstate: pointer to tokenizer context object
+ *
+ */
+void end_tokenizer(struct tokenizer_state *tstate)
+{
+       free(tstate);
+}
diff --git a/utils/mount/token.h b/utils/mount/token.h
new file mode 100644 (file)
index 0000000..47762dc
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * token.h -- tokenize strings, a la strtok(3)
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2007 Chuck Lever <chuck.lever@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+struct tokenizer_state;
+
+char *next_token(struct tokenizer_state *);
+struct tokenizer_state *init_tokenizer(char *, char);
+int tokenizer_error(struct tokenizer_state *);
+void end_tokenizer(struct tokenizer_state *);
index 8214c9a457c08fa0637de8c51442c79859b8cda9..ee4cdafd3c036828bd04dd6f90c6bc88cc2eecba 100644 (file)
@@ -1,4 +1,4 @@
-.\"@(#)mount.nfs.8"
+.\"@(#)umount.nfs.8"
 .TH UMOUNT.NFS 8 "6 Jun 2006"
 .SH NAME
 umount.nfs, umount.nfs4 \- unmount a Network File System
@@ -66,9 +66,8 @@ table of mounted file systems
 .BR nfs (5),
 .BR umount (8),
 
-.SH BUGS
-Please notify current developers of NFS of any bugs in the current software or mail nfs@lists.sourceforge.net
+.SH "BUGS"
+Please notify nfs@lists.sourceforge.net of any bugs found in this software.
 
 .SH "AUTHOR"
 Amit Gud <agud@redhat.com>
-
index b5b55e4ba74eb21c74bbcfabaa59bce6abd57e7a..2bacc50d5bb7d7a1c348361cb4eedba145d91ce8 100644 (file)
@@ -129,9 +129,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index f7fe23dda5ba26b8453e56d99bb56476bd41ec75..a821c131bf3e3d494cbd556d594527f5380a95da 100644 (file)
@@ -37,6 +37,7 @@ static nfs_export my_exp;
 static nfs_client my_client;
 
 extern int new_cache;
+extern int use_ipaddr;
 
 void
 auth_init(char *exports)
@@ -47,6 +48,34 @@ auth_init(char *exports)
        xtab_mount_write();
 }
 
+/*
+ * A client can match many different netgroups and it's tough to know
+ * beforehand whether it will. If the concatenated string of netgroup
+ * m_hostnames is >512 bytes, then enable the "use_ipaddr" mode. This
+ * makes mountd change how it matches a client ip address when a mount
+ * request comes in. It's more efficient at handling netgroups at the
+ * expense of larger kernel caches.
+ */
+static void
+check_useipaddr()
+{
+       nfs_client *clp;
+       int old_use_ipaddr = use_ipaddr;
+       unsigned int len = 0;
+
+       /* add length of m_hostname + 1 for the comma */
+       for (clp = clientlist[MCL_NETGROUP]; clp; clp = clp->m_next)
+               len += (strlen(clp->m_hostname) + 1);
+
+       if (len > (NFSCLNT_IDMAX / 2))
+               use_ipaddr = 1;
+       else
+               use_ipaddr = 0;
+
+       if (use_ipaddr != old_use_ipaddr)
+               cache_flush(1);
+}
+
 unsigned int
 auth_reload()
 {
@@ -72,6 +101,7 @@ auth_reload()
        export_freeall();
        memset(&my_client, 0, sizeof(my_client));
        xtab_export_read();
+       check_useipaddr();
        ++counter;
 
        return counter;
@@ -88,23 +118,37 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
                int i;
                /* return static nfs_export with details filled in */
                char *n;
-               my_client.m_addrlist[0] = caller->sin_addr;
-               n = client_compose(caller->sin_addr);
-               *error = unknown_host;
-               if (!n)
+               free(my_client.m_hostname);
+               if (use_ipaddr) {
+                       my_client.m_hostname =
+                               strdup(inet_ntoa(caller->sin_addr));
+               } else {
+                       n = client_compose(hp);
+                       *error = unknown_host;
+                       if (!n)
+                               my_client.m_hostname = NULL;
+                       else if (*n)
+                               my_client.m_hostname = n;
+                       else {
+                               free(n);
+                               my_client.m_hostname = strdup("DEFAULT");
+                       }
+               }
+               if (my_client.m_hostname == NULL)
                        return NULL;
-               strcpy(my_client.m_hostname, *n?n:"DEFAULT");
-               free(n);
                my_client.m_naddr = 1;
+               my_client.m_addrlist[0] = caller->sin_addr;
                my_exp.m_client = &my_client;
 
                exp = NULL;
                for (i = 0; !exp && i < MCL_MAXTYPES; i++) 
                        for (exp = exportlist[i]; exp; exp = exp->m_next) {
-                               if (!client_member(my_client.m_hostname, exp->m_client->m_hostname))
-                                       continue;
                                if (strcmp(path, exp->m_export.e_path))
                                        continue;
+                               if (!use_ipaddr && !client_member(my_client.m_hostname, exp->m_client->m_hostname))
+                                       continue;
+                               if (use_ipaddr && !client_check(exp->m_client, hp))
+                                       continue;
                                break;
                        }
                *error = not_exported;
@@ -155,11 +199,7 @@ auth_authenticate(char *what, struct sockaddr_in *caller, char *path)
        epath[sizeof (epath) - 1] = '\0';
        auth_fixpath(epath); /* strip duplicate '/' etc */
 
-       hp = get_reliable_hostbyaddr((const char*)&caller->sin_addr, sizeof(struct in_addr),
-                                    AF_INET);
-       if (!hp)
-               hp = get_hostent((const char*)&caller->sin_addr, sizeof(struct in_addr),
-                                    AF_INET);
+       hp = client_resolve(caller->sin_addr);
        if (!hp)
                return exp;
 
index 15100d499e91edb442130d0afc1123108ce88e5a..ce1a5a9f41bc9accd5d6433e77926d29b693d66a 100644 (file)
@@ -61,6 +61,7 @@ int cache_export_ent(char *domain, struct exportent *exp, char *p);
 
 char *lbuf  = NULL;
 int lbuflen = 0;
+extern int use_ipaddr;
 
 void auth_unix_ip(FILE *f)
 {
@@ -74,8 +75,9 @@ void auth_unix_ip(FILE *f)
        char *cp;
        char class[20];
        char ipaddr[20];
-       char *client;
+       char *client = NULL;
        struct in_addr addr;
+       struct hostent *he = NULL;
        if (readline(fileno(f), &lbuf, &lbuflen) != 1)
                return;
 
@@ -94,18 +96,22 @@ void auth_unix_ip(FILE *f)
        auth_reload();
 
        /* addr is a valid, interesting address, find the domain name... */
-       client = client_compose(addr);
-
+       if (!use_ipaddr) {
+               he = client_resolve(addr);
+               client = client_compose(he);
+       }
        
        qword_print(f, "nfsd");
        qword_print(f, ipaddr);
        qword_printint(f, time(0)+30*60);
-       if (client)
+       if (use_ipaddr)
+               qword_print(f, ipaddr);
+       else if (client)
                qword_print(f, *client?client:"DEFAULT");
        qword_eol(f);
 
        if (client) free(client);
-       
+       free(he);
 }
 
 void auth_unix_gid(FILE *f)
@@ -264,6 +270,8 @@ void nfsd_fh(FILE *f)
        unsigned int fsidnum=0;
        char fsid[32];
        struct exportent *found = NULL;
+       struct hostent *he = NULL;
+       struct in_addr addr;
        char *found_path = NULL;
        nfs_export *exp;
        int i;
@@ -389,7 +397,7 @@ void nfsd_fh(FILE *f)
                                next_exp = exp->m_next;
                        }
 
-                       if (!client_member(dom, exp->m_client->m_hostname))
+                       if (!use_ipaddr && !client_member(dom, exp->m_client->m_hostname))
                                continue;
                        if (exp->m_export.e_mountpoint &&
                            !is_mountpoint(exp->m_export.e_mountpoint[0]?
@@ -441,10 +449,21 @@ void nfsd_fh(FILE *f)
                                continue;
 #endif
                        }
+                       if (use_ipaddr) {
+                               if (he == NULL) {
+                                       if (!inet_aton(dom, &addr))
+                                               goto out;
+                                       he = client_resolve(addr);
+                               }
+                               if (!client_check(exp->m_client, he))
+                                       continue;
+                       }
                        /* It's a match !! */
                        if (!found) {
                                found = &exp->m_export;
                                found_path = strdup(path);
+                               if (found_path == NULL)
+                                       goto out;
                        } else if (strcmp(found->e_path, exp->m_export.e_path)!= 0)
                        {
                                xlog(L_WARNING, "%s and %s have same filehandle for %s, using first",
@@ -492,6 +511,8 @@ void nfsd_fh(FILE *f)
                qword_print(f, found->e_path);
        qword_eol(f);
  out:
+       free(found_path);
+       free(he);
        free(dom);
        return;         
 }
@@ -579,6 +600,8 @@ void nfsd_export(FILE *f)
        char *dom, *path;
        nfs_export *exp, *found = NULL;
        int found_type = 0;
+       struct in_addr addr;
+       struct hostent *he = NULL;
 
 
        if (readline(fileno(f), &lbuf, &lbuflen) != 1)
@@ -601,7 +624,7 @@ void nfsd_export(FILE *f)
        /* now find flags for this export point in this domain */
        for (i=0 ; i < MCL_MAXTYPES; i++) {
                for (exp = exportlist[i]; exp; exp = exp->m_next) {
-                       if (!client_member(dom, exp->m_client->m_hostname))
+                       if (!use_ipaddr && !client_member(dom, exp->m_client->m_hostname))
                                continue;
                        if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT) {
                                /* if path is a mountpoint below e_path, then OK */
@@ -615,6 +638,15 @@ void nfsd_export(FILE *f)
                                        continue;
                        } else if (strcmp(path, exp->m_export.e_path) != 0)
                                continue;
+                       if (use_ipaddr) {
+                               if (he == NULL) {
+                                       if (!inet_aton(dom, &addr))
+                                               goto out;
+                                       he = client_resolve(addr);
+                               }
+                               if (!client_check(exp->m_client, he))
+                                       continue;
+                       }
                        if (!found) {
                                found = exp;
                                found_type = i;
@@ -656,6 +688,7 @@ void nfsd_export(FILE *f)
  out:
        if (dom) free(dom);
        if (path) free(path);
+       if (he) free(he);
 }
 
 
index 999f035d9a0227426f3bd112fda3df6fda416321..4a5058821ecf620e044a8d8544a36be4375348a2 100644 (file)
@@ -40,6 +40,7 @@ static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, mountstat3 *,
 int reverse_resolve = 0;
 int new_cache = 0;
 int manage_gids;
+int use_ipaddr = -1;
 
 /* PRC: a high-availability callout program can be specified with -H
  * When this is done, the program will receive callouts whenever clients
index 6dcb30115e07497ba1fd817941bc71dcb9a11781..c3f828a5f6f2ab818b1ad38664ff0274f62467d8 100644 (file)
@@ -123,9 +123,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index ba3cc92e3df0e66a5b4e157dcb8d22dbcd27a05a..399b6951577347e003fea07f6259825652b7e5ee 100644 (file)
@@ -123,9 +123,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index 76d8f8bb8cad9351591ddb643814e5166acb5260..828119b724d17a440fbe5ddb013dff2b76314a35 100644 (file)
 
 #define MAXNRVALS      32
 
-static unsigned int    srvproc2info[20], srvproc2info_tmp[20]; /* NFSv2 call counts ([0] == 18) */
-static unsigned int    cltproc2info[20], cltproc2info_tmp[20]; /* NFSv2 call counts ([0] == 18) */
-static unsigned int    srvproc3info[24], srvproc3info_tmp[24]; /* NFSv3 call counts ([0] == 22) */
-static unsigned int    cltproc3info[24], cltproc3info_tmp[24]; /* NFSv3 call counts ([0] == 22) */
-static unsigned int    srvproc4info[4], srvproc4info_tmp[4];   /* NFSv4 call counts ([0] == 2) */
-static unsigned int    cltproc4info[37], cltproc4info_tmp[37]; /* NFSv4 call counts ([0] == 35) */
-static unsigned int    srvproc4opsinfo[42], srvproc4opsinfo_tmp[42];   /* NFSv4 call counts ([0] == 40) */
-static unsigned int    srvnetinfo[5], srvnetinfo_tmp[5];       /* 0  # of received packets
+static unsigned int    srvproc2info[20], srvproc2info_old[20]; /* NFSv2 call counts ([0] == 18) */
+static unsigned int    cltproc2info[20], cltproc2info_old[20]; /* NFSv2 call counts ([0] == 18) */
+static unsigned int    srvproc3info[24], srvproc3info_old[24]; /* NFSv3 call counts ([0] == 22) */
+static unsigned int    cltproc3info[24], cltproc3info_old[24]; /* NFSv3 call counts ([0] == 22) */
+static unsigned int    srvproc4info[4], srvproc4info_old[4];   /* NFSv4 call counts ([0] == 2) */
+static unsigned int    cltproc4info[37], cltproc4info_old[37]; /* NFSv4 call counts ([0] == 35) */
+static unsigned int    srvproc4opsinfo[42], srvproc4opsinfo_old[42];   /* NFSv4 call counts ([0] == 40) */
+static unsigned int    srvnetinfo[5], srvnetinfo_old[5];       /* 0  # of received packets
                                                                 * 1  UDP packets
                                                                 * 2  TCP packets
                                                                 * 3  TCP connections
                                                                 */
-static unsigned int    cltnetinfo[5], cltnetinfo_tmp[5];       /* 0  # of received packets
+static unsigned int    cltnetinfo[5], cltnetinfo_old[5];       /* 0  # of received packets
                                                                 * 1  UDP packets
                                                                 * 2  TCP packets
                                                                 * 3  TCP connections
                                                                 */
 
-static unsigned int    srvrpcinfo[6], srvrpcinfo_tmp[6];       /* 0  total # of RPC calls
+static unsigned int    srvrpcinfo[6], srvrpcinfo_old[6];       /* 0  total # of RPC calls
                                                                 * 1  total # of bad calls
                                                                 * 2  bad format
                                                                 * 3  authentication failed
                                                                 * 4  unknown client
                                                                 */
-static unsigned int    cltrpcinfo[4], cltrpcinfo_tmp[4];       /* 0  total # of RPC calls
+static unsigned int    cltrpcinfo[4], cltrpcinfo_old[4];       /* 0  total # of RPC calls
                                                                 * 1  retransmitted calls
                                                                 * 2  cred refreshs
                                                                 */
 
-static unsigned int    srvrcinfo[9], srvrcinfo_tmp[9];         /* 0  repcache hits
+static unsigned int    srvrcinfo[9], srvrcinfo_old[9];         /* 0  repcache hits
                                                                 * 1  repcache hits
                                                                 * 2  uncached reqs
                                                                 * (for pre-2.4 kernels:)
@@ -65,7 +65,7 @@ static unsigned int   srvrcinfo[9], srvrcinfo_tmp[9];         /* 0  repcache hits
                                                                 * 7  stale
                                                                 */
 
-static unsigned int    srvfhinfo[7], srvfhinfo_tmp[7];         /* (for kernels >= 2.4.0)
+static unsigned int    srvfhinfo[7], srvfhinfo_old[7];         /* (for kernels >= 2.4.0)
                                                                 * 0  stale
                                                                 * 1  FH lookups
                                                                 * 2  'anon' FHs
@@ -113,19 +113,34 @@ static const char *     nfssrvproc4opname[40] = {
         "setcltidconf", "verify",     "write",       "rellockowner"
 };
 
+#define LABEL_srvnet           "Server packet stats:\n"
+#define LABEL_srvrpc           "Server rpc stats:\n"
+#define LABEL_srvrc            "Server reply cache:\n"
+#define LABEL_srvfh            "Server file handle cache:\n"
+#define LABEL_srvproc2         "Server nfs v2:\n"
+#define LABEL_srvproc3         "Server nfs v3:\n"
+#define LABEL_srvproc4         "Server nfs v4:\n"
+#define LABEL_srvproc4ops      "Server nfs v4 operations:\n"
+#define LABEL_cltnet           "Client packet stats:\n"
+#define LABEL_cltrpc           "Client rpc stats:\n"
+#define LABEL_cltproc2         "Client nfs v2:\n"
+#define LABEL_cltproc3         "Client nfs v3:\n"
+#define LABEL_cltproc4         "Client nfs v4:\n"
+
 typedef struct statinfo {
        char            *tag;
+       char            *label;
        int             nrvals;
        unsigned int *  valptr;
 } statinfo;
 
 /*
  * We now build the arrays of statinfos using macros, which will make it easier
- * to add new variables for --diff-stat.
- * e.g., SRV(net) expands into the struct statinfo:  { "net", 5, srvnetinfo }
+ * to add new variables for --sleep.  e.g., SRV(net) expands into the struct
+ * statinfo:  { "net", "Server packet stats:\n", 5, srvnetinfo }
  */
 #define ARRAYSIZE(x)           sizeof(x)/sizeof(*x)
-#define STATINFO(k, t, s...)   { #t, ARRAYSIZE(k##t##info##s), k##t##info##s }
+#define STATINFO(k, t, s...)   { #t, LABEL_##k##t, ARRAYSIZE(k##t##info##s), k##t##info##s }
 #define SRV(t, s...)           STATINFO(srv, t, s)
 #define CLT(t, s...)           STATINFO(clt, t, s)
 #define DECLARE_SRV(n, s...)   static statinfo n##s[] = { \
@@ -137,7 +152,7 @@ typedef struct statinfo {
                                        SRV(proc3,s),\
                                        SRV(proc4,s), \
                                        SRV(proc4ops,s),\
-                                       { NULL, 0, NULL }\
+                                       { NULL, NULL, 0, NULL }\
                                }
 #define DECLARE_CLT(n, s...)   static statinfo n##s[] = { \
                                        CLT(net,s), \
@@ -145,27 +160,28 @@ typedef struct statinfo {
                                        CLT(proc2,s),\
                                        CLT(proc3,s), \
                                        CLT(proc4,s),\
-                                       { NULL, 0, NULL }\
+                                       { NULL, NULL, 0, NULL }\
                                }
 DECLARE_SRV(srvinfo);
-DECLARE_SRV(srvinfo, _tmp);
+DECLARE_SRV(srvinfo, _old);
 DECLARE_CLT(cltinfo);
-DECLARE_CLT(cltinfo, _tmp);
+DECLARE_CLT(cltinfo, _old);
 
 static void            print_numbers(const char *, unsigned int *,
                                        unsigned int);
 static void            print_callstats(const char *, const char **,
                                        unsigned int *, unsigned int);
-static int             parse_statfile(const char *, struct statinfo *);
+static int             parse_raw_statfile(const char *, struct statinfo *);
+static int             parse_pretty_statfile(const char *, struct statinfo *);
 
 static statinfo                *get_stat_info(const char *, struct statinfo *);
 
 static int             mounts(const char *);
 
-static void            get_stats(const char *, statinfo *, int *, int, const char *);
+static void            get_stats(const char *, struct statinfo *, int *, int,
+                                       int);
 static int             has_stats(const unsigned int *);
-static void            copy_stats(statinfo *, statinfo *);
-static void            diff_stats(statinfo *, statinfo *);
+static void            diff_stats(struct statinfo *, struct statinfo *, int);
 static void            unpause(int);
 
 static time_t          starttime;
@@ -207,7 +223,8 @@ void usage(char *name)
   -v, --verbose, --all\tSame as '-o all'\n\
   -r, --rpc\t\tShow RPC statistics\n\
   -n, --nfs\t\tShow NFS statistics\n\
-  -Z, --sleep\tSaves stats, pauses, diffs current and saved\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\
 \n", name);
@@ -229,6 +246,7 @@ static struct option longopts[] =
        { "help", 0, 0, '\1' },
        { "version", 0, 0, '\2' },
        { "sleep", 0, 0, 'Z' },
+       { "since", 1, 0, 'S' },
        { NULL, 0, 0, 0 }
 };
 
@@ -239,9 +257,17 @@ main(int argc, char **argv)
                        opt_srv = 0,
                        opt_clt = 0,
                        opt_prt = 0,
-                       opt_sleep = 0;
+                       opt_sleep = 0,
+                       opt_since = 0;
        int             c;
-       char           *progname;
+       char           *progname,
+                      *serverfile = NFSSRVSTAT,
+                      *clientfile = NFSCLTSTAT;
+
+       struct statinfo *serverinfo = srvinfo,
+                       *serverinfo_tmp = srvinfo_old,
+                       *clientinfo = cltinfo,
+                       *clientinfo_tmp = cltinfo_old;
 
        struct sigaction act = {
                .sa_handler = unpause,
@@ -253,7 +279,7 @@ main(int argc, char **argv)
        else
                progname = argv[0];
 
-       while ((c = getopt_long(argc, argv, "234acmno:Zvrsz\1\2", longopts, NULL)) != EOF) {
+       while ((c = getopt_long(argc, argv, "234acmno:ZS:vrsz\1\2", longopts, NULL)) != EOF) {
                switch (c) {
                case 'a':
                        fprintf(stderr, "nfsstat: nfs acls are not yet supported.\n");
@@ -286,6 +312,11 @@ main(int argc, char **argv)
                case 'Z':
                        opt_sleep = 1;
                        break;
+               case 'S':
+                       opt_since = 1;
+                       serverfile = optarg;
+                       clientfile = optarg;
+                       break;
                case '2':
                case '3':
                case '4':
@@ -341,38 +372,43 @@ main(int argc, char **argv)
                        "server.\n");
        }
 
+       if (opt_since || opt_sleep) {
+               serverinfo = srvinfo_old;
+               serverinfo_tmp = srvinfo;
+               clientinfo = cltinfo_old;
+               clientinfo_tmp = cltinfo;
+       }
+
        if (opt_srv)
-               get_stats(NFSSRVSTAT, srvinfo, &opt_srv, opt_clt, "Server");
+               get_stats(serverfile, serverinfo, &opt_srv, opt_clt, 1);
        if (opt_clt)
-               get_stats(NFSCLTSTAT, cltinfo, &opt_clt, opt_srv, "Client");
+               get_stats(clientfile, clientinfo, &opt_clt, opt_srv, 0);
 
-       /* save stat snapshots; wait for signal; then diff current and saved stats */
        if (opt_sleep) {
                starttime = time(NULL);
                printf("Collecting statistics; press CTRL-C to view results from interval (i.e., from pause to CTRL-C).\n");
-               if (opt_srv)
-                       copy_stats(srvinfo_tmp, srvinfo);
-               if (opt_clt)
-                       copy_stats(cltinfo_tmp, cltinfo);
                if (sigaction(SIGINT, &act, NULL) != 0) {
                        fprintf(stderr, "Error: couldn't register for signal and pause.\n");
                        return 1;
                }
                pause();
+       }
+
+       if (opt_since || opt_sleep) {
                if (opt_srv) {
-                       get_stats(NFSSRVSTAT, srvinfo, &opt_srv, opt_clt, "Server");
-                       diff_stats(srvinfo, srvinfo_tmp);
+                       get_stats(NFSSRVSTAT, serverinfo_tmp, &opt_srv, opt_clt, 1);
+                       diff_stats(serverinfo_tmp, serverinfo, 1);
                }
                if (opt_clt) {
-                       get_stats(NFSCLTSTAT, cltinfo, &opt_clt, opt_srv, "Client");
-                       diff_stats(cltinfo, cltinfo_tmp);
+                       get_stats(NFSCLTSTAT, clientinfo_tmp, &opt_clt, opt_srv, 0);
+                       diff_stats(clientinfo_tmp, clientinfo, 0);
                }
        }
 
        if (opt_srv) {
                if (opt_prt & PRNT_NET) {
                        print_numbers(
-                       "Server packet stats:\n"
+                       LABEL_srvnet
                        "packets    udp        tcp        tcpconn\n",
                        srvnetinfo, 4
                        );
@@ -380,7 +416,7 @@ main(int argc, char **argv)
                }
                if (opt_prt & PRNT_RPC) {
                        print_numbers(
-                       "Server rpc stats:\n"
+                       LABEL_srvrpc
                        "calls      badcalls   badauth    badclnt    xdrcall\n",
                        srvrpcinfo, 5
                        );
@@ -388,7 +424,7 @@ main(int argc, char **argv)
                }
                if (opt_prt & PRNT_RC) {
                        print_numbers(
-                       "Server reply cache:\n"
+                       LABEL_srvrc
                        "hits       misses     nocache\n",
                        srvrcinfo, 3
                        );
@@ -410,12 +446,12 @@ main(int argc, char **argv)
                                srvfhinfo[5]=srvfhinfo[0]; /* relocate 'stale' */
                                
                                print_numbers(
-                                       "Server file handle cache:\n"
+                                       LABEL_srvfh
                                        "lookup     anon       ncachedir  ncachedir  stale\n",
                                        srvfhinfo + 1, 5);
                        } else                                  /* < 2.4 */
                                print_numbers(
-                                       "Server file handle cache:\n"
+                                       LABEL_srvfh
                                        "lookup     anon       ncachedir  ncachedir  stale\n",
                                        srvrcinfo + 3, 5);
                        printf("\n");
@@ -423,21 +459,21 @@ main(int argc, char **argv)
                if (opt_prt & PRNT_CALLS) {
                        if ((opt_prt & PRNT_V2) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc2info)))
                                print_callstats(
-                               "Server nfs v2:\n",
-                                   nfsv2name, srvproc2info + 1, sizeof(nfsv2name)/sizeof(char *)
+                               LABEL_srvproc2,
+                               nfsv2name, srvproc2info + 1, sizeof(nfsv2name)/sizeof(char *)
                                );
                        if ((opt_prt & PRNT_V3) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc3info)))
                                print_callstats(
-                               "Server nfs v3:\n",
+                               LABEL_srvproc3,
                                nfsv3name, srvproc3info + 1, sizeof(nfsv3name)/sizeof(char *)
                                );
                        if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && has_stats(srvproc4info))) {
                                print_callstats(
-                               "Server nfs v4:\n",
+                               LABEL_srvproc4,
                                nfssrvproc4name, srvproc4info + 1, sizeof(nfssrvproc4name)/sizeof(char *)
                                );
                                print_callstats(
-                               "Server nfs v4 operations:\n",
+                               LABEL_srvproc4ops,
                                nfssrvproc4opname, srvproc4opsinfo + 1, sizeof(nfssrvproc4opname)/sizeof(char *)
                                );
                        }
@@ -447,7 +483,7 @@ main(int argc, char **argv)
        if (opt_clt) {
                if (opt_prt & PRNT_NET) {
                        print_numbers(
-                       "Client packet stats:\n"
+                       LABEL_cltnet
                        "packets    udp        tcp        tcpconn\n",
                        cltnetinfo, 4
                        );
@@ -455,7 +491,7 @@ main(int argc, char **argv)
                }
                if (opt_prt & PRNT_RPC) {
                        print_numbers(
-                       "Client rpc stats:\n"
+                       LABEL_cltrpc
                        "calls      retrans    authrefrsh\n",
                        cltrpcinfo, 3
                        );
@@ -464,17 +500,17 @@ main(int argc, char **argv)
                if (opt_prt & PRNT_CALLS) {
                        if ((opt_prt & PRNT_V2) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc2info)))
                                print_callstats(
-                               "Client nfs v2:\n",
+                               LABEL_cltproc2,
                                nfsv2name, cltproc2info + 1,  sizeof(nfsv2name)/sizeof(char *)
                                );
                        if ((opt_prt & PRNT_V3) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc3info)))
                                print_callstats(
-                               "Client nfs v3:\n",
+                               LABEL_cltproc3,
                                nfsv3name, cltproc3info + 1, sizeof(nfsv3name)/sizeof(char *)
                                );
                        if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && has_stats(cltproc4info)))
                                print_callstats(
-                               "Client nfs v4:\n",
+                               LABEL_cltproc4,
                                nfscltproc4name, cltproc4info + 1,  sizeof(nfscltproc4name)/sizeof(char *)
                                );
                }
@@ -533,9 +569,9 @@ print_callstats(const char *hdr, const char **names,
        printf("\n");
 }
 
-
+/* returns 0 on success, 1 otherwise */
 static int
-parse_statfile(const char *name, struct statinfo *statp)
+parse_raw_statfile(const char *name, struct statinfo *statp)
 {
        char    buffer[4096], *next;
        FILE    *fp;
@@ -545,7 +581,7 @@ parse_statfile(const char *name, struct statinfo *statp)
         */
        if ((fp = fopen(name, "r")) == NULL) {
                // fprintf(stderr, "Warning: %s: %m\n", name);
-               return 0;
+               return 1;
        }
 
        while (fgets(buffer, sizeof(buffer), fp) != NULL) {
@@ -575,7 +611,79 @@ parse_statfile(const char *name, struct statinfo *statp)
        }
 
        fclose(fp);
-       return 1;
+       return 0;
+}
+
+/* returns 0 on success, 1 otherwise */
+static int
+parse_pretty_statfile(const char *filename, struct statinfo *info)
+{
+       int numvals, curindex, numconsumed, n, sum, err = 1;
+       char buf[4096], *bufp, *fmt, is_proc;
+       FILE *fp = NULL;
+       struct statinfo *ip;
+
+       if ((fp = fopen(filename, "r")) == NULL)
+               //err(2, "Unable to open statfile '%s'.\n", filename);
+               goto out;
+
+       while (fgets(buf, sizeof(buf), fp) != NULL) {
+               for (ip = info; ip->tag; ip++) {
+                       if (strcmp(buf, ip->label))
+                               continue;
+
+                       sum = 0;
+                       numvals = ip->nrvals - 1;
+                       is_proc = strncmp("proc", ip->tag, 4) ? 0 : 1;
+                       if (is_proc) {
+                               fmt = " %u %*u%% %n";
+                               curindex = 1;
+                               ip->valptr[0] = 0;
+                       } else {
+                               fmt = " %u %n";
+                               curindex = 0;
+                       }
+more_stats:
+                       /* get (and skip) header */
+                       if (fgets(buf, sizeof(buf), fp) == NULL) {
+                               fprintf(stderr, "Failed to locate header after "
+                                               "label for '%s' in %s.\n",
+                                               ip->tag, filename);
+                               goto out;
+                       }
+                       /* no header -- done with this "tag" */
+                       if (*buf == '\n') {
+                               ip->valptr[numvals] = sum;
+                               break;
+                       }
+                       /* get stats */
+                       if (fgets(buf, sizeof(buf), fp) == NULL) {
+                               fprintf(stderr, "Failed to locate stats after "
+                                               "header for '%s' in %s.\n",
+                                               ip->tag, filename);
+                               goto out;
+                       }
+                       bufp = buf;
+                       for (; curindex < numvals; curindex++) {
+                               n = sscanf(bufp, fmt, &ip->valptr[curindex],
+                                               &numconsumed);
+                               if (n != 1)
+                                       break;
+                               if (is_proc) {
+                                       ip->valptr[0]++;
+                                       sum++;
+                               }
+                               sum += ip->valptr[curindex];
+                               bufp += numconsumed;
+                       }
+                       goto more_stats;
+               }
+       }
+       err = 0;
+out:
+       if (fp)
+               fclose(fp);
+       return err;
 }
 
 static int
@@ -627,11 +735,45 @@ mounts(const char *name)
 }
 
 static void
-get_stats(const char *file, statinfo *info, int *opt, int other_opt, const char *label)
+get_stats(const char *file, struct statinfo *info, int *opt, int other_opt,
+               int is_srv)
 {
-       if (!parse_statfile(file, info)) {
+       FILE *fp;
+       char buf[10];
+       int err = 1;
+       char *label = is_srv ? "Server" : "Client";
+
+       /* try to guess what type of stat file we're dealing with */
+       if ((fp = fopen(file, "r")) == NULL)
+               goto out;
+       if (fgets(buf, 10, fp) == NULL)
+               goto out;
+       if (!strncmp(buf, "net ", 4)) {
+               /* looks like raw client stats */
+               if (is_srv) {
+                       fprintf(stderr, "Warning: no server info present in "
+                                       "raw client stats file.\n");
+                       *opt = 0;
+               } else
+                       err = parse_raw_statfile(file, info);
+       } else if (!strncmp(buf, "rc ", 3)) {
+               /* looks like raw server stats */
+               if (!is_srv) {
+                       fprintf(stderr, "Warning: no client info present in "
+                                       "raw server stats file.\n");
+                       *opt = 0;
+               } else
+                       err = parse_raw_statfile(file, info);
+       } else
+               /* looks like pretty client and server stats */
+               err = parse_pretty_statfile(file, info);
+out:
+       if (fp)
+               fclose(fp);
+       if (err) {
                if (!other_opt) {
-                       fprintf(stderr, "Warning: No %s Stats (%s: %m). \n", label, file);
+                       fprintf(stderr, "Error: No %s Stats (%s: %m). \n",
+                                       label, file);
                        exit(2);
                }
                *opt = 0;
@@ -650,28 +792,14 @@ has_stats(const unsigned int *info)
        return (info[0] && info[info[0] + 1] > info[0]);
 }
 
-/* clone 'src' to 'dest' */
-static void
-copy_stats(struct statinfo *dest, struct statinfo *src)
-{
-       int i, j;
-
-       for (i = 0; src[i].tag; i++) {
-               dest[i].tag = src[i].tag;
-               dest[i].nrvals = src[i].nrvals;
-               for (j = 0; j < dest[i].nrvals; j++)
-                       dest[i].valptr[j] = src[i].valptr[j];
-       }
-}
-
 /*
  * take the difference of each individual stat value in 'new' and 'old'
  * and store the results back into 'new'
  */
 static void
-diff_stats(struct statinfo *new, struct statinfo *old)
+diff_stats(struct statinfo *new, struct statinfo *old, int is_srv)
 {
-       int i, j, is_srv, nodiff_first_index, should_diff;
+       int i, j, nodiff_first_index, should_diff;
 
        /*
         * Different stat types have different formats in the /proc
@@ -682,7 +810,6 @@ diff_stats(struct statinfo *new, struct statinfo *old)
         * procX types ("i" < 2 for clt, < 4 for srv), or if it's not
         * the first entry ("j" > 0).
         */
-       is_srv = (new == srvinfo);
        nodiff_first_index = 2 + (2 * is_srv);
 
        for (i = 0; old[i].tag; i++) {
@@ -700,7 +827,7 @@ diff_stats(struct statinfo *new, struct statinfo *old)
                 * diff -- i.e., it should always be included in the
                 * total.
                 */
-               if (!strncmp("proc", new[i].tag, 4))
+               if (!strncmp("proc", new[i].tag, 4) && old[i].valptr[0])
                        new[i].valptr[new[i].nrvals - 1] += new[i].valptr[0];
        }
 }
index 1f3ee90622bb9d771346494a07e41f26c66fdd18..490e995e195335798b5968f896c5cd3a1a855bc5 100644 (file)
@@ -123,9 +123,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@
index c85b40a43f80607c2e5503db5242e093c3f451ef..d6824684c1e520d1e5f0d19b5f0ab4c4a95b6e0f 100644 (file)
@@ -137,9 +137,9 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GREP = @GREP@
-GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
-GSSAPI_LIBS = @GSSAPI_LIBS@
 GSSD = @GSSD@
+GSSGLUE_CFLAGS = @GSSGLUE_CFLAGS@
+GSSGLUE_LIBS = @GSSGLUE_LIBS@
 HAVE_LIBWRAP = @HAVE_LIBWRAP@
 HAVE_TCP_WRAPPER = @HAVE_TCP_WRAPPER@
 IDMAPD = @IDMAPD@