* [PATCH 0/9] Address type width mismatches between TI-RPC and glibc
@ 2009-03-05 17:41 Chuck Lever
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:41 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Steve-
Now that the clean up is finished, here are the patches that actually
fix the type width mismatch problem between glibc headers and the
TI-RPC run-time.
This patch set implements a full switch between TI-RPC run-time and
headers and legacy glibc RPC run-time and headers via --enable-tirpc.
In addition there are a number of configure.ac clean ups.
These are the final patches needed to support TI-RPC and IPv6 properly
in mount.nfs, umount.nfs, and showmount.
---
Chuck Lever (7):
nfs-utils: Include legacy or TI-RPC headers, not both
configure: move IPv6 feature checks into aclocal/
configure: Move rpcsecgss checking into aclocal
configure: pull common nfsidmap and event checks into aclocal/
nfs-utils: replace function-specific switches with HAVE_LIBTIRPC
configure: move TI-RPC checks into aclocal/
configure: add defensive quoting in some function checks
Jeff Layton (2):
nfs-utils: clean up handling of libgssglue in gssd Makefile
nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss
Makefile.am | 7 +++
aclocal/ipv6.m4 | 29 ++++++++++++
aclocal/libevent.m4 | 11 +++++
aclocal/libnfsidmap.m4 | 17 +++++++
aclocal/librpcsecgss.m4 | 19 ++++++++
aclocal/libtirpc.m4 | 28 ++++++++++++
aclocal/rpcsec_vers.m4 | 12 +++++
configure.ac | 107 +++++++++++++++++-----------------------------
support/nfs/getport.c | 40 +++++++++--------
support/nfs/rpc_socket.c | 95 ++++++++++++-----------------------------
utils/gssd/Makefile.am | 10 ++--
utils/gssd/gssd_proc.c | 3 +
utils/gssd/krb5_util.c | 1
utils/gssd/krb5_util.h | 6 +++
utils/mountd/svc_run.c | 4 ++
15 files changed, 226 insertions(+), 163 deletions(-)
create mode 100644 aclocal/ipv6.m4
create mode 100644 aclocal/libevent.m4
create mode 100644 aclocal/libnfsidmap.m4
create mode 100644 aclocal/librpcsecgss.m4
create mode 100644 aclocal/libtirpc.m4
create mode 100644 aclocal/rpcsec_vers.m4
--
Chuck Lever
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/9] configure: add defensive quoting in some function checks
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
@ 2009-03-05 17:41 ` Chuck Lever
2009-03-05 17:41 ` [PATCH 2/9] configure: move TI-RPC checks into aclocal/ Chuck Lever
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:41 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Clean up: Add proper m4 quoting in macros that check for the presence
of some functions in configure.ac.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
configure.ac | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5db4417..97b084b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,23 +176,26 @@ AC_BSD_SIGNALS
dnl *************************************************************
dnl * Check for required libraries
dnl *************************************************************
-AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"])])
+
+AC_CHECK_FUNC([gethostbyname], ,
+ [AC_CHECK_LIB([nsl], [gethostbyname], [LIBNSL="-lnsl"])])
AC_SUBST(LIBNSL)
-AC_CHECK_FUNC(connect, ,
- AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"],
- AC_MSG_ERROR(Function 'socket' not found.), $LIBNSL))
+AC_CHECK_FUNC([connect], ,
+ [AC_CHECK_LIB([socket], [connect], [LIBSOCKET="-lsocket"],
+ [AC_MSG_ERROR([Function 'socket' not found.])], [$LIBNSL])])
+
+AC_CHECK_FUNC([getaddrinfo], , ,
+ [AC_MSG_ERROR([Function 'getaddrinfo' not found.])])
-AC_CHECK_FUNC(getaddrinfo, , ,
- AC_MSG_ERROR(Function 'getaddrinfo' not found.))
+AC_CHECK_FUNC([getrpcbynumber], , ,
+ [AC_MSG_ERROR([Function 'getrpcbynumber' not found.])])
-AC_CHECK_FUNC(getrpcbynumber, , ,
- AC_MSG_ERROR(Function 'getrpcbynumber' not found.))
+AC_CHECK_FUNC([getservbyname], , ,
+ [AC_MSG_ERROR([Function 'getservbyname' not found.])])
-AC_CHECK_FUNC(getservbyname, , ,
- AC_MSG_ERROR(Function 'getservbyname' not found.))
+AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
-AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
if test "$enable_nfsv4" = yes; then
AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/9] configure: move TI-RPC checks into aclocal/
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-05 17:41 ` [PATCH 1/9] configure: add defensive quoting in some function checks Chuck Lever
@ 2009-03-05 17:41 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 3/9] nfs-utils: replace function-specific switches with HAVE_LIBTIRPC Chuck Lever
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:41 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Define an aclocal test for TI-RPC headers and library, and move the
TI-RPC checks earlier in our configure script so other feature checks
can use the availability of TI-RPC to decide what to do.
Since bindresvport_sa is required just for IPv6 support, move that
check to the IPv6 feature tests.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile.am | 3 ++-
aclocal/libtirpc.m4 | 25 +++++++++++++++++++++++++
configure.ac | 28 +++++++++-------------------
3 files changed, 36 insertions(+), 20 deletions(-)
create mode 100644 aclocal/libtirpc.m4
diff --git a/Makefile.am b/Makefile.am
index 88ae210..cfe2d37 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,8 @@ EXTRA_DIST = \
aclocal/bsdsignals.m4 \
aclocal/nfs-utils.m4 \
aclocal/kerberos5.m4 \
- aclocal/tcp-wrappers.m4
+ aclocal/tcp-wrappers.m4 \
+ aclocal/libtirpc.m4
ACLOCAL_AMFLAGS = -I aclocal
diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
new file mode 100644
index 0000000..67c4012
--- /dev/null
+++ b/aclocal/libtirpc.m4
@@ -0,0 +1,25 @@
+dnl Checks for TI-RPC library and headers
+dnl
+AC_DEFUN([AC_LIBTIRPC], [
+
+ dnl if --enable-tirpc was specifed, the following components
+ dnl must be present, and we set up HAVE_ macros for them.
+
+ if test "$enable_tirpc" = yes; then
+
+ dnl look for the library; add to LIBS if found
+ AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
+ [AC_MSG_ERROR([libtirpc not found.])])
+
+ dnl also must have the headers installed where we expect
+ AC_CHECK_HEADERS([tirpc/netconfig.h], ,
+ [AC_MSG_ERROR([libtirpc headers not found.])])
+
+ dnl set up HAVE_FOO for various functions
+ AC_CHECK_FUNCS([getnetconfig \
+ clnt_create clnt_create_timed \
+ clnt_vc_create clnt_dg_create xdr_rpcb])
+
+ fi
+
+])dnl
diff --git a/configure.ac b/configure.ac
index 97b084b..becbb7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,11 @@ AC_ARG_ENABLE(mount,
enable_mount=$enableval,
enable_mount=yes)
AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"])
+AC_ARG_ENABLE(tirpc,
+ [AC_HELP_STRING([--enable-tirpc],
+ [enable use of TI-RPC @<:@default=no@:>@])],
+ enable_tirpc=$enableval,
+ enable_tirpc=no)
AC_ARG_ENABLE(ipv6,
[AC_HELP_STRING([--enable-ipv6],
[enable support for IPv6 @<:@default=no@:>@])],
@@ -131,13 +136,8 @@ AC_ARG_ENABLE(ipv6,
AC_SUBST(enable_ipv6)
AM_CONDITIONAL(CONFIG_IPV6, [test "$enable_ipv6" = "yes"])
-AC_ARG_ENABLE(tirpc,
- [AC_HELP_STRING([--enable-tirpc],
- [enable use of TI-RPC @<:@default=no@:>@])],
- enable_tirpc=$enableval,
- enable_tirpc=no)
- AC_SUBST(enable_tirpc)
- AM_CONDITIONAL(CONFIG_TIRPC, [test "$enable_tirpc" = "yes"])
+dnl Check for TI-RPC library and headers
+AC_LIBTIRPC
# Check whether user wants TCP wrappers support
AC_TCP_WRAPPERS
@@ -262,22 +262,12 @@ AC_CHECK_DECL([AI_ADDRCONFIG],
[Define this to 1 if AI_ADDRCONFIG macro is defined]), ,
[ #include <netdb.h> ] )
-if test "$enable_tirpc" = yes; then
- AC_CHECK_LIB(tirpc, clnt_tli_create, ,
- AC_MSG_ERROR([libtirpc not found.]))
- AC_CHECK_HEADERS(tirpc/netconfig.h, ,
- AC_MSG_ERROR([libtirpc headers not found.]))
- AC_CHECK_FUNCS([bindresvport_sa getnetconfig \
- clnt_create clnt_create_timed \
- clnt_vc_create clnt_dg_create xdr_rpcb])
-fi
-
if test "$enable_ipv6" = yes; then
if test "$enable_tirpc" = no; then
AC_MSG_ERROR('--enable-ipv6' requires '--enable-tirpc'.)
fi
- AC_CHECK_FUNC(getnameinfo, , ,
- AC_MSG_ERROR(Function 'getnameinfo' not found.))
+ AC_CHECK_FUNCS([getnameinfo bindresvport_sa], , ,
+ [AC_MSG_ERROR([Missing functions needed for IPv6.])])
AC_CHECK_DECL([AI_ADDRCONFIG], ,
AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support]),
[ #include <netdb.h> ] )
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/9] nfs-utils: replace function-specific switches with HAVE_LIBTIRPC
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-05 17:41 ` [PATCH 1/9] configure: add defensive quoting in some function checks Chuck Lever
2009-03-05 17:41 ` [PATCH 2/9] configure: move TI-RPC checks into aclocal/ Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 4/9] configure: pull common nfsidmap and event checks into aclocal/ Chuck Lever
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Instead of switching in TI-RPC-specific logic with a function-specific
switch like HAVE_CLNT_VG_CREATE, let's use the more generic
HAVE_LIBTIRPC macro everywhere.
This simplifies ./configure (always a good thing), and makes it more
clear in the source code exactly what the extra conditionally compiled
code is for.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
aclocal/libtirpc.m4 | 5 -----
support/nfs/getport.c | 36 +++++++++++++++++----------------
support/nfs/rpc_socket.c | 50 +++++++++++++++++++++++-----------------------
3 files changed, 43 insertions(+), 48 deletions(-)
diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index 67c4012..b1f3669 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -15,11 +15,6 @@ AC_DEFUN([AC_LIBTIRPC], [
AC_CHECK_HEADERS([tirpc/netconfig.h], ,
[AC_MSG_ERROR([libtirpc headers not found.])])
- dnl set up HAVE_FOO for various functions
- AC_CHECK_FUNCS([getnetconfig \
- clnt_create clnt_create_timed \
- clnt_vc_create clnt_dg_create xdr_rpcb])
-
fi
])dnl
diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index 5da1749..2255b7d 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -40,7 +40,7 @@
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
-#ifdef HAVE_TIRPC_NETCONFIG_H
+#ifdef HAVE_LIBTIRPC
#include <tirpc/netconfig.h>
#include <tirpc/rpc/rpcb_prot.h>
#endif
@@ -53,17 +53,17 @@
* Rpcbind's local socket service does not seem to be working.
* Disable this logic for now.
*/
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
#undef NFS_GP_LOCAL
-#else /* HAVE_XDR_RPCB */
+#else /* !HAVE_LIBTIRPC */
#undef NFS_GP_LOCAL
-#endif /* HAVE_XDR_RPCB */
+#endif /* !HAVE_LIBTIRPC */
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
const static rpcvers_t default_rpcb_version = RPCBVERS_4;
-#else
+#else /* !HAVE_LIBTIRPC */
const static rpcvers_t default_rpcb_version = PMAPVERS;
-#endif
+#endif /* !HAVE_LIBTIRPC */
#ifdef HAVE_DECL_AI_ADDRCONFIG
/*
@@ -242,7 +242,7 @@ static CLIENT *nfs_gp_get_rpcbclient(const struct sockaddr *sap,
* Returns a '\0'-terminated string if successful; otherwise NULL.
* rpc_createerr.cf_stat is set to reflect the error.
*/
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
static char *nfs_gp_get_netid(const sa_family_t family,
const unsigned short protocol)
@@ -290,7 +290,7 @@ out:
return NULL;
}
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
/*
* Extract a port number from a universal address, and terminate the
@@ -453,7 +453,7 @@ static int nfs_gp_ping(CLIENT *client, struct timeval timeout)
return (int)(status == RPC_SUCCESS);
}
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
/*
* Initialize the rpcb argument for a GETADDR request.
@@ -565,7 +565,7 @@ static unsigned short nfs_gp_rpcb_getaddr(CLIENT *client,
return port;
}
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
/*
* Try GETPORT request via rpcbind version 2.
@@ -595,7 +595,7 @@ static unsigned long nfs_gp_pmap_getport(CLIENT *client,
return port;
}
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
const struct sockaddr *sap,
@@ -617,7 +617,7 @@ static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
return port;
}
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
static unsigned long nfs_gp_getport_pmap(CLIENT *client,
const rpcprog_t program,
@@ -652,11 +652,11 @@ static unsigned short nfs_gp_getport(CLIENT *client,
struct timeval timeout)
{
switch (sap->sa_family) {
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
case AF_INET6:
return nfs_gp_getport_rpcb(client, sap, salen, program,
version, protocol, timeout);
-#endif /* HAVE_XDR_RPCB */
+#endif /* HAVE_LIBTIRPC */
case AF_INET:
return nfs_gp_getport_pmap(client, program, version,
protocol, timeout);
@@ -922,7 +922,7 @@ unsigned short nfs_getlocalport(const rpcprot_t program,
* address of the same address family. In this way an RPC server can
* advertise via rpcbind that it does not support AF_INET6.
*/
-#ifdef HAVE_XDR_RPCB
+#ifdef HAVE_LIBTIRPC
unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
const socklen_t salen,
@@ -955,7 +955,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
return port;
}
-#else /* HAVE_XDR_RPCB */
+#else /* !HAVE_LIBTIRPC */
unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
const socklen_t salen,
@@ -971,7 +971,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
return 0;
}
-#endif /* HAVE_XDR_RPCB */
+#endif /* !HAVE_LIBTIRPC */
/**
* nfs_pmap_getport - query rpcbind via the portmap protocol (rpcbindv2)
diff --git a/support/nfs/rpc_socket.c b/support/nfs/rpc_socket.c
index b7420d1..4b4b0be 100644
--- a/support/nfs/rpc_socket.c
+++ b/support/nfs/rpc_socket.c
@@ -40,7 +40,7 @@
#include "nfsrpc.h"
-#ifdef HAVE_TIRPC_NETCONFIG_H
+#ifdef HAVE_LIBTIRPC
/*
* Most of the headers under /usr/include/tirpc are currently
@@ -84,7 +84,7 @@ extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
const rpcprog_t, const rpcvers_t,
u_int, u_int);
-#endif /* HAVE_TIRPC_NETCONFIG_H */
+#endif /* HAVE_LIBTIRPC */
/*
* If "-1" is specified in the tv_sec field, use these defaults instead.
@@ -107,14 +107,14 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
const rpcvers_t version,
struct timeval *timeout)
{
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
struct sockaddr_storage address;
const struct netbuf nbuf = {
.maxlen = sizeof(struct sockaddr_un),
.len = (size_t)salen,
.buf = &address,
};
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* HAVE_LIBTIRPC */
CLIENT *client;
int sock;
@@ -128,13 +128,13 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
if (timeout->tv_sec == -1)
timeout->tv_sec = NFSRPC_TIMEOUT_TCP;
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
memcpy(nbuf.buf, sap, (size_t)salen);
client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
-#else /* HAVE_CLNT_VC_CREATE */
+#else /* !HAVE_LIBTIRPC */
client = clntunix_create((struct sockaddr_un *)sap,
program, version, &sock, 0, 0);
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
if (client != NULL)
CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
else
@@ -261,23 +261,23 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
const rpcvers_t version,
struct timeval *timeout)
{
-#ifdef HAVE_CLNT_DG_CREATE
+ CLIENT *client;
+ int ret, sock;
+#ifdef HAVE_LIBTIRPC
struct sockaddr_storage address;
const struct netbuf nbuf = {
.maxlen = salen,
.len = salen,
.buf = &address,
};
-#endif /* HAVE_CLNT_DG_CREATE */
- CLIENT *client;
- int ret, sock;
-#ifndef HAVE_CLNT_DG_CREATE
+#else /* !HAVE_LIBTIRPC */
+
if (sap->sa_family != AF_INET) {
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
return NULL;
}
-#endif /* !HAVE_CLNT_DG_CREATE */
+#endif /* !HAVE_LIBTIRPC */
sock = socket((int)sap->sa_family, SOCK_DGRAM, IPPROTO_UDP);
if (sock == -1) {
@@ -305,13 +305,13 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
return NULL;
}
-#ifdef HAVE_CLNT_DG_CREATE
+#ifdef HAVE_LIBTIRPC
memcpy(nbuf.buf, sap, (size_t)salen);
client = clnt_dg_create(sock, &nbuf, program, version, 0, 0);
-#else /* HAVE_CLNT_DG_CREATE */
+#else /* !HAVE_LIBTIRPC */
client = clntudp_create((struct sockaddr_in *)sap, program,
version, *timeout, &sock);
-#endif /* HAVE_CLNT_DG_CREATE */
+#endif /* !HAVE_LIBTIRPC */
if (client != NULL) {
CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)timeout);
CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
@@ -337,23 +337,23 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
const rpcvers_t version,
struct timeval *timeout)
{
-#ifdef HAVE_CLNT_VC_CREATE
+ CLIENT *client;
+ int ret, sock;
+#ifdef HAVE_LIBTIRPC
struct sockaddr_storage address;
const struct netbuf nbuf = {
.maxlen = salen,
.len = salen,
.buf = &address,
};
-#endif /* HAVE_CLNT_VC_CREATE */
- CLIENT *client;
- int ret, sock;
-#ifndef HAVE_CLNT_VC_CREATE
+#else /* !HAVE_LIBTIRPC */
+
if (sap->sa_family != AF_INET) {
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
return NULL;
}
-#endif /* !HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
sock = socket((int)sap->sa_family, SOCK_STREAM, IPPROTO_TCP);
if (sock == -1) {
@@ -381,13 +381,13 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
return NULL;
}
-#ifdef HAVE_CLNT_VC_CREATE
+#ifdef HAVE_LIBTIRPC
memcpy(nbuf.buf, sap, (size_t)salen);
client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
-#else /* HAVE_CLNT_VC_CREATE */
+#else /* !HAVE_LIBTIRPC */
client = clnttcp_create((struct sockaddr_in *)sap,
program, version, &sock, 0, 0);
-#endif /* HAVE_CLNT_VC_CREATE */
+#endif /* !HAVE_LIBTIRPC */
if (client != NULL)
CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
else
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/9] configure: pull common nfsidmap and event checks into aclocal/
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (2 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 3/9] nfs-utils: replace function-specific switches with HAVE_LIBTIRPC Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 5/9] configure: Move rpcsecgss checking into aclocal Chuck Lever
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Clean up: Create an aclocal script for the nfsidmap library and
headers checks used for both --enable-gss and --enable-nfsv4.
Move libevent checks out too.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile.am | 4 +++-
aclocal/libevent.m4 | 11 +++++++++++
aclocal/libnfsidmap.m4 | 17 +++++++++++++++++
configure.ac | 20 ++++++++++----------
4 files changed, 41 insertions(+), 11 deletions(-)
create mode 100644 aclocal/libevent.m4
create mode 100644 aclocal/libnfsidmap.m4
diff --git a/Makefile.am b/Makefile.am
index cfe2d37..6541fb7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,9 @@ EXTRA_DIST = \
aclocal/nfs-utils.m4 \
aclocal/kerberos5.m4 \
aclocal/tcp-wrappers.m4 \
- aclocal/libtirpc.m4
+ aclocal/libtirpc.m4 \
+ aclocal/libevent.m4 \
+ aclocal/libnfsidmap.m4
ACLOCAL_AMFLAGS = -I aclocal
diff --git a/aclocal/libevent.m4 b/aclocal/libevent.m4
new file mode 100644
index 0000000..3c962b3
--- /dev/null
+++ b/aclocal/libevent.m4
@@ -0,0 +1,11 @@
+dnl Checks for libevent
+AC_DEFUN([AC_LIBEVENT], [
+
+ dnl Check for libevent, but do not add -levent to LIBS
+ AC_CHECK_LIB([event], [event_dispatch], [libevent=1],
+ [AC_MSG_ERROR([libevent not found.])])
+
+ AC_CHECK_HEADERS([event.h], ,
+ [AC_MSG_ERROR([libevent headers not found.])])
+
+])dnl
diff --git a/aclocal/libnfsidmap.m4 b/aclocal/libnfsidmap.m4
new file mode 100644
index 0000000..cfcde2f
--- /dev/null
+++ b/aclocal/libnfsidmap.m4
@@ -0,0 +1,17 @@
+dnl Checks for libnfsidmap
+dnl
+AC_DEFUN([AC_LIBNFSIDMAP], [
+
+ dnl Check for libnfsidmap, but do not add -lnfsidmap to LIBS
+ AC_CHECK_LIB([nfsidmap], [nfs4_init_name_mapping], [libnfsidmap=1],
+ [AC_MSG_ERROR([libnfsidmap not found.])])
+
+ AC_CHECK_HEADERS([nfsidmap.h], ,
+ [AC_MSG_ERROR([libnfsidmap headers not found.])])
+
+ dnl nfs4_set_debug() doesn't appear in all versions of libnfsidmap
+ AC_CHECK_LIB([nfsidmap], [nfs4_set_debug],
+ [AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1,
+ [Define to 1 if you have the `nfs4_set_debug' function.])])
+
+])dnl
diff --git a/configure.ac b/configure.ac
index becbb7c..0d5f5a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,10 +197,12 @@ AC_CHECK_FUNC([getservbyname], , ,
AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
if test "$enable_nfsv4" = yes; then
- AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
- AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
- AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support]))
- AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
+ dnl check for libevent libraries and headers
+ AC_LIBEVENT
+
+ dnl check for nfsidmap libraries and headers
+ AC_LIBNFSIDMAP
+
dnl librpcsecgss already has a dependency on libgssapi,
dnl but we need to make sure we get the right version
if test "$enable_gss" = yes; then
@@ -239,12 +241,10 @@ AC_SUBST(LIBBLKID)
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]))
- dnl the nfs4_set_debug function doesn't appear in all version of the library
- AC_CHECK_LIB(nfsidmap, nfs4_set_debug,
- AC_DEFINE(HAVE_NFS4_SET_DEBUG,1,
- [Whether nfs4_set_debug() is present in libnfsidmap]),)
+ AC_LIBNFSIDMAP
+
+ AC_CHECK_HEADERS([spkm3.h], ,
+ [AC_MSG_WARN([Could not locate SPKM3 header; will not have SPKM3 support])])
dnl Check for Kerberos V5
AC_KERBEROS_V5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/9] configure: Move rpcsecgss checking into aclocal
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (3 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 4/9] configure: pull common nfsidmap and event checks into aclocal/ Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 6/9] nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss Chuck Lever
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Clean up: Introduce two more aclocal scripts for handling rpcsecgss
dependency checking.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile.am | 3 ++-
aclocal/librpcsecgss.m4 | 16 ++++++++++++++++
aclocal/rpcsec_vers.m4 | 9 +++++++++
configure.ac | 23 ++++++++---------------
4 files changed, 35 insertions(+), 16 deletions(-)
create mode 100644 aclocal/librpcsecgss.m4
create mode 100644 aclocal/rpcsec_vers.m4
diff --git a/Makefile.am b/Makefile.am
index 6541fb7..098446b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,7 +43,8 @@ EXTRA_DIST = \
aclocal/tcp-wrappers.m4 \
aclocal/libtirpc.m4 \
aclocal/libevent.m4 \
- aclocal/libnfsidmap.m4
+ aclocal/libnfsidmap.m4 \
+ aclocal/rpcsec_vers.m4
ACLOCAL_AMFLAGS = -I aclocal
diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
new file mode 100644
index 0000000..a81819e
--- /dev/null
+++ b/aclocal/librpcsecgss.m4
@@ -0,0 +1,16 @@
+dnl Checks for rpcsecgss library and headers
+dnl KRB5LIBS must be set before this function is invoked.
+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.])],
+ [-lgssglue -ldl])
+
+ 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.])],,
+ [-lgssglue -ldl])
+
+])dnl
diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
new file mode 100644
index 0000000..df7cfb9
--- /dev/null
+++ b/aclocal/rpcsec_vers.m4
@@ -0,0 +1,9 @@
+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])])
+
+ PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
+
+])dnl
diff --git a/configure.ac b/configure.ac
index 0d5f5a6..7d25384 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,17 +203,13 @@ if test "$enable_nfsv4" = yes; then
dnl check for nfsidmap libraries and headers
AC_LIBNFSIDMAP
- dnl librpcsecgss already has a dependency on libgssapi,
- dnl but we need to make sure we get the right version
- if test "$enable_gss" = yes; then
- PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.16, ,
- [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss. If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
- ]
- )
- PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
- fi
-
+ dnl librpcsecgss already has a dependency on libgssapi,
+ dnl but we need to make sure we get the right version
+ if test "$enable_gss" = yes; then
+ AC_RPCSEC_VERSION
+ fi
fi
+
if test "$knfsd_cv_glibc2" = no; then
AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
fi
@@ -249,11 +245,8 @@ if test "$enable_gss" = yes; then
dnl Check for Kerberos V5
AC_KERBEROS_V5
- dnl This is not done until here because we need to have KRBLIBS set
- dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS)
- AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), -lgssglue -ldl)
- AC_CHECK_LIB(rpcsecgss, authgss_set_debug_level,
- AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, -lgssglue -ldl)
+ dnl Invoked after AC_KERBEROS_V5; AC_LIBRPCSECGSS needs to have KRBLIBS set
+ AC_LIBRPCSECGSS
fi
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/9] nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (4 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 5/9] configure: Move rpcsecgss checking into aclocal Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 7/9] configure: move IPv6 feature checks into aclocal/ Chuck Lever
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
From: Jeff Layton <jlayton@redhat.com>
The conftest should work without these extra libs being included.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
aclocal/librpcsecgss.m4 | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
index a81819e..5791260 100644
--- a/aclocal/librpcsecgss.m4
+++ b/aclocal/librpcsecgss.m4
@@ -5,12 +5,10 @@ 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.])],
- [-lgssglue -ldl])
+ [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.])],,
- [-lgssglue -ldl])
+ [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
+ [Define to 1 if you have the `authgss_set_debug_level' function.])])
])dnl
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/9] configure: move IPv6 feature checks into aclocal/
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (5 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 6/9] nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 8/9] nfs-utils: Include legacy or TI-RPC headers, not both Chuck Lever
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Clean up: for consistency with other local feature checks, move IPv6
feature checks into aclocal/
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile.am | 3 ++-
aclocal/ipv6.m4 | 29 +++++++++++++++++++++++++++++
configure.ac | 17 ++---------------
3 files changed, 33 insertions(+), 16 deletions(-)
create mode 100644 aclocal/ipv6.m4
diff --git a/Makefile.am b/Makefile.am
index 098446b..b3a6e91 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,7 +44,8 @@ EXTRA_DIST = \
aclocal/libtirpc.m4 \
aclocal/libevent.m4 \
aclocal/libnfsidmap.m4 \
- aclocal/rpcsec_vers.m4
+ aclocal/rpcsec_vers.m4 \
+ aclocal/ipv6.m4
ACLOCAL_AMFLAGS = -I aclocal
diff --git a/aclocal/ipv6.m4 b/aclocal/ipv6.m4
new file mode 100644
index 0000000..0564b3e
--- /dev/null
+++ b/aclocal/ipv6.m4
@@ -0,0 +1,29 @@
+dnl Checks for IPv6 support
+dnl
+AC_DEFUN([AC_IPV6], [
+
+ AC_CHECK_DECL([AI_ADDRCONFIG],
+ [AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
+ [Define this to 1 if AI_ADDRCONFIG macro is defined])], ,
+ [ #include <netdb.h> ])
+
+ if test "$enable_ipv6" = yes; then
+
+ dnl TI-RPC required for IPv6
+ if test "$enable_tirpc" = no; then
+ AC_MSG_ERROR(['--enable-ipv6' requires '--enable-tirpc'.])
+ fi
+
+ dnl IPv6-enabled networking functions required for IPv6
+ AC_CHECK_FUNCS([getnameinfo bindresvport_sa], , ,
+ [AC_MSG_ERROR([Missing functions needed for IPv6.])])
+
+ dnl Need to detect presence of IPv6 networking at run time via
+ dnl getaddrinfo(3); old versions of glibc do not support ADDRCONFIG
+ AC_CHECK_DECL([AI_ADDRCONFIG], ,
+ [AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support])],
+ [ #include <netdb.h> ])
+
+ fi
+
+])dnl
diff --git a/configure.ac b/configure.ac
index 7d25384..e34b7e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,21 +250,8 @@ if test "$enable_gss" = yes; then
fi
-AC_CHECK_DECL([AI_ADDRCONFIG],
- AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
- [Define this to 1 if AI_ADDRCONFIG macro is defined]), ,
- [ #include <netdb.h> ] )
-
-if test "$enable_ipv6" = yes; then
- if test "$enable_tirpc" = no; then
- AC_MSG_ERROR('--enable-ipv6' requires '--enable-tirpc'.)
- fi
- AC_CHECK_FUNCS([getnameinfo bindresvport_sa], , ,
- [AC_MSG_ERROR([Missing functions needed for IPv6.])])
- AC_CHECK_DECL([AI_ADDRCONFIG], ,
- AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support]),
- [ #include <netdb.h> ] )
-fi
+dnl Check for IPv6 support
+AC_IPV6
dnl *************************************************************
dnl Check for headers
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 8/9] nfs-utils: Include legacy or TI-RPC headers, not both
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (6 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 7/9] configure: move IPv6 feature checks into aclocal/ Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-05 17:42 ` [PATCH 9/9] nfs-utils: clean up handling of libgssglue in gssd Makefile Chuck Lever
2009-03-16 17:44 ` [PATCH 0/9] Address type width mismatches between TI-RPC and glibc Steve Dickson
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Data type incompatibilities between the legacy RPC headers and the
TI-RPC headers mean we can't use libtirpc with code that was compiled
against the legacy RPC headers. The definition of rpcprog_t for
example is "unsigned long" in the legacy library, but it's "uint32_t"
for TI-RPC. On 32-bit systems, these types happen to have the same
width, but on 64-bit systems they don't, making more complex data
structures that use these types in fields ABI incompatible.
Adopt a new strategy to deal with this issue. When --enable-tirpc is
set, append "-I/usr/include/tirpc" to the compilation steps. This
should cause the compiler to grab the tirpc/ headers instead of the
legacy headers. Now, for TI-RPC builds, the TI-RPC legacy functions
and the TI-RPC headers will be used. On legacy systems, the legacy
headers and legacy glibc RPC implementation will be used.
A new ./configure option is introduced to allow system integrators to
use TI-RPC headers in some other location than /usr/include/tirpc.
/usr/include/tirpc remains the default setting for this new option.
The gssd implementation presents a few challenges, but it turns out
the gssglue library is similar to the auth_gss pieces of TI-RPC. To
avoid similar header incompatibility issues, gssd now uses libtirpc
instead of libgssglue if --enable-tirpc is specified. There may be
other issues to tackle with gssd, but for now, we just make sure it
builds with --enable-tirpc.
Note also: svc_getcaller() is a macro in both cases that points to
a sockaddr field in the svc_req structure. The legacy version points
to a sockaddr_in type field, but the TI-RPC version points to a
sockaddr_in6 type field.
rpc.mountd unconditionally casts the result of svc_getcaller() to a
sockaddr_in *. This should be OK for TI-RPC as well, since rpc.mountd
still uses legacy RPC calls (provided by glibc, or emulated by TI-RPC)
to set up its listeners, and therefore rpc.mountd callers will always
be from AF_INET addresses for now.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
aclocal/librpcsecgss.m4 | 17 +++++++++++------
aclocal/libtirpc.m4 | 10 +++++++++-
aclocal/rpcsec_vers.m4 | 7 +++++--
support/nfs/getport.c | 4 ++--
support/nfs/rpc_socket.c | 45 ++-------------------------------------------
utils/gssd/gssd_proc.c | 3 ++-
utils/gssd/krb5_util.c | 1 -
utils/gssd/krb5_util.h | 6 ++++++
utils/mountd/svc_run.c | 4 ++++
9 files changed, 41 insertions(+), 56 deletions(-)
diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
index 5791260..d1dd25e 100644
--- a/aclocal/librpcsecgss.m4
+++ b/aclocal/librpcsecgss.m4
@@ -3,12 +3,17 @@ dnl KRB5LIBS must be set before this function is invoked.
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
diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index b1f3669..af4c7d3 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -2,6 +2,12 @@ dnl Checks for TI-RPC library and headers
dnl
AC_DEFUN([AC_LIBTIRPC], [
+ AC_ARG_WITH([tirpcinclude],
+ [AC_HELP_STRING([--with-tirpcinclude=DIR],
+ [use TI-RPC headers in DIR])],
+ [tirpc_header_dir=$withval],
+ [tirpc_header_dir=/usr/include/tirpc])
+
dnl if --enable-tirpc was specifed, the following components
dnl must be present, and we set up HAVE_ macros for them.
@@ -12,8 +18,10 @@ AC_DEFUN([AC_LIBTIRPC], [
[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
diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
index df7cfb9..5d13db3 100644
--- a/aclocal/rpcsec_vers.m4
+++ b/aclocal/rpcsec_vers.m4
@@ -1,8 +1,11 @@
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])
diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index 2255b7d..734d21a 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -41,8 +41,8 @@
#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"
diff --git a/support/nfs/rpc_socket.c b/support/nfs/rpc_socket.c
index 4b4b0be..2b11e35 100644
--- a/support/nfs/rpc_socket.c
+++ b/support/nfs/rpc_socket.c
@@ -41,49 +41,8 @@
#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 */
/*
diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index d0d3f7f..295c37d 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -70,7 +70,6 @@
#include "gssd.h"
#include "err_util.h"
#include "gss_util.h"
-#include "gss_oids.h"
#include "krb5_util.h"
#include "context.h"
@@ -778,8 +777,10 @@ handle_krb5_upcall(struct clnt_info *clp)
out:
if (token.value)
free(token.value);
+#ifndef HAVE_LIBTIRPC
if (pd.pd_ctx_hndl.length != 0)
authgss_free_private_data(&pd);
+#endif
if (auth)
AUTH_DESTROY(auth);
if (rpc_clnt)
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 8923b3b..e3c6f5e 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -124,7 +124,6 @@
#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 */
diff --git a/utils/gssd/krb5_util.h b/utils/gssd/krb5_util.h
index 4b2da6b..7d808f5 100644
--- a/utils/gssd/krb5_util.h
+++ b/utils/gssd/krb5_util.h
@@ -3,6 +3,12 @@
#include <krb5.h>
+#ifdef HAVE_LIBTIRPC
+#include <rpc/auth_gss.h>
+#else
+#include "gss_oids.h"
+#endif
+
/*
* List of principals from our keytab that we
* will try to use to obtain credentials
diff --git a/utils/mountd/svc_run.c b/utils/mountd/svc_run.c
index 422e839..5ba5af6 100644
--- a/utils/mountd/svc_run.c
+++ b/utils/mountd/svc_run.c
@@ -54,6 +54,10 @@
#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);
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 9/9] nfs-utils: clean up handling of libgssglue in gssd Makefile
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (7 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 8/9] nfs-utils: Include legacy or TI-RPC headers, not both Chuck Lever
@ 2009-03-05 17:42 ` Chuck Lever
2009-03-16 17:44 ` [PATCH 0/9] Address type width mismatches between TI-RPC and glibc Steve Dickson
9 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2009-03-05 17:42 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
From: Jeff Layton <jlayton@redhat.com>
Make the pkgconfig check for libgssglue conditional on tirpc being
enabled. When it's disabled, the pkgconfig check for librpcsecgss will
pull in the gssglue lib and include dir automatically.
Also, make sure we include GSSGLUE_CFLAGS and the GSSGLUE_LIBS to the
appropriate places in utils/gssd/Makefile.am so that we pick up
the gssglue libs when tirpc is enabled.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
aclocal/rpcsec_vers.m4 | 6 +++---
utils/gssd/Makefile.am | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
index 5d13db3..e59c0aa 100644
--- a/aclocal/rpcsec_vers.m4
+++ b/aclocal/rpcsec_vers.m4
@@ -1,12 +1,12 @@
dnl Checks librpcsec version
AC_DEFUN([AC_RPCSEC_VERSION], [
- dnl TI-RPC replaces librpcsecgss
+ dnl TI-RPC replaces librpcsecgss, but we still need libgssglue
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])])
+ else
+ PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
fi
- PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
-
])dnl
diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am
index e42b339..95a2bd0 100644
--- a/utils/gssd/Makefile.am
+++ b/utils/gssd/Makefile.am
@@ -39,11 +39,11 @@ gssd_SOURCES = \
write_bytes.h
gssd_LDADD = ../../support/nfs/libnfs.a \
- $(RPCSECGSS_LIBS) $(KRBLIBS)
+ $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
gssd_LDFLAGS = $(KRBLDFLAGS)
gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
- $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+ $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
svcgssd_SOURCES = \
$(COMMON_SRCS) \
@@ -56,18 +56,18 @@ svcgssd_SOURCES = \
svcgssd_LDADD = \
../../support/nfs/libnfs.a \
- $(RPCSECGSS_LIBS) -lnfsidmap \
+ $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
$(KRBLIBS)
svcgssd_LDFLAGS = $(KRBLDFLAGS)
svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
- $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+ $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
- $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
+ $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
MAINTAINERCLEANFILES = Makefile.in
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/9] Address type width mismatches between TI-RPC and glibc
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
` (8 preceding siblings ...)
2009-03-05 17:42 ` [PATCH 9/9] nfs-utils: clean up handling of libgssglue in gssd Makefile Chuck Lever
@ 2009-03-16 17:44 ` Steve Dickson
9 siblings, 0 replies; 11+ messages in thread
From: Steve Dickson @ 2009-03-16 17:44 UTC (permalink / raw)
To: Chuck Lever; +Cc: linux-nfs
Chuck Lever wrote:
> Steve-
>
> Now that the clean up is finished, here are the patches that actually
> fix the type width mismatch problem between glibc headers and the
> TI-RPC run-time.
>
> This patch set implements a full switch between TI-RPC run-time and
> headers and legacy glibc RPC run-time and headers via --enable-tirpc.
>
> In addition there are a number of configure.ac clean ups.
>
> These are the final patches needed to support TI-RPC and IPv6 properly
> in mount.nfs, umount.nfs, and showmount.
>
> ---
>
> Chuck Lever (7):
> nfs-utils: Include legacy or TI-RPC headers, not both
> configure: move IPv6 feature checks into aclocal/
> configure: Move rpcsecgss checking into aclocal
> configure: pull common nfsidmap and event checks into aclocal/
> nfs-utils: replace function-specific switches with HAVE_LIBTIRPC
> configure: move TI-RPC checks into aclocal/
> configure: add defensive quoting in some function checks
>
> Jeff Layton (2):
> nfs-utils: clean up handling of libgssglue in gssd Makefile
> nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss
>
committed...
steved.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-03-16 17:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 17:41 [PATCH 0/9] Address type width mismatches between TI-RPC and glibc Chuck Lever
[not found] ` <20090305173533.30471.41413.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-05 17:41 ` [PATCH 1/9] configure: add defensive quoting in some function checks Chuck Lever
2009-03-05 17:41 ` [PATCH 2/9] configure: move TI-RPC checks into aclocal/ Chuck Lever
2009-03-05 17:42 ` [PATCH 3/9] nfs-utils: replace function-specific switches with HAVE_LIBTIRPC Chuck Lever
2009-03-05 17:42 ` [PATCH 4/9] configure: pull common nfsidmap and event checks into aclocal/ Chuck Lever
2009-03-05 17:42 ` [PATCH 5/9] configure: Move rpcsecgss checking into aclocal Chuck Lever
2009-03-05 17:42 ` [PATCH 6/9] nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss Chuck Lever
2009-03-05 17:42 ` [PATCH 7/9] configure: move IPv6 feature checks into aclocal/ Chuck Lever
2009-03-05 17:42 ` [PATCH 8/9] nfs-utils: Include legacy or TI-RPC headers, not both Chuck Lever
2009-03-05 17:42 ` [PATCH 9/9] nfs-utils: clean up handling of libgssglue in gssd Makefile Chuck Lever
2009-03-16 17:44 ` [PATCH 0/9] Address type width mismatches between TI-RPC and glibc Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox