dnl
AC_DEFUN([AC_LIBRPCSECGSS], [
- dnl Check for library, but do not add -lrpcsecgss to LIBS
- AC_CHECK_LIB([rpcsecgss], [authgss_create_default], [librpcsecgss=1],
- [AC_MSG_ERROR([librpcsecgss not found.])])
+ dnl libtirpc provides an rpcsecgss API
+ if test "$enable_tirpc" = no; then
- AC_CHECK_LIB([rpcsecgss], [authgss_set_debug_level],
- [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
- [Define to 1 if you have the `authgss_set_debug_level' function.])])
+ dnl Check for library, but do not add -lrpcsecgss to LIBS
+ AC_CHECK_LIB([rpcsecgss], [authgss_create_default], [librpcsecgss=1],
+ [AC_MSG_ERROR([librpcsecgss not found.])])
+
+ AC_CHECK_LIB([rpcsecgss], [authgss_set_debug_level],
+ [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
+ [Define to 1 if you have the `authgss_set_debug_level' function.])])
+
+ fi
])dnl
dnl
AC_DEFUN([AC_LIBTIRPC], [
+ AC_ARG_WITH([tirpcinclude],
+ [AC_HELP_STRING([--with-tirpcinclude=DIR],
+ [use TI-RPC headers in DIR])],
+ [tirpc_header_dir=$withval],
+ [tirpc_header_dir=/usr/include/tirpc])
+
dnl if --enable-tirpc was specifed, the following components
dnl must be present, and we set up HAVE_ macros for them.
[AC_MSG_ERROR([libtirpc not found.])])
dnl also must have the headers installed where we expect
- AC_CHECK_HEADERS([tirpc/netconfig.h], ,
+ dnl look for headers; add -I compiler option if found
+ AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h], ,
[AC_MSG_ERROR([libtirpc headers not found.])])
+ AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])
fi
dnl Checks librpcsec version
AC_DEFUN([AC_RPCSEC_VERSION], [
- PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.16], ,
- [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss. If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])
+ dnl TI-RPC replaces librpcsecgss
+ if test "$enable_tirpc" = no; then
+ PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.16], ,
+ [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss. If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])
+ fi
PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
#include <rpc/pmap_prot.h>
#ifdef HAVE_LIBTIRPC
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpcb_prot.h>
+#include <netconfig.h>
+#include <rpc/rpcb_prot.h>
#endif
#include "nfsrpc.h"
#include "nfsrpc.h"
#ifdef HAVE_LIBTIRPC
-
-/*
- * Most of the headers under /usr/include/tirpc are currently
- * unusable for various reasons. We statically define the bits
- * we need here until the official headers are fixed.
- *
- * The commonly used RPC calls such as CLNT_CALL and CLNT_DESTROY
- * are actually virtual functions in both the legacy and TI-RPC
- * implementations. The proper _CALL or _DESTROY will be invoked
- * no matter if we used a legacy clnt_create() or clnt_tli_create()
- * from libtirpc.
- */
-
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpcb_prot.h>
-
-/* definitions from tirpc/rpc/types.h */
-
-/*
- * The netbuf structure is used for transport-independent address storage.
- */
-struct netbuf {
- unsigned int maxlen;
- unsigned int len;
- void *buf;
-};
-
-/* definitions from tirpc/rpc/clnt.h */
-
-/*
- * Low level clnt create routine for connectionless transports, e.g. udp.
- */
-extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
- const rpcprog_t, const rpcvers_t,
- const u_int, const u_int);
-
-/*
- * Low level clnt create routine for connectionful transports, e.g. tcp.
- */
-extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
- const rpcprog_t, const rpcvers_t,
- u_int, u_int);
-
+#include <netconfig.h>
+#include <rpc/rpcb_prot.h>
#endif /* HAVE_LIBTIRPC */
/*
#include "gssd.h"
#include "err_util.h"
#include "gss_util.h"
-#include "gss_oids.h"
#include "krb5_util.h"
#include "context.h"
out:
if (token.value)
free(token.value);
+#ifndef HAVE_LIBTIRPC
if (pd.pd_ctx_hndl.length != 0)
authgss_free_private_data(&pd);
+#endif
if (auth)
AUTH_DESTROY(auth);
if (rpc_clnt)
#include "gssd.h"
#include "err_util.h"
#include "gss_util.h"
-#include "gss_oids.h"
#include "krb5_util.h"
/* Global list of principals/cache file names for machine credentials */
#include <krb5.h>
+#ifdef HAVE_LIBTIRPC
+#include <rpc/auth_gss.h>
+#else
+#include "gss_oids.h"
+#endif
+
/*
* List of principals from our keytab that we
* will try to use to obtain credentials
#include <errno.h>
#include <time.h>
+#ifdef HAVE_LIBTIRPC
+#include <rpc/rpc_com.h>
+#endif
+
void cache_set_fds(fd_set *fdset);
int cache_process_req(fd_set *readfds);