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@
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
LIBSOCKET
LIBCRYPT
LIBBSD
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
# Initialize some variables set by options.
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.
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
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
_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
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
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
_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; }; }
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/>.
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; }
:
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
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
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
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
LIBSOCKET
LIBCRYPT
LIBBSD
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
# Initialize some variables set by options.
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.
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
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
_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
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
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
_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; }; }
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/>.
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; }
:
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
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
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
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
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.
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...
# 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
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*:*)
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
- x86)
+ x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
# 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
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16c)
- basic_machine=cr16c-unknown
+ cr16)
+ basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=i386-pc
os=-mingw32
;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
miniframe)
basic_machine=m68000-convergent
;;
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS
LIBSOCKET
LIBCRYPT
LIBBSD
PKG_CONFIG
RPCSECGSS_CFLAGS
RPCSECGSS_LIBS
-GSSAPI_CFLAGS
-GSSAPI_LIBS'
+GSSGLUE_CFLAGS
+GSSGLUE_LIBS'
# Initialize some variables set by options.
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.
;;
*-*-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=$?
-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.
-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.
-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
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
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
-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.
-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
-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.
-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
-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.
-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.
-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
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
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
_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
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
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
_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; }; }
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/>.
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; }
:
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
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
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
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
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
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)
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@
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@
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@
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);
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;
head = clientlist + i;
while (*head) {
*head = (clp = *head)->m_next;
+ xfree(clp->m_hostname);
xfree(clp);
}
}
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,
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) {
name = add_name(name, clp->m_hostname);
}
}
- free(he);
return name;
}
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;
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;
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;
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;
}
/* 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);
}
}
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);
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@
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];
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);
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@
* 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
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@
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@
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@
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 */
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@
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@
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;
dst->e_mountpoint = strdup(src->e_mountpoint);
if (src->e_fslocdata)
dst->e_fslocdata = strdup(src->e_fslocdata);
+ dst->e_hostname = NULL;
}
struct exportent *
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;
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@
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@
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@
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@
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@
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@
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@
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@
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);
}
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@
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
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
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@
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
@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 $@ $<; \
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;
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:
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));
}
/*
- * 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)
{
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 *);
#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)
{ "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 }
};
if (flags & MS_REMOUNT) {
update_mtab(ment.mnt_dir, &ment);
- return 0;
+ free(ment.mnt_opts);
+ return EX_SUCCESS;
}
lock_mtab();
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"));
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"));
}
{
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;
printf("%s ("PACKAGE_STRING")\n", progname);
else
mount_usage();
- exit(0);
+ exit(EX_SUCCESS);
}
if ((argc < 3)) {
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':
break;
case 'V':
printf("%s: ("PACKAGE_STRING")\n", progname);
- return 0;
+ exit(EX_SUCCESS);
case 'w':
flags &= ~MS_RDONLY;
break;
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;
}
}
*/
if (optind != argc - 2) {
mount_usage();
- exit(EX_USAGE);
+ goto out_usage;
}
if (strcmp(progname, "mount.nfs4") == 0)
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;
}
/*
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"),
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,
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);
}
.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
.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
.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>
-
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;
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)
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;
}
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))
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;
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)
{
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"
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;
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);
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,
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;
+}
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,
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).
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;
}
}
}
- return 0;
+ return EX_SUCCESS;
fail:
return retval;
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) {
}
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) {
}
}
- return 0;
+ return EX_SUCCESS;
/* abort */
fail:
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;
}
/*
return EX_USAGE;
}
- return 0;
+ return EX_SUCCESS;
}
static struct option umount_longopts[] =
/* 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"),
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);
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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 *);
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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);
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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 *);
-.\"@(#)mount.nfs.8"
+.\"@(#)umount.nfs.8"
.TH UMOUNT.NFS 8 "6 Jun 2006"
.SH NAME
umount.nfs, umount.nfs4 \- unmount a Network File System
.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>
-
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@
static nfs_client my_client;
extern int new_cache;
+extern int use_ipaddr;
void
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()
{
export_freeall();
memset(&my_client, 0, sizeof(my_client));
xtab_export_read();
+ check_useipaddr();
++counter;
return counter;
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;
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;
char *lbuf = NULL;
int lbuflen = 0;
+extern int use_ipaddr;
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;
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)
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;
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]?
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",
qword_print(f, found->e_path);
qword_eol(f);
out:
+ free(found_path);
+ free(he);
free(dom);
return;
}
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)
/* 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 */
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;
out:
if (dom) free(dom);
if (path) free(path);
+ if (he) free(he);
}
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
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@
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@
#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:)
* 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
"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[] = { \
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), \
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;
-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);
{ "help", 0, 0, '\1' },
{ "version", 0, 0, '\2' },
{ "sleep", 0, 0, 'Z' },
+ { "since", 1, 0, 'S' },
{ NULL, 0, 0, 0 }
};
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,
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");
case 'Z':
opt_sleep = 1;
break;
+ case 'S':
+ opt_since = 1;
+ serverfile = optarg;
+ clientfile = optarg;
+ break;
case '2':
case '3':
case '4':
"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
);
}
if (opt_prt & PRNT_RPC) {
print_numbers(
- "Server rpc stats:\n"
+ LABEL_srvrpc
"calls badcalls badauth badclnt xdrcall\n",
srvrpcinfo, 5
);
}
if (opt_prt & PRNT_RC) {
print_numbers(
- "Server reply cache:\n"
+ LABEL_srvrc
"hits misses nocache\n",
srvrcinfo, 3
);
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");
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 *)
);
}
if (opt_clt) {
if (opt_prt & PRNT_NET) {
print_numbers(
- "Client packet stats:\n"
+ LABEL_cltnet
"packets udp tcp tcpconn\n",
cltnetinfo, 4
);
}
if (opt_prt & PRNT_RPC) {
print_numbers(
- "Client rpc stats:\n"
+ LABEL_cltrpc
"calls retrans authrefrsh\n",
cltrpcinfo, 3
);
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 *)
);
}
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;
*/
if ((fp = fopen(name, "r")) == NULL) {
// fprintf(stderr, "Warning: %s: %m\n", name);
- return 0;
+ return 1;
}
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
}
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
}
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;
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
* 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++) {
* 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];
}
}
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@
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@