From: Ben Hutchings Date: Wed, 14 Jul 2010 01:35:24 +0000 (+0100) Subject: Merge branch 'upstream' X-Git-Tag: debian/1%1.0.9-1~1 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=de95c40031904260a31a3686d6a48d7842abccb4;hp=4633b10cb7f326dd9cc69d656395bc911e1abd87 Merge branch 'upstream' Conflicts: Makefile.in configure linux-nfs/Makefile.in support/Makefile.in support/export/Makefile.in support/include/Makefile.in support/include/config.h.in support/include/nfs/Makefile.in support/include/rpcsvc/Makefile.in support/include/sys/Makefile.in support/include/sys/fs/Makefile.in support/misc/Makefile.in support/nfs/Makefile.in support/nfs/clients.c tools/Makefile.in tools/getiversion/Makefile.in tools/getkversion/Makefile.in tools/locktest/Makefile.in tools/nlmtest/Makefile.in tools/rpcdebug/Makefile.in tools/rpcgen/Makefile.in utils/Makefile.in utils/exportfs/Makefile.in utils/gssd/Makefile.am utils/gssd/Makefile.in utils/gssd/svcgssd_proc.c utils/idmapd/Makefile.in utils/lockd/Makefile.in utils/mount/Makefile.in utils/mountd/Makefile.in utils/nfsd/Makefile.in utils/nfsstat/Makefile.in utils/nhfsstone/Makefile.in utils/rquotad/Makefile.in utils/showmount/Makefile.in utils/statd/Makefile.in --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc39895 --- /dev/null +++ b/.gitignore @@ -0,0 +1,59 @@ +# files generated by autoconf, automake, autoheader and libtoolize +aclocal.m4 +autom4te.cache +compile +config.guess +config.log +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +Makefile.in +missing +support/include/config.h.in +# files generated by configure +confdefs.h +config.status +conftest +conftest.c +conftest.cpp +conftest.er1 +conftest.err +.deps +Makefile +support/include/config.h +support/include/stamp-h1 +# file generated during compilation +*.o +.libs +lib*.a +tools/rpcgen/rpcgen +tools/rpcdebug/rpcdebug +utils/exportfs/exportfs +utils/idmapd/idmapd +utils/lockd/lockd +utils/mount/mount.nfs +utils/mountd/mountd +utils/nfsd/nfsd +utils/nfsstat/nfsstat +utils/nhfsstone/nhfsstone +utils/rquotad/rquotad +utils/rquotad/rquota.h +utils/rquotad/rquota_xdr.c +utils/showmount/showmount +utils/statd/statd +tools/locktest/testlk +tools/getiversion/getiversion +tools/getkversion/getkversion +support/export/mount.h +support/export/mount_clnt.c +support/export/mount_xdr.c +support/include/mount.h +utils/statd/sm_inter.h +utils/statd/sm_inter_clnt.c +utils/statd/sm_inter_svc.c +utils/statd/sm_inter_xdr.c +# generic editor backup et al +*~ diff --git a/ChangeLog b/ChangeLog index aec3014..2ea2184 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,370 @@ +commit 7194d7d6320736c14f40d31c3738d40f3119ead5 +Author: Kevin Coffman +Date: Sat Jul 8 10:01:40 2006 +1000 + + Use uid/gid of -1 to indicate the export's anonuid/anongid should be used + + Kernel routine nfsd_setuser() in fs/nfsd/auth.c checks for the + value -1 and defaults the credential's fsuid/fsgid to the + correct anonuid/anongid values for the given export. We should + be passing this value (-1) down when a name mapping cannot be found. + Thanks to J. Bruce Fields for the reference. + + Signed-off-by: Kevin Coffman + Acked-by: J. Bruce Fields + +commit b0604c623f7a98c6061dff19988722d3ae848bd7 +Author: Kevin Coffman +Date: Sat Jul 8 09:58:03 2006 +1000 + + Change svcgssd_LDFLAGS to match gssd_LDFLAGS + +commit 99414bd3eecf93f23c378d3bb3d45bc98f364abc +Author: Neil Brown +Date: Sat Jul 8 09:41:58 2006 +1000 + + Disable building/installing mount.nfs by default. + + mount.nfs does not yet support 'user' option and some others. + To make it support this we need to make it setuid-root, and + some security isses need to be resolved before that can be done + safely. + +commit b0c3cbfee702c019dab0a22557bbf38e24dfcee1 +Author: Steve Dickson +Date: Sat Jul 8 09:35:02 2006 +1000 + + Call nfssvc_versbits before nfssvc_setfds + + nfssvc_versbits() has to be called before nfssvc_setfds() + for the version processing to work correctly + +commit 26fff911b21943f20e3937ae3f2d29a1572d2309 +Author: Neil Brown +Date: Thu Jul 6 13:05:11 2006 +1000 + + Only use -rpath for Kerberos libs when actually needed. + + Avoid usage of -rpath is generally safer, and is required by Debian policy. + +commit 28a7603b719f8d35bf22fd3018b610b489fec78f +Author: Neil Brown +Date: Thu Jul 6 12:28:33 2006 +1000 + + Use 65534 instead of -2 in svcgssd_proc.c + + as this is more consistant across achitectures. + +commit 904de920ea4da3ad5604c417f0d784fcda83ed2a +Author: Shankar Anand +Date: Tue Jul 4 08:50:56 2006 -0600 + + This patch adds code to nfsstat to read /proc/net/rpc/nfsd for nfsv4 server statistics and print them. + + Submitted by: Shankar Anand + +commit 2179c112b9a386ca3d51d0e19390ddfadd745030 +Author: Steinar H. Gunderson +Date: Wed Jul 5 15:55:45 2006 +1000 + + Fix typos in various man pages. + +commit 3419e37500dfd19cb2c246260dbd2bc0ee4704d4 +Author: Steinar H. Gunderson +Date: Wed Jul 5 15:51:30 2006 +1000 + + Use 65534 for anon uid/gid rather than -2 + + This is more consistant across platforms. + +commit 65735eef8a9441901245f6047edafc50f2d97c97 +Author: Greg Banks +Date: Wed Jul 5 13:37:21 2006 +1000 + + Update rpcdebug to know about new 2.6 debug flags. Added + a manpage and installed rpcdebug (in sbindir). + +commit 23b3a9d0284d78cb6bf96b8cd44e9a4662ff60ae +Author: Greg Banks +Date: Wed Jul 5 12:22:45 2006 +1000 + + Ignore new generated files. + +commit 89053f3f440b629911cb994a293d5be73bb79bf9 +Author: Greg Banks +Date: Wed Jul 5 12:20:20 2006 +1000 + + Add rquota.h to BUILT_SOURCES so rquotad builds on the first try. + +commit 66f9d8251c92124e46a209c47e5c0f7d3a0c4e6e +Author: Neil Brown +Date: Wed Jul 5 11:06:09 2006 +1000 + + Generate rquota_xdr.c and rquota.h from rquota.x + + rquota_svc.c is still by-hand as it contains alot of extras. + These should really be moved to rquota_server.c + +commit 9f5b40b7a68fe0a2648565ecbd4b08bf60287130 +Author: Neil Brown +Date: Wed Jul 5 10:41:03 2006 +1000 + + Remove some files that old, unused, unneeded. + + deleted: support/export/keys.c + deleted: support/include/rpcdispatch.h + deleted: support/include/rpcsec.h + deleted: support/include/version.h + deleted: support/include/ypupdate.h + deleted: support/nfs/clients.c + deleted: support/nfs/keytab.c + deleted: support/nfs/ypupdate_xdr.c + deleted: support/rpc/include/Makefile.am + deleted: tools/rpcdebug/neat_idea.c + deleted: utils/mountd/mount_xdr.c + deleted: utils/rquotad/pathnames.h + +commit fbb1602bbd34cbe89dd55ca6eaaa19432237db1d +Author: Neil Brown +Date: Wed Jul 5 10:30:51 2006 +1000 + + Avoid error creating an existing symlink + + Just remove the link first. + +commit 0bc710a5a2b695039613a917e009dba3552ab1cc +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:33:54 2006 -0400 + + Don't depend on Kerberos headers when checking librpcsecgss in configure + + Signed-off-by: Kevin Coffman + + Older versions of MIT Kerberos are missing an OID definition, causing + the configure checks for librpcsecgss to fail. We shouldn't be depending + on their libraries during the configure. + +commit 5bfa10c94c44f082dc211a5fb431e2202ea9bb35 +Author: Greg Banks +Date: Tue Jul 4 18:33:56 2006 +1000 + + Eliminate warnings from code generated by rpcgen + + - unused variable 'buf' + - emit a declaration for `buf' on demand. + - unused variable 'i' + - declare i immediately before use + - unused value from IXDR_PUT_ + - cast to (void) + - type-punned pointer reference + - cast to (void*) first :-( + +commit acae444246635ec2ca8990d53e685c9062d73091 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:43 2006 -0400 + + Handle mapping failure from get_ids. + + Signed-off-by: Kevin Coffman + + Temporary patch to do default mapping if we get an error while trying to + map a gss principal to the appropriate uid/gid. This currently returns + hardcoded values. This may be correct, or we may need to try and figure + out the correct values to match the anonuid/anongid for the export. + +commit 1f1b05a65ef3dc6597c7bc1e2a38f38ae95bf230 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:38 2006 -0400 + + Properly report errors in readline() function + + Signed-off-by: Kevin Coffman + + Change message priorities for errors and debug messages. + +commit ee664fd246d77010af13fb557407c612752a5ea8 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:33 2006 -0400 + + Change default buffer size increment for readline() + + Signed-off-by: Kevin Coffman + + The readline routine expects much smaller messages than we are passing. + Change the default initial allocation and increment value from 128 + to 2048. This saves many calls to realloc(). + +commit 3da69ce5c4fac5677e91aa20e60750ab8de2ab97 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:27 2006 -0400 + + Clean up the printerr() logging function. + + Signed-off-by: Kevin Coffman + + Update the printerr() function to: + + 1) Determine whether we'll print the message before going to all the + work of formatting it. + 2) Don't just toss away messages that are too long for the buffer. + Print what we can and give an indication of the truncation with + "..." at the end. + 3) Use a single buffer rather than two. + 4) Messages either go to syslog (with level ERR) or stderr. Don't + send some messages to syslog level DEBUG. + +commit 0b2a5b574c7ffd99aa3226d36e1d261826405625 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:21 2006 -0400 + + Use setfsuid() rather than seteuid() while creating contexts + + Signed-off-by: Kevin Coffman + + As suggested by Olaf Kirch , use setfsuid() rather than + seteuid() when creating a gss context. This prevents users from using + credentials that do not belong to them, while also preventing them from + doing things like killing, renicing, or changing the priority of the + gssd process while it is processing the context creation. + +commit 0f899e6d862994ffb437ae73e087c4a21ab59723 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:16 2006 -0400 + + Limit acquire_cred call to to Kerberos only + + Signed-off-by: Kevin Coffman + + Specify that the acquire_cred call should only be concerned with returning + Kerberos credentials since this is Kerberos-only functionality. + +commit 3829bb90e764cd72c0009cb32a8b39d0fab89d81 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:10 2006 -0400 + + Check that the gssapi library is usable early on. + + Signed-off-by: Kevin Coffman + + Do a call to determine mechanisms supported by the gssapi library early. + This allows us to discover early in case the gssapi library is somehow + misconfigured. We can bail out early and give a meaningful message + rather than getting errors on each attempt at a context negotiation. + +commit 119c3e9aafe84c0f7c2846c46ad5e6f5eeece0da +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:34:05 2006 -0400 + + Fix problems with 64-bit big-endian machines + + Signed-off-by: Kevin Coffman + + Correct the definition of mech_used in the gss context to use gss_OID_desc. + This fixes problems on 64-bit machines when referencing the OID. + + Also updates write_buffer function to use u_int rather than size_t when + doing calculations. + +commit c3f05548d7b3d586e7eebbdde9339617e88530f3 +Author: kwc@citi.umich.edu +Date: Mon Jul 3 18:33:59 2006 -0400 + + Define CFLAGS for gss_clnt_send_err compile + + Signed-off-by: Kevin Coffman + + Add CFLAGS to make sure we find and use the correct gssapi.h when + building gss_clnt_send_err + +commit 4e9ed06f8f8a0cd9f34a6830c0ff14344a528042 +Author: Greg Banks +Date: Mon Jul 3 15:59:54 2006 +1000 + + Use socklen_t some more to avoid warnings. + +commit 6c40236820fda8960af891f41aa9d53f8bbe50a2 +Author: Greg Banks +Date: Mon Jul 3 15:39:41 2006 +1000 + + Fix warning about pointer signedness differing. + +commit 3bf702b1a914b3867117b74d519c55fa68f4dc28 +Author: Greg Banks +Date: Mon Jul 3 15:17:34 2006 +1000 + + Include the right header to get xmalloc() declaration. + +commit 940c7c304d4a43c00c27529cdddc7c87db6eef87 +Merge: b90d201... a503848... +Author: Greg Banks +Date: Mon Jul 3 14:21:48 2006 +1000 + + Merge branch 'master' of git://linux-nfs.org/nfs-utils + +commit b90d201551aaa712c011c3d5de900fad714a26a6 +Author: Greg Banks +Date: Tue Jun 27 21:30:18 2006 +1000 + + Comment out unused variable. + +commit 33beb42d3d2cd13a82ddbbdc4275d2a048030ae3 +Author: Greg Banks +Date: Tue Jun 27 21:22:59 2006 +1000 + + Comment out the decades-old SCCS id strings from the original Sun + distribution. They cause compile warnings, there is no longer any + reason to try to build them into the binaries, and gcc seems to be + eliding some of them anyway. + +commit 3172063ead6b99611d049a59938808a6358f48a4 +Author: Greg Banks +Date: Tue Jun 27 20:55:07 2006 +1000 + + Detect if glibc provides socklen_t and use that instead + of int in those cases which generate compile warnings, + e.g. the last argument of recvfrom(). + +commit a09eeb36c2c45151b9bb89f5015da0c584799716 +Author: Greg Banks +Date: Tue Jun 27 20:28:02 2006 +1000 + + Replace the deprecated sigblock() with more modern + signal functions to avoid compile warnings. + +commit 93608a52655abf5ac23404c4b5cc05fe575a9c04 +Author: Greg Banks +Date: Thu Jun 22 18:01:10 2006 +1000 + + Fix a number of the easier compile warnings: unused variables, + unused labels, constness, signedness. + +commit a07343ee0da4f0974a23b673ae1b0d482c7426a1 +Author: Greg Banks +Date: Thu Jun 22 17:31:24 2006 +1000 + + Detect presence of nfs4_set_debug() in libnfsidmap and + don't bother calling it if it's missing. + +commit dcfcb677b39443b6392db3234fd50498bc158507 +Author: Greg Banks +Date: Thu Jun 22 17:19:17 2006 +1000 + + Remove useless m4 quoting around args to PKG_CHECK_MODULES(). + +commit 24d303ffae686192bda0a5996e8590219dcc82e7 +Author: Greg Banks +Date: Thu Jun 22 17:16:19 2006 +1000 + + Do m4 quoting of AC_MSG_ERROR() and AC_MSG_WARN() as + the autoconf people intended. This avoids errors in + autoconf on SLES10. + +commit 66a699d953727d3a992cc09ed5304b83d661a737 +Author: Greg Banks +Date: Thu Jun 22 16:51:44 2006 +1000 + + Add a .gitignore file to suppress the files generated + during autogen, configure and build. commit 49b164d978ee6266df7ba0bd335cb34337e7c381 Author: Steve Dickson Date: Mon Jul 3 09:52:00 2006 +1000 diff --git a/Makefile.in b/Makefile.in index 58d87e4..fb9b941 100644 --- a/Makefile.in +++ b/Makefile.in @@ -134,6 +134,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4 index 45e220f..1dac9f0 100644 --- a/aclocal/kerberos5.m4 +++ b/aclocal/kerberos5.m4 @@ -72,6 +72,17 @@ AC_DEFUN([AC_KERBEROS_V5],[ fi AC_MSG_RESULT($KRBDIR) + dnl Check if -rpath=$(KRBDIR)/lib is needed + echo "The current KRBDIR is $KRBDIR" + if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \ + -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then + KRBLDFLAGS=""; + elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then + KRBLDFLAGS=""; + else + KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib" + fi + dnl Now check for functions within gssapi library AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS) @@ -88,6 +99,7 @@ AC_DEFUN([AC_KERBEROS_V5],[ AC_SUBST([KRBDIR]) AC_SUBST([KRBLIBS]) AC_SUBST([KRBCFLAGS]) + AC_SUBST([KRBLDFLAGS]) AC_SUBST([K5VERS]) ]) diff --git a/configure b/configure index a6905ea..2df5bc8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59e for linux nfs-utils 1.0.9-pre1. +# Generated by GNU Autoconf 2.59e for linux nfs-utils 1.0.9. # # Report bugs to . # @@ -713,8 +713,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='linux nfs-utils' PACKAGE_TARNAME='nfs-utils' -PACKAGE_VERSION='1.0.9-pre1' -PACKAGE_STRING='linux nfs-utils 1.0.9-pre1' +PACKAGE_VERSION='1.0.9' +PACKAGE_STRING='linux nfs-utils 1.0.9' PACKAGE_BUGREPORT='nfs@lists.sf.net' ac_unique_file="tools/getiversion/getiversion.c" @@ -892,6 +892,7 @@ LIBBSD KRBDIR KRBLIBS KRBCFLAGS +KRBLDFLAGS K5VERS ALLOCA LIBOBJS @@ -1425,7 +1426,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures linux nfs-utils 1.0.9-pre1 to adapt to many kinds of systems. +\`configure' configures linux nfs-utils 1.0.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1495,7 +1496,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of linux nfs-utils 1.0.9-pre1:";; + short | recursive ) echo "Configuration of linux nfs-utils 1.0.9:";; esac cat <<\_ACEOF @@ -1509,7 +1510,7 @@ Optional Features: --enable-secure-statd Only lockd can use statd (security) --enable-rquotad enable rquotad [default=yes] --enable-mount Create mount.nfs and don't use the util-linux - mount(8) functionality. [default=yes] + mount(8) functionality. [default=no] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1619,7 +1620,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -linux nfs-utils configure 1.0.9-pre1 +linux nfs-utils configure 1.0.9 generated by GNU Autoconf 2.59e Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1633,7 +1634,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by linux nfs-utils $as_me 1.0.9-pre1, which was +It was created by linux nfs-utils $as_me 1.0.9, which was generated by GNU Autoconf 2.59e. Invocation command line was $ $0 $@ @@ -2396,7 +2397,7 @@ fi # Define the identity of the package. PACKAGE='nfs-utils' - VERSION='1.0.9-pre1' + VERSION='1.0.9' cat >>confdefs.h <<_ACEOF @@ -2710,7 +2711,7 @@ fi if test "${enable_mount+set}" = set; then enableval=$enable_mount; enable_mount=$enableval else - enable_mount=yes + enable_mount=no fi @@ -6518,7 +6519,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6521 "configure"' > conftest.$ac_ext + echo '#line 6522 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8683,11 +8684,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8686: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8687: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8690: \$? = $ac_status" >&5 + echo "$as_me:8691: \$? = $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. @@ -8951,11 +8952,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8954: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8955: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8958: \$? = $ac_status" >&5 + echo "$as_me:8959: \$? = $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. @@ -9055,11 +9056,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9058: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9059: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9062: \$? = $ac_status" >&5 + echo "$as_me:9063: \$? = $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 @@ -11496,7 +11497,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13968: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13971: \$? = $ac_status" >&5 + echo "$as_me:13972: \$? = $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. @@ -14068,11 +14069,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14071: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14072: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14075: \$? = $ac_status" >&5 + echo "$as_me:14076: \$? = $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 @@ -15629,11 +15630,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15632: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15633: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15636: \$? = $ac_status" >&5 + echo "$as_me:15637: \$? = $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. @@ -15733,11 +15734,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15736: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15737: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15740: \$? = $ac_status" >&5 + echo "$as_me:15741: \$? = $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 @@ -17952,11 +17953,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17955: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17956: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17959: \$? = $ac_status" >&5 + echo "$as_me:17960: \$? = $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. @@ -18220,11 +18221,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18223: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18224: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18227: \$? = $ac_status" >&5 + echo "$as_me:18228: \$? = $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. @@ -18324,11 +18325,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18327: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18328: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18331: \$? = $ac_status" >&5 + echo "$as_me:18332: \$? = $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 @@ -22473,22 +22474,26 @@ fi # Put the nasty error message in config.log where it belongs echo "$RPCSECGSS_PKG_ERRORS" >&5 - { { echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss. - If you have pkgconfig installed, you might try setting environment - variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5 -echo "$as_me: error: Unable to locate information required to use librpcsecgss. - If you have pkgconfig installed, you might try setting environment - variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;} + { { echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss." >&5 +echo "$as_me: error: Unable to locate information required to use librpcsecgss." >&2;} + { (exit 1); exit 1; }; } + { { echo "$as_me:$LINENO: error: If you have pkgconfig installed, you might try setting environment" >&5 +echo "$as_me: error: If you have pkgconfig installed, you might try setting environment" >&2;} + { (exit 1); exit 1; }; } + { { echo "$as_me:$LINENO: error: variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5 +echo "$as_me: error: variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss. - If you have pkgconfig installed, you might try setting environment - variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5 -echo "$as_me: error: Unable to locate information required to use librpcsecgss. - If you have pkgconfig installed, you might try setting environment - variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;} + { { echo "$as_me:$LINENO: error: Unable to locate information required to use librpcsecgss." >&5 +echo "$as_me: error: Unable to locate information required to use librpcsecgss." >&2;} + { (exit 1); exit 1; }; } + { { echo "$as_me:$LINENO: error: If you have pkgconfig installed, you might try setting environment" >&5 +echo "$as_me: error: If you have pkgconfig installed, you might try setting environment" >&2;} + { (exit 1); exit 1; }; } + { { echo "$as_me:$LINENO: error: variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&5 +echo "$as_me: error: variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig" >&2;} { (exit 1); exit 1; }; } @@ -23047,6 +23052,91 @@ fi done + { echo "$as_me:$LINENO: checking for nfs4_set_debug in -lnfsidmap" >&5 +echo $ECHO_N "checking for nfs4_set_debug in -lnfsidmap... $ECHO_C" >&6; } +if test "${ac_cv_lib_nfsidmap_nfs4_set_debug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnfsidmap $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nfs4_set_debug (); +int +main () +{ +return nfs4_set_debug (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nfsidmap_nfs4_set_debug=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nfsidmap_nfs4_set_debug=no +fi + +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nfsidmap_nfs4_set_debug" >&5 +echo "${ECHO_T}$ac_cv_lib_nfsidmap_nfs4_set_debug" >&6; } +if test $ac_cv_lib_nfsidmap_nfs4_set_debug = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NFS4_SET_DEBUG 1 +_ACEOF + +fi + { echo "$as_me:$LINENO: checking for Kerberos v5" >&5 @@ -23131,6 +23221,16 @@ echo "$as_me: error: Kerberos v5 with GSS support not found at $krb5_with" >&2;} { echo "$as_me:$LINENO: result: $KRBDIR" >&5 echo "${ECHO_T}$KRBDIR" >&6; } + echo "The current KRBDIR is $KRBDIR" + if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \ + -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then + KRBLDFLAGS=""; + elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then + KRBLDFLAGS=""; + else + KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib" + fi + as_ac_Lib=`echo "ac_cv_lib_$gssapi_lib''_gss_krb5_export_lucid_sec_context" | $as_tr_sh` { echo "$as_me:$LINENO: checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib" >&5 echo $ECHO_N "checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib... $ECHO_C" >&6; } @@ -23405,13 +23505,14 @@ echo "$as_me: WARNING: Using $KRBDIR instead of requested value of $krb5_with fo + { echo "$as_me:$LINENO: checking for authgss_create_default in -lrpcsecgss" >&5 echo $ECHO_N "checking for authgss_create_default in -lrpcsecgss... $ECHO_C" >&6; } if test "${ac_cv_lib_rpcsecgss_authgss_create_default+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lrpcsecgss $KRBLIBS $LIBS" +LIBS="-lrpcsecgss -lgssapi -ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23496,7 +23597,7 @@ if test "${ac_cv_lib_rpcsecgss_authgss_set_debug_level+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lrpcsecgss $KRBLIBS $LIBS" +LIBS="-lrpcsecgss -lgssapi -ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27824,13 +27925,14 @@ done + for ac_func in alarm atexit dup2 fdatasync ftruncate getcwd \ gethostbyaddr gethostbyname gethostname getmntent \ gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \ realpath rmdir select socket strcasecmp strchr strdup \ - strerror strrchr strtol strtoul + strerror strrchr strtol strtoul sigprocmask do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -29941,6 +30043,507 @@ cat >>confdefs.h <<_ACEOF _ACEOF +{ echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef socklen_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_socklen_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=no +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } + +{ echo "$as_me:$LINENO: checking size of socklen_t" >&5 +echo $ECHO_N "checking size of socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_socklen_t" = yes; then + # The cast to long int works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_socklen_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (socklen_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (socklen_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef socklen_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_socklen_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (socklen_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (socklen_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val +else + ac_cv_sizeof_socklen_t=0 +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_socklen_t" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SOCKLEN_T $ac_cv_sizeof_socklen_t +_ACEOF + + + cat >>confdefs.h <<_ACEOF @@ -30429,7 +31032,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by linux nfs-utils $as_me 1.0.9-pre1, which was +This file was extended by linux nfs-utils $as_me 1.0.9, which was generated by GNU Autoconf 2.59e. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30482,7 +31085,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -linux nfs-utils config.status 1.0.9-pre1 +linux nfs-utils config.status 1.0.9 configured by $0, generated by GNU Autoconf 2.59e, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -30867,6 +31470,7 @@ LIBBSD!$LIBBSD$ac_delim KRBDIR!$KRBDIR$ac_delim KRBLIBS!$KRBLIBS$ac_delim KRBCFLAGS!$KRBCFLAGS$ac_delim +KRBLDFLAGS!$KRBLDFLAGS$ac_delim K5VERS!$K5VERS$ac_delim ALLOCA!$ALLOCA$ac_delim LIBOBJS!$LIBOBJS$ac_delim @@ -30880,7 +31484,7 @@ ACLOCAL_AMFLAGS!$ACLOCAL_AMFLAGS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index ded529f..80ee58a 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -AC_INIT([linux nfs-utils],[1.0.9-pre1],[nfs@lists.sf.net],[nfs-utils]) +AC_INIT([linux nfs-utils],[1.0.9],[nfs@lists.sf.net],[nfs-utils]) AC_CANONICAL_BUILD([]) AC_CANONICAL_HOST([]) AC_CONFIG_SRCDIR(tools/getiversion/getiversion.c) @@ -109,9 +109,9 @@ AC_ARG_ENABLE(rquotad, AC_ARG_ENABLE(mount, [AC_HELP_STRING([--enable-mount], - [Create mount.nfs and don't use the util-linux mount(8) functionality. @<:@default=yes@:>@])], + [Create mount.nfs and don't use the util-linux mount(8) functionality. @<:@default=no@:>@])], enable_mount=$enableval, - enable_mount=yes) + enable_mount=no) AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"]) # Check whether user wants TCP wrappers support @@ -151,20 +151,20 @@ AC_CHECK_LIB(socket, main, [LIBSOCKET="-lnsl"]) AC_CHECK_LIB(nsl, main, [LIBNSL="-lnsl"]) AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"]) if test "$enable_nfsv4" = yes; then - AC_CHECK_LIB(event, event_dispatch, [libevent=1], [AC_MSG_ERROR(libevent needed for nfsv4 support)]) - AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], [AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)]) - AC_CHECK_HEADERS(event.h, ,[AC_MSG_ERROR(libevent needed for nfsv4 support)]) - AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)]) + AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support])) + AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support])) + AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support])) + AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support])) dnl librpcsecgss already has a dependency on libgssapi, dnl but we need to make sure we get the right version if test "$enable_gss" = yes; then - PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.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]) + PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.10, , + [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss.]) + AC_MSG_ERROR([If you have pkgconfig installed, you might try setting environment]) + AC_MSG_ERROR([variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig]) ] ) - PKG_CHECK_MODULES([GSSAPI], [libgssapi >= 0.9]) + PKG_CHECK_MODULES(GSSAPI, libgssapi >= 0.9) fi fi @@ -178,17 +178,21 @@ AC_SUBST(LIBBSD) if test "$enable_gss" = yes; then dnl 'gss' also depends on nfsidmap.h - at least for svcgssd_proc.c - AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for gss support)]) - AC_CHECK_HEADERS(spkm3.h, ,[AC_MSG_WARN(could not locate SPKM3 header; will not have SPKM3 support)]) + AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for gss support])) + AC_CHECK_HEADERS(spkm3.h, ,AC_MSG_WARN([could not locate SPKM3 header; will not have SPKM3 support])) + dnl the nfs4_set_debug function doesn't appear in all version of the library + AC_CHECK_LIB(nfsidmap, nfs4_set_debug, + AC_DEFINE(HAVE_NFS4_SET_DEBUG,1, + [Whether nfs4_set_debug() is present in libnfsidmap]),) dnl Check for Kerberos V5 AC_KERBEROS_V5 dnl This is not done until here because we need to have KRBLIBS set dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS) - AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], [AC_MSG_ERROR(librpcsecgss needed for nfsv4 support)], $KRBLIBS) + AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), -lgssapi -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]),, $KRBLIBS) + AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, -lgssapi -ldl) fi @@ -238,7 +242,7 @@ AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \ gethostbyaddr gethostbyname gethostname getmntent \ gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \ realpath rmdir select socket strcasecmp strchr strdup \ - strerror strrchr strtol strtoul]) + strerror strrchr strtol strtoul sigprocmask]) dnl ************************************************************* @@ -248,6 +252,8 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(size_t) +AC_CHECK_SIZEOF(socklen_t) + dnl ************************************************************* dnl Export some path names to config.h diff --git a/linux-nfs/Makefile.in b/linux-nfs/Makefile.in index 975f036..61be723 100644 --- a/linux-nfs/Makefile.in +++ b/linux-nfs/Makefile.in @@ -111,6 +111,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/Makefile.in b/support/Makefile.in index 5e2c135..74731ee 100644 --- a/support/Makefile.in +++ b/support/Makefile.in @@ -119,6 +119,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/export/Makefile.am b/support/export/Makefile.am index 41769fa..7a6a441 100644 --- a/support/export/Makefile.am +++ b/support/export/Makefile.am @@ -8,10 +8,7 @@ GENFILES_H = mount.h GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H) -EXTRA_DIST = \ - mount.x \ - \ - keys.c +EXTRA_DIST = mount.x noinst_LIBRARIES = libexport.a libexport_a_SOURCES = client.c export.c hostname.c nfsctl.c rmtab.c \ @@ -39,6 +36,7 @@ $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) $(GENFILES_H): %.h: %.x $(RPCGEN) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $< + rm -f $(top_builddir)/support/include/mount.h $(LN_S) ../export/mount.h $(top_builddir)/support/include/mount.h MAINTAINERCLEANFILES = Makefile.in diff --git a/support/export/Makefile.in b/support/export/Makefile.in index 00b1eca..0c00ba5 100644 --- a/support/export/Makefile.in +++ b/support/export/Makefile.in @@ -135,6 +135,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -227,11 +228,7 @@ GENFILES_CLNT = mount_clnt.c GENFILES_XDR = mount_xdr.c GENFILES_H = mount.h GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H) -EXTRA_DIST = \ - mount.x \ - \ - keys.c - +EXTRA_DIST = mount.x noinst_LIBRARIES = libexport.a libexport_a_SOURCES = client.c export.c hostname.c nfsctl.c rmtab.c \ xtab.c mount_clnt.c mount_xdr.c @@ -522,6 +519,7 @@ $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) $(GENFILES_H): %.h: %.x $(RPCGEN) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $< + rm -f $(top_builddir)/support/include/mount.h $(LN_S) ../export/mount.h $(top_builddir)/support/include/mount.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/support/export/client.c b/support/export/client.c index c09e762..33dfdb0 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "xmalloc.h" #include "misc.h" diff --git a/support/export/keys.c b/support/export/keys.c deleted file mode 100644 index 4814808..0000000 --- a/support/export/keys.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * keys.c Key management for nfsd. Currently, keys - * are kept in a single file only, but eventually, - * support for a key server should be added. - * - * Copyright (C) 1995 Olaf Kirch - */ - -#include "config.h" - -#include -#include "nfslib.h" -#include "exportfs.h" -#include "xmalloc.h" - -struct keycache { - struct keycache * k_next; - struct nfskeyent k_data; -}; - -static struct keycache * keycache = NULL; -static time_t lastmod = 0; - -static void key_reload(void); - - -struct nfskey * -key_lookup(char *hname) -{ - struct keycache *kc; - - key_reload(); - - for (kc = keycache; kc; kc = kc->k_next) { -#if 0 - if (matchhostname(kc->k_data.k_hostname, hname)) -#else - if (!strcmp(kc->k_data.k_hostname, hname)) -#endif - return &kc->k_data.k_key; - } - - return NULL; -} - -static void -key_reload(void) -{ - struct stat stb; - struct keycache *cp; - struct nfskeyent *kp; - - if (stat(_PATH_NFSKEYS, &stb) >= 0 && stb.st_mtime == lastmod) - return; - - while (keycache) { - cp = keycache->k_next; - xfree(keycache); - keycache = cp; - } - - setnfskeyent(_PATH_NFSKEYS); - while ((kp = getnfskeyent()) != NULL) { - cp = (struct keycache *) xmalloc(sizeof(*cp)); - cp->k_data = *kp; - cp->k_next = keycache; - keycache = cp; - } - endnfskeyent(); - - lastmod = stb.st_mtime; -} diff --git a/support/include/Makefile.am b/support/include/Makefile.am index cdf628b..a99882c 100644 --- a/support/include/Makefile.am +++ b/support/include/Makefile.am @@ -11,15 +11,11 @@ noinst_HEADERS = \ nfs_mntent.h \ nfs_paths.h \ nfslib.h \ - rpcdispatch.h \ rpcmisc.h \ - rpcsec.h \ tcpwrapper.h \ - version.h \ xio.h \ xlog.h \ xmalloc.h \ - xcommon.h \ - ypupdate.h + xcommon.h MAINTAINERCLEANFILES = Makefile.in diff --git a/support/include/Makefile.in b/support/include/Makefile.in index bfc8833..8400d61 100644 --- a/support/include/Makefile.in +++ b/support/include/Makefile.in @@ -122,6 +122,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -219,16 +220,12 @@ noinst_HEADERS = \ nfs_mntent.h \ nfs_paths.h \ nfslib.h \ - rpcdispatch.h \ rpcmisc.h \ - rpcsec.h \ tcpwrapper.h \ - version.h \ xio.h \ xlog.h \ xmalloc.h \ - xcommon.h \ - ypupdate.h + xcommon.h MAINTAINERCLEANFILES = Makefile.in all: config.h diff --git a/support/include/config.h.in b/support/include/config.h.in index 99cf70e..f288aa0 100644 --- a/support/include/config.h.in +++ b/support/include/config.h.in @@ -158,6 +158,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Whether nfs4_set_debug() is present in libnfsidmap */ +#undef HAVE_NFS4_SET_DEBUG + /* Define to 1 if you have the header file. */ #undef HAVE_NFSIDMAP_H @@ -180,6 +183,9 @@ gss_krb5_set_allowable_enctypes */ #undef HAVE_SET_ALLOWABLE_ENCTYPES +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET @@ -359,6 +365,9 @@ /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T +/* The size of `socklen_t', as computed by sizeof. */ +#undef SIZEOF_SOCKLEN_T + /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. diff --git a/support/include/nfs/Makefile.in b/support/include/nfs/Makefile.in index 3fff1e0..e7e710f 100644 --- a/support/include/nfs/Makefile.in +++ b/support/include/nfs/Makefile.in @@ -115,6 +115,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/include/nfs/debug.h b/support/include/nfs/debug.h index 876b5db..57be843 100644 --- a/support/include/nfs/debug.h +++ b/support/include/nfs/debug.h @@ -11,9 +11,11 @@ #define RPCDBG_AUTH 0x0010 #define RPCDBG_PMAP 0x0020 #define RPCDBG_SCHED 0x0040 +#define RPCDBG_TRANS 0x0080 #define RPCDBG_SVCSOCK 0x0100 #define RPCDBG_SVCDSP 0x0200 #define RPCDBG_MISC 0x0400 +#define RPCDBG_CACHE 0x0800 #define RPCDBG_ALL 0x7fff /* @@ -59,6 +61,7 @@ enum { #define NLMDBG_CLNTSUBS 0x0020 #define NLMDBG_SVCSUBS 0x0040 #define NLMDBG_HOSTCACHE 0x0080 +#define NLMDBG_XDR 0x0100 #define NLMDBG_ALL 0x7fff @@ -70,6 +73,7 @@ enum { #define NFSDBG_XDR 0x0020 #define NFSDBG_FILE 0x0040 #define NFSDBG_ROOT 0x0080 +#define NFSDBG_CALLBACK 0x0100 #define NFSDBG_ALL 0xFFFF #endif /* _NFS_DEBUG_H */ diff --git a/support/include/rpcdispatch.h b/support/include/rpcdispatch.h deleted file mode 100644 index 866d4bf..0000000 --- a/support/include/rpcdispatch.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * nlm_dispatch This is a generic RPC call dispatcher. - * It is loosely based on the dispatch mechanism I - * first encountered in the UNFSD source. - * - * Cyopright (C) 1995, Olaf Kirch - * - * 24.05.95 okir - * - */ - -#ifndef RPCDISPATCH_H -#define RPCDISPATCH_H - -#include - -#ifdef __STDC__ -# define CONCAT(a,b) a##b -# define CONCAT3(a,b,c) a##b##c -# define STRING(a) #a -#else -# define CONCAT(a,b) a/**/b -# define CONCAT3(a,b,c) a/**/b/**/c -# define STRING(a) "a" -#endif - -#ifdef __STDC__ -typedef bool_t (*rpcsvc_fn_t)(struct svc_req *, void *argp, void *resp); -#else -typedef bool_t (*rpcsvc_fn_t)(); -#endif - -#define table_ent(func, vers, arg_type, res_type) \ - { STRING(func), \ - (rpcsvc_fn_t)CONCAT(func,_svc), vers,\ - (xdrproc_t)CONCAT(xdr_, arg_type), sizeof(arg_type), \ - (xdrproc_t)CONCAT(xdr_, res_type), sizeof(res_type), \ - } -#define nlm_undef_svc NULL -#define xdr_nlm_void xdr_void - -struct dispatch_entry { - const char *name; - rpcsvc_fn_t func; - unsigned int versions; /* bitmap of versions */ - xdrproc_t xdr_arg_fn; /* argument XDR */ - size_t xdr_arg_size; - xdrproc_t xdr_res_fn; /* result XDR */ - size_t xdr_res_size; -}; - -void rpc_dispatch(struct svc_req *rq, SVCXPRT *tp, - struct dispatch_entry *dtable, int nproc, - void *argp, void *resp); -void rpc_svcrun(void); - -#endif /* RPCDISPATCH_H */ diff --git a/support/include/rpcsec.h b/support/include/rpcsec.h deleted file mode 100644 index 84d4497..0000000 --- a/support/include/rpcsec.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Declarations needed for the authdes library. Some of the functions - * mentioned herein have been omitted from the Linux libc header files - */ - -#ifndef RPCSEC_H -#define RPCSEC_H - -int netname2user(char *netname, int *uidp, int *gidp, - int *gidlenp, int *gidlist); -int netname2host(char *netname, char *hostname, int hostlen); -int getnetname(char *name); -int user2netname(char *netname, int uid, char *domain); -int host2netname(char *netname, char *hostname, char *domain); -void passwd2des(char *pw, char *key); -int getsecretkey(char *netname, char *secretkey, char *passwd); -int getpublickey(char *hostname, char *publickey); -int yp_update(char *domain, char *map, unsigned int ypop, - char *key, int keylen, char *data, int datalen); -int key_setsecret(char *secret); -int xencrypt(char *secret, char *passwd); -int xdecrypt(char *secret, char *passwd); - - -#define PUBLICKEY_MAP "publickey.byname" -#define NETID_MAP "netid.byname" - -#ifndef DEBUG -#define RPCSEC_BASE "/etc/" -#else -#define RPCSEC_BASE "/tmp/" -#endif - -#define PUBLICKEY_FILE RPCSEC_BASE "publickey" -#define PUBLICKEY_LOCK RPCSEC_BASE "publickey.lock" -#define ROOTKEY_FILE RPCSEC_BASE ".rootkey" -#define KEYSTORE_FILE RPCSEC_BASE "keystore" - -#endif /* RPCSEC_H */ diff --git a/support/include/rpcsvc/Makefile.in b/support/include/rpcsvc/Makefile.in index e3f9144..041958d 100644 --- a/support/include/rpcsvc/Makefile.in +++ b/support/include/rpcsvc/Makefile.in @@ -115,6 +115,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/include/sys/Makefile.in b/support/include/sys/Makefile.in index 62d0b35..0387043 100644 --- a/support/include/sys/Makefile.in +++ b/support/include/sys/Makefile.in @@ -119,6 +119,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/include/sys/fs/Makefile.in b/support/include/sys/fs/Makefile.in index 31c0b00..ae7ec67 100644 --- a/support/include/sys/fs/Makefile.in +++ b/support/include/sys/fs/Makefile.in @@ -115,6 +115,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/include/version.h b/support/include/version.h deleted file mode 100644 index a74ec35..0000000 --- a/support/include/version.h +++ /dev/null @@ -1 +0,0 @@ -#define VERSION "1.4.7 (0.4.22)" diff --git a/support/include/ypupdate.h b/support/include/ypupdate.h deleted file mode 100644 index e0cee15..0000000 --- a/support/include/ypupdate.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * ypupdate.h This file contains the public declarations for the - * ypupdate client side RPC stubs. - * - * Copyright (C) 1995 Olaf Kirch - */ - -#ifndef YPUPDATE_H -#define YPUPDATE_H - -#include - -int yp_update(char *domain, char *map, unsigned int ypop, - char *key, int keylen, char *data, int datalen); - -#endif YPUPDATE_H diff --git a/support/misc/Makefile.in b/support/misc/Makefile.in index 131ea8f..2e5d190 100644 --- a/support/misc/Makefile.in +++ b/support/misc/Makefile.in @@ -131,6 +131,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/support/misc/from_local.c b/support/misc/from_local.c index 56478d7..f6f944c 100644 --- a/support/misc/from_local.c +++ b/support/misc/from_local.c @@ -35,7 +35,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#) from_local.c 1.3 96/05/31 15:52:57"; #endif diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c index 750b6e8..a72fb92 100644 --- a/support/misc/mountpoint.c +++ b/support/misc/mountpoint.c @@ -4,7 +4,7 @@ */ #include -#include +#include "xcommon.h" #include int diff --git a/support/nfs/Makefile.am b/support/nfs/Makefile.am index e844c73..af8181d 100644 --- a/support/nfs/Makefile.am +++ b/support/nfs/Makefile.am @@ -8,7 +8,3 @@ libnfs_a_SOURCES = exports.c rmtab.c xio.c rpcmisc.c rpcdispatch.c \ MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = \ - clients.c \ - keytab.c \ - ypupdate_xdr.c diff --git a/support/nfs/Makefile.in b/support/nfs/Makefile.in index d1bae14..1cb6386 100644 --- a/support/nfs/Makefile.in +++ b/support/nfs/Makefile.in @@ -136,6 +136,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -230,11 +231,6 @@ libnfs_a_SOURCES = exports.c rmtab.c xio.c rpcmisc.c rpcdispatch.c \ svc_socket.c cacheio.c closeall.c conn.c fstab.c nfs_mntent.c MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = \ - clients.c \ - keytab.c \ - ypupdate_xdr.c - all: all-am .SUFFIXES: diff --git a/support/nfs/clients.c b/support/nfs/clients.c deleted file mode 100644 index cb35d2e..0000000 --- a/support/nfs/clients.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - * support/nfs/nfsclient.c - * - * Parse the nfsclients file. - * - * Copyright (C) 1995, 1996 Olaf Kirch - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include "xmalloc.h" -#include "nfslib.h" -#include "exportfs.h" -#include "xio.h" - -static char *cfname = NULL; -static XFILE *cfp = NULL; -static int *squash_uids = NULL, - *squash_gids = NULL; -static int squash_uidlen = 0, - squash_gidlen = 0; -static char *hosts = NULL; - -static int parsesquash(char *list, int **idp, int *lenp); -static int parsenum(char **cpp); -static int parsekey(struct nfskey *keyp, char *str); -static int hexdigit(char c); -static int gettag(char *tag, int len); -static int getattr(char *attr, int alen, char *value, int vlen); -static void syntaxerr(char *msg); - -#ifndef isblank -#define isblank(c) ((c) == ' ' || (c) == '\t') -#endif - -void -setnfsclntent(char *fname) -{ - if (cfp) - xfclose(cfp); - if (!fname) - fname = _PATH_NFSCLIENTS; - if ((cfp = xfopen(fname)) == NULL) - xlog(L_ERROR, "can't open %s for reading", fname); - cfname = strdup(fname); -} - -struct nfsclntent * -getnfsclntent(void) -{ - static struct nfsclntent cle; - static char *hostptr = NULL; - char attr[32], val[512], *sp; - int ok; - - if (!cfp) - endnfsclntent(); - -again: - if (hosts) { - if (hostptr) - goto nexthost; - xfree(hosts); - hosts = NULL; - } - - if ((ok = gettag(cle.c_tag, sizeof(cle.c_tag))) < 0) - syntaxerr("expected tag"); - if (ok <= 0) - return NULL; - - cle.c_hostname[0] = '\0'; - cle.c_fhkey.k_type = CLE_KEY_NONE; - cle.c_mapping = CLE_MAP_IDENT; - cle.c_anonuid = 65534; - cle.c_anongid = 65534; - - if (squash_uids) - xfree(squash_uids); - if (squash_gids) - xfree(squash_gids); - squash_uids = squash_gids = NULL; - squash_uidlen = squash_gidlen = 0; - - while (ok) { - if ((ok = getattr(attr, sizeof(attr), val, sizeof(val))) < 0) - return NULL; - if (!ok) - break; - if (attr[0] == 'h' && !strcmp(attr, "hosts")) { - int l0 = hosts? strlen(hosts) : 0; - - hosts = (char *) xrealloc(hosts, l0+strlen(val)+2); - if (l0) - hosts[l0++] = ':'; - strcpy(hosts+l0, val); - } else - if (attr[0] == 'f' && !strcmp(attr, "fhmac")) { - if (!parsekey(&cle.c_fhkey, val)) - return NULL; - } else - if (attr[0] == 'm' && !strcmp(attr, "mapping")) { - if (!strcmp(val, "identity")) - cle.c_mapping = CLE_MAP_IDENT; - else if (!strcmp(val, "file")) - cle.c_mapping = CLE_MAP_FILE; - else if (!strcmp(val, "daemon")) - cle.c_mapping = CLE_MAP_UGIDD; - else { - syntaxerr("invalid mapping type"); - return NULL; - } - } else - if (attr[0] == 's' && !strcmp(attr, "squash_uids")) { - if (!parsesquash(val, &squash_uids, &squash_uidlen)) - return NULL; - } else - if (attr[0] == 's' && !strcmp(attr, "squash_gids")) { - if (!parsesquash(val, &squash_gids, &squash_gidlen)) - return NULL; - } else - if (attr[0] == 'a' && !strcmp(attr, "anonuid")) - cle.c_anonuid = atoi(val); - else - if (attr[0] == 'a' && !strcmp(attr, "anongid")) - cle.c_anongid = atoi(val); - else - syntaxerr("unknown attribute"); - } - - cle.c_squashuids = squash_uids; - cle.c_squashgids = squash_gids; - - /* This is the anon entry */ - if (!hosts) { - if (strcmp(cle.c_tag, "anonymous")) { - xlog(L_ERROR, - "%s:%d: entry %s allows anonymous access. Ignored.", - cfname, xfp->x_line, cle.c_tag); - goto again; - } - return &cle; - } - hostptr = hosts; - -nexthost: - if (*hostptr == ':' && strcmp(cle.c_tag, "anonymous")) { - xlog(L_ERROR, - "%s:%d: entry %s allows anonymous access. Ignored.", - cfname, cfp->x_line, cle.c_tag); - while (*hostptr == ':') - hostptr++; - } - - /* Ignore trailing colons */ - if (!*hostptr) { - hostptr = NULL; - goto again; - } - - sp = hostptr; - hostptr = strchr(hostptr, ':'); - if (hostptr) - *hostptr++ = '\0'; - strncpy(cle.c_hostname, sp, sizeof(cle.c_hostname) - 1); - cle.c_hostname [sizeof(cle.c_hostname) - 1] = '\0'; - return &cle; -} - -void -endnfsclntent(void) -{ - if (cfname) - free(cfname); - if (cfp) - xfclose(cfp); - if (squash_uids) - xfree(squash_uids); - if (squash_gids) - xfree(squash_gids); - if (hosts) - xfree(hosts); - cfname = NULL; - cfp = NULL; - squash_uids = NULL; - squash_gids = NULL; - hosts = NULL; -} - -static int -parsekey(struct nfskey *keyp, char *str) -{ - char *sp; - int i, l, x0, x1; - - - if ((sp = strchr(str, ':')) != NULL) - *sp++ = '\0'; - if (!strcmp(str, "null")) - keyp->k_type = CLE_KEY_NULL; - else if (!strcmp(str, "md5")) - keyp->k_type = CLE_KEY_MD5; - else if (!strcmp(str, "sha")) - keyp->k_type = CLE_KEY_SHA; - else { - syntaxerr("unknown key type"); - return 0; - } - if (keyp->k_type == CLE_KEY_NULL) { - keyp->k_len = 0; - if (sp) - syntaxerr("unexpected key data for null key"); - return sp? 0 : 1; - } else if (sp) { - if ((l = strlen(sp)) & 1) { - syntaxerr("odd key length"); - return 0; - } - - l >>= 1; - for (i = 0; i < l && i < sizeof(keyp->k_key); i++, sp += 2) { - if ((x0 = hexdigit(sp[0])) == 0xff || - (x1 = hexdigit(sp[1])) == 0xff) { - syntaxerr("bad key digit"); - return 0; - } - keyp->k_key[i] = (x0 << 4) | x1; - } - keyp->k_len = i; - return 1; - } - return 0; -} - -static int -hexdigit(char c) -{ - if ((c = tolower(c)) >= '0' && c <= '9') - return c - '0'; - if (c >= 'a' && c <= 'f') - return c - 'a' + 10; - return 0xff; -} - -static int -parsesquash(char *list, int **idp, int *lenp) -{ - char *cp = list; - int id0, id1; - int len = *lenp; - int *id = *idp; - - do { - id0 = parsenum(&cp); - if (*cp == '-') { - cp++; - id1 = parsenum(&cp); - } else { - id1 = id0; - } - if (id0 == -1 || id1 == -1) { - syntaxerr("uid/gid -1 not permitted"); - return 0; - } - if ((len % 8) == 0) - id = (int *) xrealloc(id, (len + 9) * sizeof(*id)); - id[len++] = id0; - id[len++] = id1; - if (!*cp) - break; - if (*cp != ',') { - syntaxerr("bad uid/gid list"); - return 0; - } - cp++; - } while(1); - - id[len] = -1; - *lenp = len; - *idp = id; - return 1; -} - -static int -parsenum(char **cpp) -{ - char *cp = *cpp, c; - int num = 0; - - if (**cpp == '-') - (*cpp)++; - while (isdigit(**cpp)) - (*cpp)++; - c = **cpp; **cpp = '\0'; num = atoi(cp); **cpp = c; - return num; -} - -static int -gettag(char *tag, int len) -{ - xskip(cfp, " \t\n"); - return xgettok(cfp, ':', tag, len); -} - -static int -getattr(char *attr, int alen, char *value, int vlen) -{ - int ok; - - xskip(cfp, " \t"); - if ((ok = xgettok(cfp, '=', attr, alen)) < 0) - syntaxerr("missing attribute"); - if (ok <= 0) - return ok; - xskip(cfp, " \t="); - - return xgettok(cfp, 0, value, vlen); -} - -static void -syntaxerr(char *msg) -{ - xlog(L_ERROR, "%s:%d: syntax error: %s", - cfname, cfp->x_line, msg); -} - diff --git a/support/nfs/conn.c b/support/nfs/conn.c index 5160c8b..89f7676 100644 --- a/support/nfs/conn.c +++ b/support/nfs/conn.c @@ -6,7 +6,9 @@ * */ +#include "config.h" #include +#include #include #include #include @@ -17,6 +19,10 @@ #include "conn.h" +#if SIZEOF_SOCKLEN_T - 0 == 0 +#define socklen_t int +#endif + extern int verbose; /* Map an NFS version into the corresponding Mountd version */ @@ -163,7 +169,7 @@ clnt_ping(struct sockaddr_in *saddr, const u_long prog, const u_long vers, if (sock != -1) { if (caddr) { /* Get the address of our end of this connection */ - int len = sizeof(*caddr); + socklen_t len = sizeof(*caddr); if (getsockname(sock, caddr, &len) != 0) caddr->sin_family = 0; } diff --git a/support/nfs/keytab.c b/support/nfs/keytab.c deleted file mode 100644 index e33dded..0000000 --- a/support/nfs/keytab.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * support/nfs/keytab.c - * - * Manage the nfskeys database. - * - * Copyright (C) 1995, 1996 Olaf Kirch - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include "xmalloc.h" -#include "nfslib.h" -#include "exportfs.h" -#include "xio.h" - -static FILE *cfp = NULL; - -int -setnfskeyent(char *fname) -{ - if (cfp) - fclose(cfp); - if (!fname) - fname = _PATH_NFSKEYS; - cfp = fsetnfskeyent(fname, "r"); - return cfp != NULL; -} - -FILE * -fsetnfskeyent(char *fname, char *type) -{ -#if 0 - FILE *fp; - - if ((fp = fopen(fname, type)) == NULL) - xlog(L_ERROR, "can't open %s for %sing\n", - fname, type[0] == 'r'? "read" : "writ"); - return fp; -#else - return fopen(fname, type); -#endif -} - -struct nfskeyent * -getnfskeyent(void) -{ - return fgetnfskeyent(cfp); -} - -struct nfskeyent * -fgetnfskeyent(FILE *fp) -{ - static struct nfskeyent ke; - - if (!fp) - return NULL; - - do { - if (fread(&ke, sizeof(ke), 1, fp) != 1) - return NULL; - } while(ke.k_hostname[0] == '\0'); - return &ke; -} - -void -endnfskeyent(void) -{ - if (cfp) - fclose(cfp); - cfp = NULL; -} - -void -fendnfskeyent(FILE *fp) -{ - if (fp) - fclose(fp); -} - -void -fputnfskeyent(FILE *fp, struct nfskeyent *kep) -{ - fwrite(kep, sizeof(*kep), 1, fp); -} - -int -getnfskeytype(char *st) -{ - if (!strcasecmp(st, "null")) - return CLE_KEY_NULL; - if (!strcasecmp(st, "md5")) - return CLE_KEY_MD5; - if (!strcasecmp(st, "sha")) - return CLE_KEY_SHA; - return CLE_KEY_NONE; -} - -char * -getnfskeyname(int type) -{ - switch (type) { - case CLE_KEY_NONE: - return "none"; - case CLE_KEY_NULL: - return "null"; - case CLE_KEY_MD5: - return "md5"; - case CLE_KEY_SHA: - return "sha"; - } - return "unk"; -} - -int -getnfskeysize(int type) -{ - switch (type) { - case CLE_KEY_MD5: - return 16; - case CLE_KEY_SHA: - return 20; - } - return 0; -} diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c index b407d68..d1d124b 100644 --- a/support/nfs/nfs_mntent.c +++ b/support/nfs/nfs_mntent.c @@ -25,11 +25,12 @@ static unsigned char need_escaping[] = { ' ', '\t', '\n', '\\' }; static char * -mangle(const unsigned char *s) { +mangle(const char *arg) { + const unsigned char *s = (const unsigned char *)arg; char *ss, *sp; int n; - n = strlen(s); + n = strlen(arg); ss = sp = xmalloc(4*n+1); while(1) { for (n = 0; n < sizeof(need_escaping); n++) { diff --git a/support/nfs/nfssvc.c b/support/nfs/nfssvc.c index a6ea410..1feffdd 100644 --- a/support/nfs/nfssvc.c +++ b/support/nfs/nfssvc.c @@ -135,9 +135,12 @@ nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits, struct nfsctl_arg arg; int fd; - nfssvc_setfds(port, protobits, haddr); - + /* Note: must set versions before fds so that + * the ports get registered with portmap against correct + * versions + */ nfssvc_versbits(versbits); + nfssvc_setfds(port, protobits, haddr); fd = open(NFSD_THREAD_FILE, O_WRONLY); if (fd < 0) diff --git a/support/nfs/rpcmisc.c b/support/nfs/rpcmisc.c index c7bff40..5b0a88f 100644 --- a/support/nfs/rpcmisc.c +++ b/support/nfs/rpcmisc.c @@ -34,6 +34,10 @@ #include #include "nfslib.h" +#if SIZEOF_SOCKLEN_T - 0 == 0 +#define socklen_t int +#endif + static void closedown(int sig); int makesock(int port, int proto); @@ -48,13 +52,13 @@ rpc_init(char *name, int prog, int vers, void (*dispatch)(), int defport) struct sockaddr_in saddr; SVCXPRT *transp; int sock; - int asize; + socklen_t asize; asize = sizeof(saddr); sock = 0; if (getsockname(0, (struct sockaddr *) &saddr, &asize) == 0 && saddr.sin_family == AF_INET) { - int ssize = sizeof (int); + socklen_t ssize = sizeof (int); int fdtype = 0; if (getsockopt(0, SOL_SOCKET, SO_TYPE, (char *)&fdtype, &ssize) == -1) @@ -228,10 +232,12 @@ rpc_logcall(struct svc_req *rqstp, char *xname, char *arg) break; case AUTH_UNIX: { struct authunix_parms *unix_cred; + time_t time; struct tm *tm; unix_cred = (struct authunix_parms *) rqstp->rq_clntcred; - tm = localtime(&unix_cred->aup_time); + time = unix_cred->aup_time; + tm = localtime(&time); snprintf(sp, buflen, "UNIX %d/%d/%d %02d:%02d:%02d %s %d.%d", tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, diff --git a/support/nfs/ypupdate_xdr.c b/support/nfs/ypupdate_xdr.c deleted file mode 100644 index 9fe1098..0000000 --- a/support/nfs/ypupdate_xdr.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * support/nfs/ypupdate_xdr.c - * - * This file contains the XDR code for the ypupdate protocol. - * - * Copyright (C) 1995, 1996 Olaf Kirch - */ - -#include "config.h" - -#include - -bool_t -xdr_ypupdate_args(XDR *xdrs, ypupdate_args *objp) -{ - return xdr_string(xdrs, &objp->mapname, MAXMAPNAMELEN) && - xdr_bytes(xdrs, &objp->key.yp_buf_val, - &objp->key.yp_buf_len, MAXYPDATALEN) && - xdr_bytes(xdrs, &objp->datum.yp_buf_val, - &objp->datum.yp_buf_len, MAXYPDATALEN); -} - -bool_t -xdr_ypdelete_args(XDR *xdrs, ypdelete_args *objp) -{ - return xdr_string(xdrs, &objp->mapname, MAXMAPNAMELEN) && - xdr_bytes(xdrs, &objp->key.yp_buf_val, - &objp->key.yp_buf_len, MAXYPDATALEN); -} diff --git a/support/rpc/include/Makefile.am b/support/rpc/include/Makefile.am deleted file mode 100644 index fef4b5e..0000000 --- a/support/rpc/include/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = rpc diff --git a/tools/Makefile.in b/tools/Makefile.in index 7143acf..620f6ff 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -119,6 +119,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/getiversion/Makefile.in b/tools/getiversion/Makefile.in index 64519b2..afb0dce 100644 --- a/tools/getiversion/Makefile.in +++ b/tools/getiversion/Makefile.in @@ -129,6 +129,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/getkversion/Makefile.in b/tools/getkversion/Makefile.in index 49775f5..6ff2e56 100644 --- a/tools/getkversion/Makefile.in +++ b/tools/getkversion/Makefile.in @@ -129,6 +129,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/locktest/Makefile.in b/tools/locktest/Makefile.in index 7a20776..8d383be 100644 --- a/tools/locktest/Makefile.in +++ b/tools/locktest/Makefile.in @@ -129,6 +129,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/nlmtest/Makefile.in b/tools/nlmtest/Makefile.in index b15fada..0a663ab 100644 --- a/tools/nlmtest/Makefile.in +++ b/tools/nlmtest/Makefile.in @@ -110,6 +110,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/rpcdebug/Makefile.am b/tools/rpcdebug/Makefile.am index 409c98f..39b70c9 100644 --- a/tools/rpcdebug/Makefile.am +++ b/tools/rpcdebug/Makefile.am @@ -3,9 +3,10 @@ CC=$(CC_FOR_BUILD) LIBTOOL = @LIBTOOL@ --tag=CC -EXTRA_DIST= neat_idea.c +man8_MANS = rpcdebug.man +EXTRA_DIST = $(man8_MANS) -noinst_PROGRAMS = rpcdebug +sbin_PROGRAMS = rpcdebug rpcdebug_SOURCES = rpcdebug.c rpcdebug_CFLAGS=$(CFLAGS_FOR_BUILD) rpcdebug_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -I$(top_srcdir)/support/include diff --git a/tools/rpcdebug/Makefile.in b/tools/rpcdebug/Makefile.in index 5dae6dd..824e90d 100644 --- a/tools/rpcdebug/Makefile.in +++ b/tools/rpcdebug/Makefile.in @@ -36,7 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = rpcdebug$(EXEEXT) +sbin_PROGRAMS = rpcdebug$(EXEEXT) subdir = tools/rpcdebug DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -50,7 +50,9 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/support/include/config.h CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) +am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(sbin_PROGRAMS) am_rpcdebug_OBJECTS = rpcdebug-rpcdebug.$(OBJEXT) rpcdebug_OBJECTS = $(am_rpcdebug_OBJECTS) rpcdebug_LDADD = $(LDADD) @@ -67,6 +69,9 @@ LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(rpcdebug_SOURCES) DIST_SOURCES = $(rpcdebug_SOURCES) +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man8_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -129,6 +134,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -216,7 +222,8 @@ statduser = @statduser@ statedir = @statedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -EXTRA_DIST = neat_idea.c +man8_MANS = rpcdebug.man +EXTRA_DIST = $(man8_MANS) rpcdebug_SOURCES = rpcdebug.c rpcdebug_CFLAGS = $(CFLAGS_FOR_BUILD) rpcdebug_CPPFLAGS = $(CPPFLAGS_FOR_BUILD) -I$(top_srcdir)/support/include @@ -255,9 +262,30 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +clean-sbinPROGRAMS: + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ @@ -318,6 +346,51 @@ clean-libtool: distclean-libtool: -rm -f libtool uninstall-info-am: +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ + done +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -396,8 +469,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(PROGRAMS) $(MANS) installdirs: + for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -425,7 +501,7 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -444,13 +520,13 @@ info: info-am info-am: -install-data-am: +install-data-am: install-man -install-exec-am: +install-exec-am: install-sbinPROGRAMS install-info: install-info-am -install-man: +install-man: install-man8 installcheck-am: @@ -472,19 +548,22 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am +uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS + +uninstall-man: uninstall-man8 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ + clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am + install-man8 install-sbinPROGRAMS install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am uninstall-man \ + uninstall-man8 uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tools/rpcdebug/neat_idea.c b/tools/rpcdebug/neat_idea.c deleted file mode 100644 index 7ca9d6f..0000000 --- a/tools/rpcdebug/neat_idea.c +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Get or set RPC debug flags. - * - * I would have loved to write this without recourse to the sysctl - * interface, but the only plausible approach (reading and writing - * /dev/kmem at the offsets indicated by the *_debug symbols from - * /proc/ksyms) didn't work, because /dev/kmem doesn't translate virtual - * addresses on write. Unfortunately, modules are stuffed into memory - * allocated via vmalloc. - * - * Copyright (C) 1996, Olaf Kirch - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include "nfslib.h" - -static int verbose = 0; -static int memfd; -static off_t flagpos; - -static void find_offset(char *module); -static unsigned int find_flag(char **module, char *name); -static unsigned int get_flags(void); -static void set_flags(unsigned int value); -static void print_flags(char *module, unsigned int flags); -static void usage(int excode); - -int -main(int argc, char **argv) -{ - int opt_s = 0, - opt_c = 0; - unsigned int flags = 0, oflags; - char * module = NULL; - int c; - - while ((c = getopt(argc, argv, "chm:sv")) != EOF) { - switch (c) { - case 'c': - opt_c = 1; - break; - case 'h': - usage(0); - case 'm': - module = optarg; - break; - case 's': - opt_s = 1; - break; - case 'v': - verbose++; - break; - default: - fprintf(stderr, "rpcdebug: unknown option -%c\n", - optopt); - usage(1); - } - } - - if (opt_c + opt_s > 1) { - fprintf(stderr, "You can use at most one of -c and -s\n"); - usage(1); - } - - if (argc == optind) { - flags = ~(unsigned int) 0; - } else { - for (; optind < argc; optind++) { - unsigned int temp; - - if (!(temp = find_flag(&module, argv[optind]))) { - fprintf(stderr, "rpcdebug: unknown flag %s\n", - argv[optind]); - exit(1); - } - flags |= temp; - } - } - - if (!module) { - fprintf(stderr, "rpcdebug: no module name specified, and " - "could not be inferred.\n"); - usage(1); - } - - if ((memfd = open("/dev/kmem", O_RDWR)) < 0) { - perror("can't open /dev/mem"); - exit(1); - } - - find_offset(module); - - oflags = get_flags(); - - if (opt_c) { - set_flags(oflags & ~flags); - } else if (opt_s) { - set_flags(oflags | flags); - } else { - print_flags(module, oflags); - } - - close(memfd); - return 0; -} - -#define FLAG(mname, fname) \ - { #mname, #fname, mname##DBG_##fname } - -static struct flagmap { - char * module; - char * name; - unsigned int value; -} flagmap[] = { - /* rpc */ - FLAG(RPC, XPRT), - FLAG(RPC, CALL), - FLAG(RPC, TYPES), - FLAG(RPC, NFS), - FLAG(RPC, AUTH), - FLAG(RPC, PMAP), - FLAG(RPC, SCHED), - FLAG(RPC, SVCSOCK), - FLAG(RPC, SVCDSP), - FLAG(RPC, MISC), - FLAG(RPC, ALL), - - /* nfs */ - /* currently handled by RPCDBG_NFS */ - - /* nfsd */ - FLAG(NFSD, SOCK), - FLAG(NFSD, FH), - FLAG(NFSD, EXPORT), - FLAG(NFSD, SVC), - FLAG(NFSD, PROC), - FLAG(NFSD, FILEOP), - FLAG(NFSD, AUTH), - FLAG(NFSD, REPCACHE), - FLAG(NFSD, XDR), - FLAG(NFSD, LOCKD), - FLAG(NFSD, ALL), - - /* lockd */ - FLAG(NLM, SVC), - FLAG(NLM, CLIENT), - FLAG(NLM, CLNTLOCK), - FLAG(NLM, SVCLOCK), - FLAG(NLM, MONITOR), - FLAG(NLM, CLNTSUBS), - FLAG(NLM, SVCSUBS), - FLAG(NLM, ALL), - - { NULL, NULL, 0 } -}; - -static unsigned int -find_flag(char **module, char *name) -{ - char *mod = *module; - unsigned int value = 0; - int i; - - for (i = 0; flagmap[i].module; i++) { - if ((mod && strcasecmp(mod, flagmap[i].module)) - || strcasecmp(name, flagmap[i].name)) - continue; - if (value) { - fprintf(stderr, - "rpcdebug: ambiguous symbol name %s.\n" - "This name is used by more than one module, " - "please specify the module name using\n" - "the -m option.\n", - name); - usage(1); - } - value = flagmap[i].value; - if (*module) - return value; - mod = flagmap[i].module; - } - - *module = mod; - return value; -} - -static unsigned int -get_flags(void) -{ - unsigned int value; - int count; - - if (lseek(memfd, flagpos, SEEK_SET) < 0) { - perror("lseek"); - exit(1); - } - if ((count = read(memfd, &value, sizeof(value))) < 0) { - perror("read"); - exit(1); - } - if (count != sizeof(value)) { - fprintf(stderr, "read failed (only %d bytes read)\n", - count); - exit(1); - } - if (verbose) - printf("getting flags 0x%x\n", value); - return value; -} - -static void -set_flags(unsigned int value) -{ - int count; - - if (verbose) - printf("setting flags 0x%x\n", value); - if (lseek(memfd, flagpos, SEEK_SET) < 0) { - perror("lseek"); - exit(1); - } - if ((count = write(memfd, &value, sizeof(value))) < 0) { - perror("write"); - exit(1); - } - if (count != sizeof(value)) { - fprintf(stderr, "write failed (only %d bytes written)\n", - count); - exit(1); - } -} - -static void -find_offset(char *module) -{ - char buffer[512], *sp; - char symbol[64]; - FILE *fp; - int len; - - len = sprintf(symbol, "%s_debug", module); - - if ((fp = fopen("/proc/ksyms", "r")) < 0) { - perror("rpcdebug: can't open /proc/ksyms"); - exit(1); - } - - while (fgets(buffer, sizeof(buffer), fp) != NULL) { - if (!(sp = strchr(buffer, ' '))) - continue; - if (strncmp(++sp, symbol, len)) - continue; - if (sp[len] != '\n' && sp[len] != '\t' - && strncmp(sp+len, "_R", 2)) - continue; - flagpos = (unsigned long) strtol(buffer, &sp, 16); - /* printf("position is %lx\n", flagpos); */ - if (sp && *sp == ' ') - return; - fprintf(stderr, "rpcdebug: weird line in /proc/ksyms: %s\n", - buffer); - exit(1); - } - - fprintf(stderr, "rpcdebug: debug symbol for module %s not found.\n", - module); - exit(1); -} - -static char * -strtolower(char *str) -{ - static char temp[64]; - char *sp; - - strcpy(temp, str); - for (sp = temp; *sp; sp++) - *sp = tolower(*sp); - return temp; -} - -static void -print_flags(char *module, unsigned int flags) -{ - char *lastmod = NULL; - int i; - - if (module) { - printf("%-10s", strtolower(module)); - if (!flags) { - printf("\n"); - return; - } - /* printf(" <%x>", flags); */ - } - - for (i = 0; flagmap[i].module; i++) { - if (module) { - if (strcasecmp(flagmap[i].module, module)) - continue; - } else if (!lastmod || strcmp(lastmod, flagmap[i].module)) { - if (lastmod) - printf("\n"); - printf("%-10s", strtolower(flagmap[i].module)); - lastmod = flagmap[i].module; - } - if (!(flags & flagmap[i].value) - || (module && !strcasecmp(flagmap[i].name, "all"))) - continue; - printf(" %s", strtolower(flagmap[i].name)); - } - printf("\n"); -} - -static void -usage(int excode) -{ - fprintf(stderr, "usage: rpcdebug [-m module] [-cs] flags ...\n"); - if (verbose) { - printf("\nModule Valid flags\n"); - print_flags(NULL, ~(unsigned int) 0); - } - exit (excode); -} - diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c index 89e0f35..0a12519 100644 --- a/tools/rpcdebug/rpcdebug.c +++ b/tools/rpcdebug/rpcdebug.c @@ -148,9 +148,11 @@ static struct flagmap { FLAG(RPC, AUTH), FLAG(RPC, PMAP), FLAG(RPC, SCHED), + FLAG(RPC, TRANS), FLAG(RPC, SVCSOCK), FLAG(RPC, SVCDSP), FLAG(RPC, MISC), + FLAG(RPC, CACHE), FLAG(RPC, ALL), /* nfs */ @@ -162,7 +164,7 @@ static struct flagmap { FLAG(NFS, XDR), FLAG(NFS, FILE), FLAG(NFS, ROOT), - // FLAG(NFS, CALLBACK), + FLAG(NFS, CALLBACK), FLAG(NFS, ALL), /* nfsd */ @@ -187,6 +189,7 @@ static struct flagmap { FLAG(NLM, CLNTSUBS), FLAG(NLM, SVCSUBS), FLAG(NLM, HOSTCACHE), + FLAG(NLM, XDR), FLAG(NLM, ALL), { NULL, NULL, 0 } diff --git a/tools/rpcdebug/rpcdebug.man b/tools/rpcdebug/rpcdebug.man new file mode 100644 index 0000000..e65598a --- /dev/null +++ b/tools/rpcdebug/rpcdebug.man @@ -0,0 +1,88 @@ +.\" +.\" rpcdebug(8) +.\" +.\" By Greg Banks +.\" Copyright (c) 2006 Silicon Graphics, Inc. +.\" Derived from nfsstat.man which bore the message: +.\" Copyright (C) 1996-2005 Olaf Kirch +.TH rpcdebug 8 "5 Jul 2006" +.SH NAME +rpcdebug \- set and clear NFS and RPC kernel debug flags +.SH SYNOPSIS +\fBrpcdebug\fP \fB\-vh\fP +.br +\fBrpcdebug\fP \fB\-m\fP \fImodule\fP +.br +\fBrpcdebug\fP \fB\-m\fP \fImodule\fP \fB\-s\fP \fIflags\fP... +.br +\fBrpcdebug\fP \fB\-m\fP \fImodule\fP \fB\-c\fP \fIflags\fP... +.br +.SH DESCRIPTION +The \fBrpcdebug\fP command allows an administrator to set and clear +the Linux kernel's NFS client and server debug flags. Setting these +flags causes the kernel to emit messages to the system log in response +to NFS activity; this is typically useful when debugging NFS problems. +.PP +The first form in the synopsis can be used to list all available +debug flags. The second form shows the currently set debug flags +for the given module. The third form sets one or more flags, and +the fourth form clears one or more flags. +.PP +The value \fBall\fP may be used to set or clear all the flags for +the given module. +.SH OPTIONS +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.TP +.B \-c +Clear the given debug flags. +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.TP +.B \-h +Print a help message and exit. When combined with the \fB\-v\fP +option, also prints the available debug flags. +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.TP +.BI \-m " module" +Specify which module's flags to set or clear. Available +modules are: +.RS +.TP +.BR nfsd +The NFS server. +.TP +.BR nfs +The NFS client. +.TP +.BR nlm +The Network Lock Manager, in either an NFS client or server. +.TP +.BR rpc +The Remote Procedure Call module, in either an NFS client or server. +.RE +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.TP +.B \-s +Set the given debug flags. +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.TP +.B \-v +Increase the verbosity of \fBrpcdebug\fP's output. +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.SH FILES +.TP +.B /proc/sys/sunrpc/{rpc,nfs,nfsd,nlm}_debug +procfs\-based interface to kernel debug flags. +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.SH SEE ALSO +.BR rpc.nfsd (8), +.BR nfs (5), +.BR syslogd (8). +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.SH BUGS +Bugs can be found or reported at +.BR http://nfs.sf.net/ . +.\" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +.SH AUTHOR +Program by Olaf Kirch and +. +Manpage by Greg Banks . diff --git a/tools/rpcgen/Makefile.in b/tools/rpcgen/Makefile.in index aeaa713..f9b9256 100644 --- a/tools/rpcgen/Makefile.in +++ b/tools/rpcgen/Makefile.in @@ -134,6 +134,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/tools/rpcgen/rpc_clntout.c b/tools/rpcgen/rpc_clntout.c index 3ea267a..0d3179f 100644 --- a/tools/rpcgen/rpc_clntout.c +++ b/tools/rpcgen/rpc_clntout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_cout.c b/tools/rpcgen/rpc_cout.c index af9288d..377ba0b 100644 --- a/tools/rpcgen/rpc_cout.c +++ b/tools/rpcgen/rpc_cout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; #endif @@ -164,8 +164,6 @@ print_header(definition *def) if (Inline == 0) return; - /* May cause lint to complain. but ... */ - f_print(fout, "\t register int32_t *buf;\n\n"); } static void @@ -266,7 +264,8 @@ print_ifstat(int indent, char *prefix, char *type, relation rel, } else { print_ifopen(indent, "array"); } - print_ifarg("(char **)"); + /* The (void*) avoids a gcc-4.1 warning */ + print_ifarg("(char **)(void*)"); if (*objname == '&') { f_print(fout, "%s.%s_val, (u_int *)%s.%s_len", objname, name, objname, name); @@ -390,18 +389,13 @@ emit_struct(definition *def) char *sizestr, *plus; char ptemp[256]; int can_inline; + const char *buf_declaration; if (Inline == 0) { for (dl = def->def.st.decls; dl != NULL; dl = dl->next) print_stat(1, &dl->decl); } else { - - for (dl = def->def.st.decls; dl != NULL; dl = dl->next) - if (dl->decl.rel == REL_VECTOR) { - f_print(fout, "\t int i;\n"); - break; - } size = 0; can_inline = 0; for (dl = def->def.st.decls; dl != NULL; dl = dl->next) @@ -444,6 +438,7 @@ emit_struct(definition *def) i = 0; size = 0; sizestr = NULL; + buf_declaration = "int32_t *"; for (dl = def->def.st.decls; dl != NULL; dl = dl->next) { /* xxx */ /* now walk down the list and check for basic types */ @@ -497,16 +492,17 @@ emit_struct(definition *def) /* were already looking at a xdr_inlineable structure */ if (sizestr == NULL) - f_print(fout, "\t buf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", - size); + f_print(fout, "\t %sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", + buf_declaration, size); else if (size == 0) f_print(fout, - "\t buf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", - sizestr); + "\t %sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", + buf_declaration, sizestr); else f_print(fout, - "\t buf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", - size, sizestr); + "\t %sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", + buf_declaration, size, sizestr); + buf_declaration = ""; f_print(fout, "\n\t if (buf == NULL) {\n"); @@ -546,16 +542,17 @@ emit_struct(definition *def) /* were already looking at a xdr_inlineable structure */ if (sizestr == NULL) - f_print(fout, "\t\tbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", - size); + f_print(fout, "\t\t%sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", + buf_declaration, size); else if (size == 0) f_print(fout, - "\t\tbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", - sizestr); + "\t\t%sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", + buf_declaration, sizestr); else f_print(fout, - "\t\tbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", - size, sizestr); + "\t\t%sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", + buf_declaration, size, sizestr); + buf_declaration = ""; f_print(fout, "\n\t\tif (buf == NULL) {\n"); @@ -632,6 +629,7 @@ emit_inline(declaration *decl, int flag) break; case REL_VECTOR: f_print(fout, "\t\t{ register %s *genp; \n", decl->type); + f_print(fout, "\t\t int i;\n"); f_print(fout, "\t\t for ( i = 0,genp=objp->%s;\n \t\t\ti < %s; i++){\n\t\t", decl->name, decl->array_max); emit_single_in_line(decl, flag, REL_VECTOR); @@ -649,7 +647,7 @@ emit_single_in_line(declaration *decl, int flag, relation rel) int freed=0; if(flag == PUT) - f_print(fout,"\t\t IXDR_PUT_"); + f_print(fout,"\t\t (void) IXDR_PUT_"); else if(rel== REL_ALIAS) f_print(fout,"\t\t objp->%s = IXDR_GET_",decl->name); diff --git a/tools/rpcgen/rpc_hout.c b/tools/rpcgen/rpc_hout.c index 27ed4d5..bbb13eb 100644 --- a/tools/rpcgen/rpc_hout.c +++ b/tools/rpcgen/rpc_hout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_main.c b/tools/rpcgen/rpc_main.c index 2651060..6866f3c 100644 --- a/tools/rpcgen/rpc_main.c +++ b/tools/rpcgen/rpc_main.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_parse.c b/tools/rpcgen/rpc_parse.c index 70d1260..52300a4 100644 --- a/tools/rpcgen/rpc_parse.c +++ b/tools/rpcgen/rpc_parse.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_sample.c b/tools/rpcgen/rpc_sample.c index 97b2cd0..ca12039 100644 --- a/tools/rpcgen/rpc_sample.c +++ b/tools/rpcgen/rpc_sample.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_sample.c 1.1 90/08/30 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_scan.c b/tools/rpcgen/rpc_scan.c index 51eecfe..a6f442c 100644 --- a/tools/rpcgen/rpc_scan.c +++ b/tools/rpcgen/rpc_scan.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_svcout.c b/tools/rpcgen/rpc_svcout.c index fa5fb60..6b33aab 100644 --- a/tools/rpcgen/rpc_svcout.c +++ b/tools/rpcgen/rpc_svcout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI"; #endif diff --git a/tools/rpcgen/rpc_tblout.c b/tools/rpcgen/rpc_tblout.c index 5ce4015..8d0baa5 100644 --- a/tools/rpcgen/rpc_tblout.c +++ b/tools/rpcgen/rpc_tblout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI"; #endif diff --git a/tools/rpcgen/rpc_util.c b/tools/rpcgen/rpc_util.c index 252b181..404966e 100644 --- a/tools/rpcgen/rpc_util.c +++ b/tools/rpcgen/rpc_util.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 */ -#ifndef lint +#if 0 static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI"; #endif diff --git a/utils/Makefile.in b/utils/Makefile.in index 206bf76..16534c5 100644 --- a/utils/Makefile.in +++ b/utils/Makefile.in @@ -124,6 +124,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/exportfs/Makefile.in b/utils/exportfs/Makefile.in index 3f03dc0..fce0d7c 100644 --- a/utils/exportfs/Makefile.in +++ b/utils/exportfs/Makefile.in @@ -140,6 +140,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am index a7dc2dd..7009d8d 100644 --- a/utils/gssd/Makefile.am +++ b/utils/gssd/Makefile.am @@ -38,7 +38,7 @@ gssd_SOURCES = \ write_bytes.h gssd_LDADD = $(RPCSECGSS_LIBS) $(KRBLIBS) -gssd_LDFLAGS = +gssd_LDFLAGS = $(KRBLDFLAGS) gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) @@ -59,13 +59,16 @@ svcgssd_LDADD = \ $(RPCSECGSS_LIBS) -lnfsidmap \ $(KRBLIBS) -svcgssd_LDFLAGS = -Wl,-rpath=$(KRBDIR)/lib +svcgssd_LDFLAGS = $(KRBLDFLAGS) svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) gss_clnt_send_err_SOURCES = gss_clnt_send_err.c +gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ + $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) + MAINTAINERCLEANFILES = Makefile.in ####################################################################### diff --git a/utils/gssd/Makefile.in b/utils/gssd/Makefile.in index 3c425bf..424f7ba 100644 --- a/utils/gssd/Makefile.in +++ b/utils/gssd/Makefile.in @@ -56,7 +56,8 @@ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man8dir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) -am_gss_clnt_send_err_OBJECTS = gss_clnt_send_err.$(OBJEXT) +am_gss_clnt_send_err_OBJECTS = \ + gss_clnt_send_err-gss_clnt_send_err.$(OBJEXT) gss_clnt_send_err_OBJECTS = $(am_gss_clnt_send_err_OBJECTS) gss_clnt_send_err_LDADD = $(LDADD) am__objects_1 = gssd-context.$(OBJEXT) gssd-context_mit.$(OBJEXT) \ @@ -163,6 +164,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -285,7 +287,7 @@ gssd_SOURCES = \ write_bytes.h gssd_LDADD = $(RPCSECGSS_LIBS) $(KRBLIBS) -gssd_LDFLAGS = -Wl,-rpath=$(KRBDIR)/lib +gssd_LDFLAGS = $(KRBLDFLAGS) gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) @@ -305,11 +307,14 @@ svcgssd_LDADD = \ $(RPCSECGSS_LIBS) -lnfsidmap \ $(KRBLIBS) -svcgssd_LDFLAGS = -Wl,-rpath=$(KRBDIR)/lib +svcgssd_LDFLAGS = $(KRBLDFLAGS) svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) gss_clnt_send_err_SOURCES = gss_clnt_send_err.c +gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \ + $(RPCSECGSS_CFLAGS) $(KRBCFLAGS) + MAINTAINERCLEANFILES = Makefile.in all: all-am @@ -407,7 +412,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gss_clnt_send_err.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssd-context.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssd-context_heimdal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gssd-context_mit.Po@am__quote@ @@ -453,6 +458,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +gss_clnt_send_err-gss_clnt_send_err.o: gss_clnt_send_err.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gss_clnt_send_err_CFLAGS) $(CFLAGS) -MT gss_clnt_send_err-gss_clnt_send_err.o -MD -MP -MF "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo" -c -o gss_clnt_send_err-gss_clnt_send_err.o `test -f 'gss_clnt_send_err.c' || echo '$(srcdir)/'`gss_clnt_send_err.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo" "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Po"; else rm -f "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gss_clnt_send_err.c' object='gss_clnt_send_err-gss_clnt_send_err.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gss_clnt_send_err_CFLAGS) $(CFLAGS) -c -o gss_clnt_send_err-gss_clnt_send_err.o `test -f 'gss_clnt_send_err.c' || echo '$(srcdir)/'`gss_clnt_send_err.c + +gss_clnt_send_err-gss_clnt_send_err.obj: gss_clnt_send_err.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gss_clnt_send_err_CFLAGS) $(CFLAGS) -MT gss_clnt_send_err-gss_clnt_send_err.obj -MD -MP -MF "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo" -c -o gss_clnt_send_err-gss_clnt_send_err.obj `if test -f 'gss_clnt_send_err.c'; then $(CYGPATH_W) 'gss_clnt_send_err.c'; else $(CYGPATH_W) '$(srcdir)/gss_clnt_send_err.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo" "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Po"; else rm -f "$(DEPDIR)/gss_clnt_send_err-gss_clnt_send_err.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gss_clnt_send_err.c' object='gss_clnt_send_err-gss_clnt_send_err.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gss_clnt_send_err_CFLAGS) $(CFLAGS) -c -o gss_clnt_send_err-gss_clnt_send_err.obj `if test -f 'gss_clnt_send_err.c'; then $(CYGPATH_W) 'gss_clnt_send_err.c'; else $(CYGPATH_W) '$(srcdir)/gss_clnt_send_err.c'; fi` + gssd-context.o: context.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gssd_CFLAGS) $(CFLAGS) -MT gssd-context.o -MD -MP -MF "$(DEPDIR)/gssd-context.Tpo" -c -o gssd-context.o `test -f 'context.c' || echo '$(srcdir)/'`context.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gssd-context.Tpo" "$(DEPDIR)/gssd-context.Po"; else rm -f "$(DEPDIR)/gssd-context.Tpo"; exit 1; fi diff --git a/utils/gssd/cacheio.c b/utils/gssd/cacheio.c index ac76c06..75c7a5d 100644 --- a/utils/gssd/cacheio.c +++ b/utils/gssd/cacheio.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "err_util.h" void qword_add(char **bpp, int *lp, char *str) @@ -244,6 +245,8 @@ int qword_get_int(char **bpp, int *anint) return 0; } +#define READLINE_BUFFER_INCREMENT 2048 + int readline(int fd, char **buf, int *lenp) { /* read a line into *buf, which is malloced *len long @@ -254,15 +257,16 @@ int readline(int fd, char **buf, int *lenp) int len; if (*lenp == 0) { - char *b = malloc(128); + char *b = malloc(READLINE_BUFFER_INCREMENT); if (b == NULL) return 0; *buf = b; - *lenp = 128; + *lenp = READLINE_BUFFER_INCREMENT; } len = read(fd, *buf, *lenp); if (len <= 0) { - printerr(2, "read error in readline: %d\n", len); + printerr(0, "readline: read error: len %d errno %d (%s)\n", + len, errno, strerror(errno)); return 0; } while ((*buf)[len-1] != '\n') { @@ -271,19 +275,21 @@ int readline(int fd, char **buf, int *lenp) */ char *new; int nl; - *lenp += 128; + *lenp += READLINE_BUFFER_INCREMENT; new = realloc(*buf, *lenp); if (new == NULL) return 0; *buf = new; nl = read(fd, *buf +len, *lenp - len); if (nl <= 0 ) { - printerr(2, "read error in readline: %d\n", nl); + printerr(0, "readline: read error: len %d " + "errno %d (%s)\n", nl, errno, strerror(errno)); return 0; } len += nl; } (*buf)[len-1] = 0; - printerr(1, "read line with %d characters:\n%s\n", *lenp, *buf); + printerr(3, "readline: read %d chars into buffer of size %d:\n%s\n", + len, *lenp, *buf); return 1; } diff --git a/utils/gssd/context_mit.c b/utils/gssd/context_mit.c index 37b8b8e..c0b494b 100644 --- a/utils/gssd/context_mit.c +++ b/utils/gssd/context_mit.c @@ -86,7 +86,7 @@ typedef struct _krb5_gss_ctx_id_rec { uint64_t seq_recv; /* gssint_uint64 */ void *seqstate; krb5_auth_context auth_context; - gss_buffer_desc *mech_used; /* gss_OID_desc */ + gss_OID_desc *mech_used; /* gss_OID_desc */ /* Protocol spec revision 0 => RFC 1964 with 3DES and RC4 enhancements 1 => draft-ietf-krb-wg-gssapi-cfx-01 @@ -123,7 +123,7 @@ typedef struct _krb5_gss_ctx_id_rec { int established; int big_endian; krb5_auth_context auth_context; - gss_buffer_desc *mech_used; + gss_OID_desc *mech_used; int nctypes; krb5_cksumtype *ctypes; } krb5_gss_ctx_id_rec, *krb5_gss_ctx_id_t; @@ -343,7 +343,7 @@ serialize_krb5_ctx(gss_ctx_id_t ctx, gss_buffer_desc *buf) if (WRITE_BYTES(&p, end, kctx->endtime)) goto out_err; word_seq_send = kctx->seq_send; if (WRITE_BYTES(&p, end, word_seq_send)) goto out_err; - if (write_buffer(&p, end, kctx->mech_used)) goto out_err; + if (write_oid(&p, end, kctx->mech_used)) goto out_err; printerr(2, "serialize_krb5_ctx: serializing keys with " "enctype %d and length %d\n", diff --git a/utils/gssd/err_util.c b/utils/gssd/err_util.c index ca9b028..f331432 100644 --- a/utils/gssd/err_util.c +++ b/utils/gssd/err_util.c @@ -38,7 +38,6 @@ static int verbosity = 0; static int fg = 0; static char message_buf[500]; -static char tmp_buf[500]; void initerr(char *progname, int set_verbosity, int set_fg) { @@ -48,45 +47,47 @@ void initerr(char *progname, int set_verbosity, int set_fg) openlog(progname, LOG_PID, LOG_DAEMON); } + void printerr(int priority, char *format, ...) { va_list args; int ret; + int buf_used, buf_available; + char *buf; + + /* Don't bother formatting a message we're never going to print! */ + if (priority > verbosity) + return; + + buf_used = strlen(message_buf); + /* subtract 4 to leave room for "...\n" if necessary */ + buf_available = sizeof(message_buf) - buf_used - 4; + buf = message_buf + buf_used; - /* aggregate lines: only print buffer when we get to the end of a - * line or run out of space: */ + /* + * Aggregate lines: only print buffer when we get to the + * end of a line or run out of space + */ va_start(args, format); - ret = vsnprintf(tmp_buf, sizeof(tmp_buf), format, args); + ret = vsnprintf(buf, buf_available, format, args); va_end(args); - if ((ret < 0) || (ret >= sizeof(tmp_buf))) - goto output; - if (strlen(tmp_buf) + strlen(message_buf) + 1 > sizeof(message_buf)) - goto output; - strcat(message_buf, tmp_buf); - if (tmp_buf[strlen(tmp_buf) - 1] == '\n') - goto output; + + if (ret < 0) + goto printit; + if (ret >= buf_available) { + /* Indicate we're truncating */ + strcat(message_buf, "...\n"); + goto printit; + } + if (message_buf[strlen(message_buf) - 1] == '\n') + goto printit; return; -output: - priority -= verbosity; - if (priority < 0) - priority = 0; +printit: if (fg) { - if (priority == 0) - fprintf(stderr, "%s", message_buf); + fprintf(stderr, "%s", message_buf); } else { - int sys_pri; - switch (priority) { - case 0: - sys_pri = LOG_ERR; - break; - case 1: - sys_pri = LOG_DEBUG; - break; - default: - goto out; - } - syslog(sys_pri, "%s", message_buf); + syslog(LOG_ERR, "%s", message_buf); } -out: + /* reset the buffer */ memset(message_buf, 0, sizeof(message_buf)); } diff --git a/utils/gssd/gss_util.c b/utils/gssd/gss_util.c index f62a87b..d316b4d 100644 --- a/utils/gssd/gss_util.c +++ b/utils/gssd/gss_util.c @@ -224,3 +224,28 @@ gssd_acquire_cred(char *server_name) return (maj_stat == GSS_S_COMPLETE); } + +int gssd_check_mechs(void) +{ + u_int32_t maj_stat, min_stat; + gss_OID_set supported_mechs = GSS_C_NO_OID_SET; + int retval = -1; + + maj_stat = gss_indicate_mechs(&min_stat, &supported_mechs); + if (maj_stat != GSS_S_COMPLETE) { + printerr(0, "Unable to obtain list of supported mechanisms. " + "Check that gss library is properly configured.\n"); + goto out; + } + if (supported_mechs == GSS_C_NO_OID_SET || + supported_mechs->count == 0) { + printerr(0, "Unable to obtain list of supported mechanisms. " + "Check that gss library is properly configured.\n"); + goto out; + } + maj_stat = gss_release_oid_set(&min_stat, &supported_mechs); + retval = 0; +out: + return retval; +} + diff --git a/utils/gssd/gss_util.h b/utils/gssd/gss_util.h index 9e480ac..bfe8c4a 100644 --- a/utils/gssd/gss_util.h +++ b/utils/gssd/gss_util.h @@ -40,5 +40,6 @@ extern gss_cred_id_t gssd_creds; int gssd_acquire_cred(char *server_name); void pgsserr(char *msg, u_int32_t maj_stat, u_int32_t min_stat, const gss_OID mech); +int gssd_check_mechs(void); #endif /* _GSS_UTIL_H_ */ diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c index 8e9c72a..d6ddaae 100644 --- a/utils/gssd/gssd.c +++ b/utils/gssd/gssd.c @@ -145,6 +145,9 @@ main(int argc, char *argv[]) "support setting debug level\n"); #endif + if (gssd_check_mechs() != 0) + errx(1, "Problem with gssapi library"); + if (!fg && daemon(0, 0) < 0) errx(1, "fork"); diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c index 75a04f5..c268497 100644 --- a/utils/gssd/gssd_proc.c +++ b/utils/gssd/gssd_proc.c @@ -493,13 +493,13 @@ int create_auth_rpc_client(struct clnt_info *clp, /* Create the context as the user (not as root) */ save_uid = geteuid(); - if (seteuid(uid) != 0) { - printerr(0, "WARNING: Failed to seteuid for " + if (setfsuid(uid) != 0) { + printerr(0, "WARNING: Failed to setfsuid for " "user with uid %d\n", uid); goto out_fail; } - printerr(2, "creating context using euid %d (save_uid %d)\n", - geteuid(), save_uid); + printerr(2, "creating context using fsuid %d (save_uid %d)\n", + uid, save_uid); sec.qop = GSS_C_QOP_DEFAULT; sec.svc = RPCSEC_GSS_SVC_NONE; @@ -646,9 +646,9 @@ int create_auth_rpc_client(struct clnt_info *clp, gss_release_cred(&min_stat, &sec.cred); if (a != NULL) freeaddrinfo(a); /* Restore euid to original value */ - if ((save_uid != -1) && (seteuid(save_uid) != 0)) { - printerr(0, "WARNING: Failed to restore euid" - " to uid %d\n", save_uid); + if ((save_uid != -1) && (setfsuid(save_uid) != uid)) { + printerr(0, "WARNING: Failed to restore fsuid" + " to uid %d from %d\n", save_uid, uid); } return retval; diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 3030c3f..2f5e70e 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -280,11 +280,16 @@ limit_krb5_enctypes(struct rpc_gss_sec *sec, uid_t uid) { u_int maj_stat, min_stat; gss_cred_id_t credh; + gss_OID_set_desc desired_mechs; krb5_enctype enctypes[] = { ENCTYPE_DES_CBC_CRC }; int num_enctypes = sizeof(enctypes) / sizeof(enctypes[0]); + /* We only care about getting a krb5 cred */ + desired_mechs.count = 1; + desired_mechs.elements = &krb5oid; + maj_stat = gss_acquire_cred(&min_stat, NULL, 0, - GSS_C_NULL_OID_SET, GSS_C_INITIATE, + &desired_mechs, GSS_C_INITIATE, &credh, NULL, NULL); if (maj_stat != GSS_S_COMPLETE) { diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c index 4e0806c..0db3762 100644 --- a/utils/gssd/svcgssd.c +++ b/utils/gssd/svcgssd.c @@ -204,6 +204,11 @@ main(int argc, char *argv[]) "support setting debug level\n"); #endif + if (gssd_check_mechs() != 0) { + printerr(0, "ERROR: Problem with gssapi library\n"); + exit(1); + } + if (!fg) mydaemon(0, 0); diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index 79f5f50..7981399 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -140,7 +140,7 @@ send_response(FILE *f, gss_buffer_desc *in_handle, gss_buffer_desc *in_token, return -1; } *bp = '\0'; - printerr(1, "writing message: %s", buf); + printerr(3, "writing message: %s", buf); if (write(g, buf, bp - buf) == -1) { printerr(0, "WARNING: failed to write message\n"); close(g); @@ -220,21 +220,23 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred) nfs4_init_name_mapping(NULL); /* XXX: should only do this once */ res = nfs4_gss_princ_to_ids(secname, sname, &uid, &gid); if (res < 0) { - printerr(0, "WARNING: get_ids: failed to map name '%s' " - "to uid/gid: %s\n", sname, strerror(-res)); /* * -ENOENT means there was no mapping, any other error * value means there was an error trying to do the * mapping. + * If there was no mapping, we send down the value -1 + * to indicate that the anonuid/anongid for the export + * should be used. */ if (res == -ENOENT) { - cred->cr_uid = 65534; /* XXX */ - cred->cr_gid = 65534; /* XXX */ - cred->cr_groups[0] = 65534;/* XXX */ - cred->cr_ngroups = 1; + cred->cr_uid = -1; + cred->cr_gid = -1; + cred->cr_ngroups = 0; res = 0; goto out_free; } + printerr(0, "WARNING: get_ids: failed to map name '%s' " + "to uid/gid: %s\n", sname, strerror(-res)); goto out_free; } cred->cr_uid = uid; diff --git a/utils/gssd/write_bytes.h b/utils/gssd/write_bytes.h index f166148..8021cd8 100644 --- a/utils/gssd/write_bytes.h +++ b/utils/gssd/write_bytes.h @@ -56,7 +56,7 @@ write_buffer(char **p, char *end, gss_buffer_desc *arg) int len = (int)arg->length; /* make an int out of size_t */ if (WRITE_BYTES(p, end, len)) return -1; - if (*p + arg->length > end) + if (*p + len > end) return -1; memcpy(*p, arg->value, len); *p += len; diff --git a/utils/idmapd/Makefile.in b/utils/idmapd/Makefile.in index 7ad1508..a2f9f89 100644 --- a/utils/idmapd/Makefile.in +++ b/utils/idmapd/Makefile.in @@ -137,6 +137,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 5fc7811..21a1916 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -345,7 +345,9 @@ main(int argc, char **argv) errx(1, "Could not find group \"%s\"", nobodygroup); nobodygid = gr->gr_gid; +#ifdef HAVE_NFS4_SET_DEBUG nfs4_set_debug(verbose, idmapd_warnx); +#endif if (conf_path == NULL) conf_path = _PATH_IDMAPDCONF; if (nfs4_init_name_mapping(conf_path)) @@ -539,7 +541,8 @@ nfsdcb(int fd, short which, void *data) struct idmap_client *ic = data; struct idmap_msg im; u_char buf[IDMAP_MAXMSGSZ + 1]; - size_t len, bsiz; + size_t len; + ssize_t bsiz; char *bp, typebuf[IDMAP_MAXMSGSZ], buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p; unsigned long tmp; @@ -556,7 +559,7 @@ nfsdcb(int fd, short which, void *data) /* Get rid of newline and terminate buffer*/ buf[len - 1] = '\0'; - bp = buf; + bp = (char *)buf; memset(&im, 0, sizeof(im)); @@ -606,7 +609,7 @@ nfsdcb(int fd, short which, void *data) imconv(ic, &im); buf[0] = '\0'; - bp = buf; + bp = (char *)buf; bsiz = sizeof(buf); /* Authentication name */ diff --git a/utils/lockd/Makefile.in b/utils/lockd/Makefile.in index 41c4558..aaf252f 100644 --- a/utils/lockd/Makefile.in +++ b/utils/lockd/Makefile.in @@ -135,6 +135,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/mount/Makefile.in b/utils/mount/Makefile.in index 17b1de4..9b327c2 100644 --- a/utils/mount/Makefile.in +++ b/utils/mount/Makefile.in @@ -136,6 +136,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/mountd/Makefile.in b/utils/mountd/Makefile.in index e96f8ea..922cf89 100644 --- a/utils/mountd/Makefile.in +++ b/utils/mountd/Makefile.in @@ -141,6 +141,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 5285e10..c57d3b0 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -429,7 +429,7 @@ cache_get_filehandle(nfs_export *exp, int len, char *p) if (failed) return NULL; memset(fh.fh_handle, 0, sizeof(fh.fh_handle)); - fh.fh_size = qword_get(&bp, fh.fh_handle, NFS3_FHSIZE); + fh.fh_size = qword_get(&bp, (char *)fh.fh_handle, NFS3_FHSIZE); return &fh; } diff --git a/utils/mountd/mount_xdr.c b/utils/mountd/mount_xdr.c deleted file mode 100644 index a0fefcb..0000000 --- a/utils/mountd/mount_xdr.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * mount_xdr XDR procedures for mountd. - * - * Originally generated by rpcgen; edited to get rid of warnings. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -inline bool_t -xdr_fhandle(XDR *xdrs, fhandle objp) -{ - return xdr_opaque(xdrs, objp, FHSIZE); -} - -bool_t -xdr_fhstatus(XDR *xdrs, fhstatus *objp) -{ - return xdr_u_int(xdrs, &objp->fhs_status) && - (objp->fhs_status != 0 || - xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)); -} - -bool_t -xdr_dirpath(XDR *xdrs, dirpath *objp) -{ - return xdr_string(xdrs, objp, MNTPATHLEN); -} - -inline bool_t -xdr_name(XDR *xdrs, name *objp) -{ - return xdr_string(xdrs, objp, MNTPATHLEN); -} - -bool_t -xdr_mountlist(XDR *xdrs, mountlist *objp) -{ - return xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), - (xdrproc_t)xdr_mountbody); -} - -bool_t -xdr_mountbody(XDR *xdrs, mountbody *objp) -{ - return xdr_name(xdrs, &objp->ml_hostname) && - xdr_dirpath(xdrs, &objp->ml_directory) && - xdr_mountlist(xdrs, &objp->ml_next); -} - -bool_t -xdr_groups(XDR *xdrs, groups *objp) -{ - return xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), - (xdrproc_t)xdr_groupnode); -} - -bool_t -xdr_groupnode(XDR *xdrs, groupnode *objp) -{ - return xdr_name(xdrs, &objp->gr_name) && - xdr_groups(xdrs, &objp->gr_next); -} - -bool_t -xdr_exports(XDR *xdrs, exports *objp) -{ - return xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), - (xdrproc_t)xdr_exportnode); -} - -bool_t -xdr_exportnode(XDR *xdrs, exportnode *objp) -{ - return xdr_dirpath(xdrs, &objp->ex_dir) && - xdr_groups(xdrs, &objp->ex_groups) && - xdr_exports(xdrs, &objp->ex_next); -} diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index e402bf8..c1d18d4 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -35,7 +35,7 @@ extern void my_svc_run(void); static void usage(const char *, int exitcode); static exports get_exportlist(void); -static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, int *, int v3); +static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, mountstat3 *, int v3); int new_cache = 0; @@ -346,11 +346,11 @@ mount_mnt_3_svc(struct svc_req *rqstp, dirpath *path, mountres3 *res) struct nfs_fh_len *fh; xlog(D_CALL, "MNT3(%s) called", *path); - if ((fh = get_rootfh(rqstp, path, (int *) &res->fhs_status, 1)) != NULL) { + if ((fh = get_rootfh(rqstp, path, &res->fhs_status, 1)) != NULL) { struct mountres3_ok *ok = &res->mountres3_u.mountinfo; ok->fhandle.fhandle3_len = fh->fh_size; - ok->fhandle.fhandle3_val = fh->fh_handle; + ok->fhandle.fhandle3_val = (char *)fh->fh_handle; ok->auth_flavors.auth_flavors_len = sizeof(flavors)/sizeof(flavors[0]); ok->auth_flavors.auth_flavors_val = flavors; @@ -359,7 +359,7 @@ mount_mnt_3_svc(struct svc_req *rqstp, dirpath *path, mountres3 *res) } static struct nfs_fh_len * -get_rootfh(struct svc_req *rqstp, dirpath *path, int *error, int v3) +get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3) { struct sockaddr_in *sin = (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt); diff --git a/utils/nfsd/Makefile.in b/utils/nfsd/Makefile.in index e633395..cd175a5 100644 --- a/utils/nfsd/Makefile.in +++ b/utils/nfsd/Makefile.in @@ -135,6 +135,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/nfsstat/Makefile.in b/utils/nfsstat/Makefile.in index 039be6b..6d228ef 100644 --- a/utils/nfsstat/Makefile.in +++ b/utils/nfsstat/Makefile.in @@ -135,6 +135,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c index 4b45c46..436d407 100644 --- a/utils/nfsstat/nfsstat.c +++ b/utils/nfsstat/nfsstat.c @@ -29,6 +29,7 @@ static unsigned int svcv3info[24]; /* NFSv3 call counts ([0] == 22) */ static unsigned int cltv3info[24]; /* NFSv3 call counts ([0] == 22) */ static unsigned int svcv4info[4]; /* NFSv4 call counts ([0] == 2) */ static unsigned int cltv4info[34]; /* NFSv4 call counts ([0] == 32) */ +static unsigned int svcv4opinfo[42];/* NFSv4 call counts ([0] == 40) */ static unsigned int svcnetinfo[5]; /* 0 # of received packets * 1 UDP packets * 2 TCP packets @@ -99,6 +100,16 @@ static const char * nfscltv4name[32] = { "statfs", "readlink", "readdir", "server_caps", "delegreturn", }; +static const char * nfssvrv4opname[40] = { + "op0-unused", "op1-unused", "op2-future", "access", "close", "commit", + "create", "delegpurge", "delegreturn", "getattr", "getfh", "link", + "lock", "lockt", "locku", "lookup", "lookup_root", "nverify", + "open", "openattr", "open_conf", "open_dgrd", "putfh", "putpubfh", + "putrootfh", "read", "readdir", "readlink", "remove", "rename", + "renew", "restorefh", "savefh", "secinfo", "setattr", "setcltid", + "setcltidconf", "verify", "write", "rellockowner" +}; + typedef struct statinfo { char *tag; int nrvals; @@ -115,6 +126,7 @@ static statinfo svcinfo[] = { { "proc2", STRUCTSIZE(svcv2info), svcv2info }, { "proc3", STRUCTSIZE(svcv3info), svcv3info }, { "proc4", STRUCTSIZE(svcv4info), svcv4info }, + { "proc4ops", STRUCTSIZE(svcv4opinfo),svcv4opinfo}, { NULL, 0, NULL } }; @@ -381,11 +393,16 @@ main(int argc, char **argv) "Server nfs v3:\n", nfsv3name, svcv3info + 1, sizeof(nfsv3name)/sizeof(char *) ); - if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && svcv4info[0] && svcv4info[svcv4info[0]+1] != svcv4info[0])) + if ((opt_prt & PRNT_V4) || ((opt_prt & PRNT_AUTO) && svcv4info[0] && svcv4info[svcv4info[0]+1] != svcv4info[0])) { print_callstats( "Server nfs v4:\n", nfssvrv4name, svcv4info + 1, sizeof(nfssvrv4name)/sizeof(char *) ); + print_callstats( + "Server nfs v4 operations:\n", + nfssvrv4opname, svcv4opinfo + 1, sizeof(nfssvrv4opname)/sizeof(char *) + ); + } } } diff --git a/utils/nhfsstone/Makefile.in b/utils/nhfsstone/Makefile.in index e37f619..195f1ac 100644 --- a/utils/nhfsstone/Makefile.in +++ b/utils/nhfsstone/Makefile.in @@ -140,6 +140,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/nhfsstone/nhfsstone.c b/utils/nhfsstone/nhfsstone.c index 034ba79..463bcb5 100644 --- a/utils/nhfsstone/nhfsstone.c +++ b/utils/nhfsstone/nhfsstone.c @@ -1,4 +1,4 @@ -#ifndef lint +#if 0 static char sccsid[] = "@(#)nhfsstone.c 1.22 90/05/08 Copyright (c) 1990, Legato Systems Inc"; #endif @@ -10,6 +10,7 @@ static char sccsid[] = "@(#)nhfsstone.c 1.22 90/05/08 Copyright (c) 1990, Legato * Ported to Linux by Olaf Kirch */ +#include "config.h" #include #include #include @@ -312,7 +313,11 @@ main(int argc, char **argv) int pid; /* process id */ int delay; /* msecs since last checked current time */ int randnum; /* a random number */ +#if HAVE_SIGPROCMASK + sigset_t oldmask; /* saved signal mask */ +#else int oldmask; /* saved signal mask */ +#endif int sampletime; /* secs between reading kernel stats */ char *opts; /* option parsing */ int pct; @@ -478,7 +483,20 @@ main(int argc, char **argv) (void) signal(SIGINT, cleanup); (void) signal(SIGUSR1, startup); +#if HAVE_SIGPROCMASK + { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigprocmask(SIG_BLOCK, &mask, &oldmask); + } +#else + /* + * sigblock() is marked deprecated in modern + * glibc and hence generates a warning. + */ oldmask = sigblock(sigmask(SIGUSR1)); +#endif if (ncalls == 0) { if (runtime == 0) { @@ -630,7 +648,11 @@ main(int argc, char **argv) exit(1); } +#if HAVE_SIGPROCMASK + sigsuspend(&oldmask); +#else sigpause(oldmask); +#endif /* * Initialize counters diff --git a/utils/rquotad/Makefile.am b/utils/rquotad/Makefile.am index b478fad..3a45464 100644 --- a/utils/rquotad/Makefile.am +++ b/utils/rquotad/Makefile.am @@ -1,5 +1,13 @@ ## Process this file with automake to produce Makefile.in +RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen + +GENFILES_XDR = rquota_xdr.c +GENFILES_H = rquota.h + +BUILT_SOURCES = $(GENFILES_H) + +GENFILES = $(GENFILES_XDR) $(GENFILES_H) man8_MANS = rquotad.man RPCPREFIX = rpc. @@ -9,7 +17,7 @@ sbin_PROGRAMS = rquotad EXTRA_DIST = rquota.x $(man8_MANS) NEW README.okir rquotad_SOURCES = rquota_server.c rquota_svc.c rquota_xdr.c quotactl.c \ - hasquota.c mntent.h pathnames.h rquota.h + hasquota.c mntent.h rquota.h rquotad_LDADD = ../../support/export/libexport.a \ ../../support/nfs/libnfs.a \ ../../support/misc/libmisc.a \ @@ -19,6 +27,19 @@ rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \ MAINTAINERCLEANFILES = Makefile.in + +$(RPCGEN): + make -C $(top_srcdir)/tools/rpcgen all + +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) + test -f $@ && rm -rf $@ || true + $(RPCGEN) -c -o $@ $< + + +$(GENFILES_H): %.h: %.x $(RPCGEN) + test -f $@ && rm -rf $@ || true + $(RPCGEN) -h -o $@ $< + ####################################################################### # The following allows the current practice of having # daemons renamed during the install to include RPCPREFIX diff --git a/utils/rquotad/Makefile.in b/utils/rquotad/Makefile.in index 0e48ce5..4d77618 100644 --- a/utils/rquotad/Makefile.in +++ b/utils/rquotad/Makefile.in @@ -140,6 +140,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -227,12 +228,17 @@ statduser = @statduser@ statedir = @statedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen +GENFILES_XDR = rquota_xdr.c +GENFILES_H = rquota.h +BUILT_SOURCES = $(GENFILES_H) +GENFILES = $(GENFILES_XDR) $(GENFILES_H) man8_MANS = rquotad.man RPCPREFIX = rpc. KPREFIX = @kprefix@ EXTRA_DIST = rquota.x $(man8_MANS) NEW README.okir rquotad_SOURCES = rquota_server.c rquota_svc.c rquota_xdr.c quotactl.c \ - hasquota.c mntent.h pathnames.h rquota.h + hasquota.c mntent.h rquota.h rquotad_LDADD = ../../support/export/libexport.a \ ../../support/nfs/libnfs.a \ @@ -243,7 +249,8 @@ rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \ -I$(top_srcdir)/support/export MAINTAINERCLEANFILES = Makefile.in -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -542,13 +549,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -572,6 +581,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am @@ -640,6 +650,17 @@ uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS uninstall-man uninstall-man8 uninstall-sbinPROGRAMS +$(RPCGEN): + make -C $(top_srcdir)/tools/rpcgen all + +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) + test -f $@ && rm -rf $@ || true + $(RPCGEN) -c -o $@ $< + +$(GENFILES_H): %.h: %.x $(RPCGEN) + test -f $@ && rm -rf $@ || true + $(RPCGEN) -h -o $@ $< + ####################################################################### # The following allows the current practice of having # daemons renamed during the install to include RPCPREFIX diff --git a/utils/rquotad/pathnames.h b/utils/rquotad/pathnames.h deleted file mode 100644 index 6604a18..0000000 --- a/utils/rquotad/pathnames.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @@(#)pathnames.h 5.3 (Berkeley) 6/1/90 - */ - -#include - -#undef _PATH_TMP -#define _PATH_TMP "/tmp/EdP.aXXXXXX" diff --git a/utils/rquotad/rquota.h b/utils/rquotad/rquota.h deleted file mode 100644 index f81e732..0000000 --- a/utils/rquotad/rquota.h +++ /dev/null @@ -1,64 +0,0 @@ -#define RQ_PATHLEN 1024 - -struct getquota_args { - char *gqa_pathp; - int gqa_uid; -}; -typedef struct getquota_args getquota_args; -bool_t xdr_getquota_args(); - - -struct ext_getquota_args { - char *gqa_pathp; - int gqa_type; - int gqa_id; -}; -typedef struct ext_getquota_args ext_getquota_args; -bool_t xdr_ext_getquota_args(); - - -struct rquota { - int rq_bsize; - bool_t rq_active; - u_int rq_bhardlimit; - u_int rq_bsoftlimit; - u_int rq_curblocks; - u_int rq_fhardlimit; - u_int rq_fsoftlimit; - u_int rq_curfiles; - u_int rq_btimeleft; - u_int rq_ftimeleft; -}; -typedef struct rquota rquota; -bool_t xdr_rquota(); - - -enum gqr_status { - Q_OK = 1, - Q_NOQUOTA = 2, - Q_EPERM = 3, -}; -typedef enum gqr_status gqr_status; -bool_t xdr_gqr_status(); - - -struct getquota_rslt { - gqr_status status; - union { - rquota gqr_rquota; - } getquota_rslt_u; -}; -typedef struct getquota_rslt getquota_rslt; -bool_t xdr_getquota_rslt(); - - -#define RQUOTAPROG ((u_long)100011) -#define RQUOTAVERS ((u_long)1) -#define RQUOTAPROC_GETQUOTA ((u_long)1) -extern getquota_rslt *rquotaproc_getquota_1(); -#define RQUOTAPROC_GETACTIVEQUOTA ((u_long)2) -extern getquota_rslt *rquotaproc_getactivequota_1(); -#define EXT_RQUOTAVERS ((u_long)2) -extern getquota_rslt *rquotaproc_getquota_2(); -extern getquota_rslt *rquotaproc_getactivequota_2(); - diff --git a/utils/rquotad/rquota_server.c b/utils/rquotad/rquota_server.c index e3715bd..f8bd8f1 100644 --- a/utils/rquotad/rquota_server.c +++ b/utils/rquotad/rquota_server.c @@ -262,22 +262,22 @@ getquota_rslt *getquotainfo(int flags, caddr_t *argp, struct svc_req *rqstp) return(&result); } -getquota_rslt *rquotaproc_getquota_1(getquota_args *argp, struct svc_req *rqstp) +getquota_rslt *rquotaproc_getquota_1_svc(getquota_args *argp, struct svc_req *rqstp) { return(getquotainfo(0, (caddr_t *)argp, rqstp)); } -getquota_rslt *rquotaproc_getactivequota_1(getquota_args *argp, struct svc_req *rqstp) +getquota_rslt *rquotaproc_getactivequota_1_svc(getquota_args *argp, struct svc_req *rqstp) { return(getquotainfo(ACTIVE, (caddr_t *)argp, rqstp)); } -getquota_rslt *rquotaproc_getquota_2(ext_getquota_args *argp, struct svc_req *rqstp) +getquota_rslt *rquotaproc_getquota_2_svc(ext_getquota_args *argp, struct svc_req *rqstp) { return(getquotainfo(TYPE_EXTENDED, (caddr_t *)argp, rqstp)); } -getquota_rslt *rquotaproc_getactivequota_2(ext_getquota_args *argp, struct svc_req *rqstp) +getquota_rslt *rquotaproc_getactivequota_2_svc(ext_getquota_args *argp, struct svc_req *rqstp) { return(getquotainfo(TYPE_EXTENDED | ACTIVE, (caddr_t *)argp, rqstp)); } diff --git a/utils/rquotad/rquota_svc.c b/utils/rquotad/rquota_svc.c index 0785551..bd2038f 100644 --- a/utils/rquotad/rquota_svc.c +++ b/utils/rquotad/rquota_svc.c @@ -47,15 +47,6 @@ #define SIG_PF void(*)(int) #endif -extern getquota_rslt *rquotaproc_getquota_1(getquota_args *argp, - struct svc_req *rqstp); -extern getquota_rslt *rquotaproc_getactivequota_1(getquota_args *argp, - struct svc_req *rqstp); -extern getquota_rslt *rquotaproc_getquota_2(ext_getquota_args *argp, - struct svc_req *rqstp); -extern getquota_rslt *rquotaproc_getactivequota_2(ext_getquota_args *argp, - struct svc_req *rqstp); - static struct option longopts[] = { { "help", 0, 0, 'h' }, @@ -113,13 +104,13 @@ static void rquotaprog_1(struct svc_req *rqstp, register SVCXPRT *transp) case RQUOTAPROC_GETQUOTA: xdr_argument = (xdrproc_t) xdr_getquota_args; xdr_result = (xdrproc_t) xdr_getquota_rslt; - local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_1; + local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_1_svc; break; case RQUOTAPROC_GETACTIVEQUOTA: xdr_argument = (xdrproc_t) xdr_getquota_args; xdr_result = (xdrproc_t) xdr_getquota_rslt; - local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_1; + local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_1_svc; break; default: @@ -188,13 +179,13 @@ static void rquotaprog_2(struct svc_req *rqstp, register SVCXPRT *transp) case RQUOTAPROC_GETQUOTA: xdr_argument = (xdrproc_t) xdr_ext_getquota_args; xdr_result = (xdrproc_t) xdr_getquota_rslt; - local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_2; + local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_2_svc; break; case RQUOTAPROC_GETACTIVEQUOTA: xdr_argument = (xdrproc_t) xdr_ext_getquota_args; xdr_result = (xdrproc_t) xdr_getquota_rslt; - local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_2; + local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_2_svc; break; default: diff --git a/utils/rquotad/rquota_xdr.c b/utils/rquotad/rquota_xdr.c deleted file mode 100644 index 46eb1e1..0000000 --- a/utils/rquotad/rquota_xdr.c +++ /dev/null @@ -1,125 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "rquota.h" - - -bool_t -xdr_getquota_args(xdrs, objp) - XDR *xdrs; - getquota_args *objp; -{ - if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->gqa_uid)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_ext_getquota_args(xdrs, objp) - XDR *xdrs; - ext_getquota_args *objp; -{ - if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->gqa_type)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->gqa_id)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_rquota(xdrs, objp) - XDR *xdrs; - rquota *objp; -{ - if (!xdr_int(xdrs, &objp->rq_bsize)) { - return (FALSE); - } - if (!xdr_bool(xdrs, &objp->rq_active)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_curblocks)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_curfiles)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_gqr_status(xdrs, objp) - XDR *xdrs; - gqr_status *objp; -{ - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_getquota_rslt(xdrs, objp) - XDR *xdrs; - getquota_rslt *objp; -{ - if (!xdr_gqr_status(xdrs, &objp->status)) { - return (FALSE); - } - switch (objp->status) { - case Q_OK: - if (!xdr_rquota(xdrs, &objp->getquota_rslt_u.gqr_rquota)) { - return (FALSE); - } - break; - case Q_NOQUOTA: - break; - case Q_EPERM: - break; - default: - return (FALSE); - } - return (TRUE); -} - - diff --git a/utils/showmount/Makefile.in b/utils/showmount/Makefile.in index cd33176..bd6b537 100644 --- a/utils/showmount/Makefile.in +++ b/utils/showmount/Makefile.in @@ -135,6 +135,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/statd/Makefile.in b/utils/statd/Makefile.in index 49aa4eb..ed08f38 100644 --- a/utils/statd/Makefile.in +++ b/utils/statd/Makefile.in @@ -141,6 +141,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ K5VERS = @K5VERS@ KRBCFLAGS = @KRBCFLAGS@ KRBDIR = @KRBDIR@ +KRBLDFLAGS = @KRBLDFLAGS@ KRBLIBS = @KRBLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ diff --git a/utils/statd/log.c b/utils/statd/log.c index 408807e..bf2a926 100644 --- a/utils/statd/log.c +++ b/utils/statd/log.c @@ -29,7 +29,9 @@ static pid_t mypid; /* Turns on logging to console/stderr. */ +#if 0 static int opt_debug = 0; /* Will be command-line option, eventually */ +#endif void log_init() { diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c index 8348473..98cbf4a 100644 --- a/utils/statd/monitor.c +++ b/utils/statd/monitor.c @@ -268,7 +268,9 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp) clnt = NL_NEXT(clnt); } +#ifdef RESTRICTED_STATD failure: +#endif note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s", my_name, mon_name); return (&result); @@ -336,6 +338,8 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp) dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no " "SM_MON requests from it.", my_name); } +#ifdef RESTRICTED_STATD failure: +#endif return (&result); } diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index 7684b3b..35cbccb 100644 --- a/utils/statd/rmtcall.c +++ b/utils/statd/rmtcall.c @@ -46,6 +46,10 @@ #include "log.h" #include "ha-callout.h" +#if SIZEOF_SOCKLEN_T - 0 == 0 +#define socklen_t int +#endif + #define MAXMSGSIZE (2048 / sizeof(unsigned int)) static unsigned long xid = 0; /* RPC XID counter */ @@ -278,7 +282,7 @@ recv_rply(int sockfd, struct sockaddr_in *sin, u_long *portp) struct rpc_msg mesg; notify_list *lp = NULL; XDR xdr, *xdrs = &xdr; - int alen = sizeof(*sin); + socklen_t alen = sizeof(*sin); /* Receive message */ if ((msglen = recvfrom(sockfd, msgbuf, sizeof(msgbuf), 0, diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 8ebb808..c92e12f 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -51,7 +51,7 @@ int run_mode = 0; /* foreground logging mode */ * two copies of each - one in main(), one static in log.c... * It also eliminates the 256-char static in log.c */ char *name_p = NULL; -char *version_p = NULL; +const char *version_p = NULL; /* PRC: a high-availability callout program can be specified with -H * When this is done, the program will receive callouts whenever clients @@ -374,7 +374,7 @@ int main (int argc, char **argv) #endif if (!(run_mode & MODE_NODAEMON)) { - int filedes, fdmax, tempfd; + int tempfd; if (pipe(pipefds)<0) { perror("statd: unable to create pipe"); diff --git a/utils/statd/statd.h b/utils/statd/statd.h index 225cc8b..ace2ce5 100644 --- a/utils/statd/statd.h +++ b/utils/statd/statd.h @@ -88,6 +88,6 @@ extern int run_mode; * as to why they're global. */ extern char *name_p; /* program basename */ -extern char *version_p; /* program version */ +extern const char *version_p; /* program version */ extern int re_notify; /* time to re-read notify list */ diff --git a/utils/statd/state.c b/utils/statd/state.c index a6a4077..f46dae5 100644 --- a/utils/statd/state.c +++ b/utils/statd/state.c @@ -28,7 +28,6 @@ void change_state (void) { int fd, size; - extern short int restart; if ((fd = open (SM_STAT_PATH, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) == -1) die ("open (%s): %s", SM_STAT_PATH, strerror (errno));