1 commit 5245fa971d220896bfdb4f35f0c0d7dff8ea5e9b
2 Author: Jeff Layton <jlayton@redhat.com>
3 Date: Wed Mar 4 18:41:20 2009 -0500
5 nfs-utils: clean up handling of libgssglue in gssd Makefile
7 Make the pkgconfig check for libgssglue conditional on tirpc being
8 enabled. When it's disabled, the pkgconfig check for librpcsecgss will
9 pull in the gssglue lib and include dir automatically.
11 Also, make sure we include GSSGLUE_CFLAGS and the GSSGLUE_LIBS to the
12 appropriate places in utils/gssd/Makefile.am so that we pick up
13 the gssglue libs when tirpc is enabled.
15 Signed-off-by: Jeff Layton <jlayton@redhat.com>
16 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
18 commit a60410dcf62185f9f4abf2d8a77e638eea75e476
19 Author: Chuck Lever <chuck.lever@oracle.com>
20 Date: Wed Mar 4 18:38:35 2009 -0500
22 nfs-utils: Include legacy or TI-RPC headers, not both
24 Data type incompatibilities between the legacy RPC headers and the
25 TI-RPC headers mean we can't use libtirpc with code that was compiled
26 against the legacy RPC headers. The definition of rpcprog_t for
27 example is "unsigned long" in the legacy library, but it's "uint32_t"
28 for TI-RPC. On 32-bit systems, these types happen to have the same
29 width, but on 64-bit systems they don't, making more complex data
30 structures that use these types in fields ABI incompatible.
32 Adopt a new strategy to deal with this issue. When --enable-tirpc is
33 set, append "-I/usr/include/tirpc" to the compilation steps. This
34 should cause the compiler to grab the tirpc/ headers instead of the
35 legacy headers. Now, for TI-RPC builds, the TI-RPC legacy functions
36 and the TI-RPC headers will be used. On legacy systems, the legacy
37 headers and legacy glibc RPC implementation will be used.
39 A new ./configure option is introduced to allow system integrators to
40 use TI-RPC headers in some other location than /usr/include/tirpc.
41 /usr/include/tirpc remains the default setting for this new option.
43 The gssd implementation presents a few challenges, but it turns out
44 the gssglue library is similar to the auth_gss pieces of TI-RPC. To
45 avoid similar header incompatibility issues, gssd now uses libtirpc
46 instead of libgssglue if --enable-tirpc is specified. There may be
47 other issues to tackle with gssd, but for now, we just make sure it
48 builds with --enable-tirpc.
50 Note also: svc_getcaller() is a macro in both cases that points to
51 a sockaddr field in the svc_req structure. The legacy version points
52 to a sockaddr_in type field, but the TI-RPC version points to a
53 sockaddr_in6 type field.
55 rpc.mountd unconditionally casts the result of svc_getcaller() to a
56 sockaddr_in *. This should be OK for TI-RPC as well, since rpc.mountd
57 still uses legacy RPC calls (provided by glibc, or emulated by TI-RPC)
58 to set up its listeners, and therefore rpc.mountd callers will always
59 be from AF_INET addresses for now.
61 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
63 commit 4069fc444b9f50459abad1cd19cb6278ad76f81b
64 Author: Chuck Lever <chuck.lever@oracle.com>
65 Date: Wed Mar 4 18:38:33 2009 -0500
67 configure: move IPv6 feature checks into aclocal/
69 Clean up: for consistency with other local feature checks, move IPv6
70 feature checks into aclocal/
72 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
74 commit d4cf713e88bdbf4bcad9c76d19f83828e3de9db2
75 Author: Jeff Layton <jlayton@redhat.com>
76 Date: Wed Mar 4 18:38:19 2009 -0500
78 nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss
80 The conftest should work without these extra libs being included.
82 Signed-off-by: Jeff Layton <jlayton@redhat.com>
83 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
85 commit bff44d423f6e7c199deaaffb3a786f4878301dee
86 Author: Chuck Lever <chuck.lever@oracle.com>
87 Date: Wed Mar 4 18:23:28 2009 -0500
89 configure: Move rpcsecgss checking into aclocal
91 Clean up: Introduce two more aclocal scripts for handling rpcsecgss
94 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
96 commit c25e45c7cdf64826a4ead9bd7d8ff11b98861d47
97 Author: Chuck Lever <chuck.lever@oracle.com>
98 Date: Wed Mar 4 18:23:28 2009 -0500
100 configure: pull common nfsidmap and event checks into aclocal/
102 Clean up: Create an aclocal script for the nfsidmap library and
103 headers checks used for both --enable-gss and --enable-nfsv4.
104 Move libevent checks out too.
106 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
108 commit a15242aa10c97bc5bc930266a7b87ab327b29307
109 Author: Chuck Lever <chuck.lever@oracle.com>
110 Date: Wed Mar 4 18:23:28 2009 -0500
112 nfs-utils: replace function-specific switches with HAVE_LIBTIRPC
114 Instead of switching in TI-RPC-specific logic with a function-specific
115 switch like HAVE_CLNT_VG_CREATE, let's use the more generic
116 HAVE_LIBTIRPC macro everywhere.
118 This simplifies ./configure (always a good thing), and makes it more
119 clear in the source code exactly what the extra conditionally compiled
122 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
124 commit 33ea560291d280555ac2aacdbda561cf962f79c2
125 Author: Chuck Lever <chuck.lever@oracle.com>
126 Date: Wed Mar 4 18:23:27 2009 -0500
128 configure: move TI-RPC checks into aclocal/
130 Define an aclocal test for TI-RPC headers and library, and move the
131 TI-RPC checks earlier in our configure script so other feature checks
132 can use the availability of TI-RPC to decide what to do.
134 Since bindresvport_sa is required just for IPv6 support, move that
135 check to the IPv6 feature tests.
137 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
139 commit cf8c8619de71bd82c15bd9be00bc74a1edd29067
140 Author: Chuck Lever <chuck.lever@oracle.com>
141 Date: Wed Mar 4 18:23:27 2009 -0500
143 configure: add defensive quoting in some function checks
145 Clean up: Add proper m4 quoting in macros that check for the presence
146 of some functions in configure.ac.
148 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
150 diff --git a/Makefile.am b/Makefile.am
151 index 88ae210..b3a6e91 100644
154 @@ -40,7 +40,12 @@ EXTRA_DIST = \
155 aclocal/bsdsignals.m4 \
156 aclocal/nfs-utils.m4 \
157 aclocal/kerberos5.m4 \
158 - aclocal/tcp-wrappers.m4
159 + aclocal/tcp-wrappers.m4 \
160 + aclocal/libtirpc.m4 \
161 + aclocal/libevent.m4 \
162 + aclocal/libnfsidmap.m4 \
163 + aclocal/rpcsec_vers.m4 \
166 ACLOCAL_AMFLAGS = -I aclocal
168 diff --git a/aclocal/ipv6.m4 b/aclocal/ipv6.m4
170 index 0000000..0564b3e
172 +++ b/aclocal/ipv6.m4
174 +dnl Checks for IPv6 support
176 +AC_DEFUN([AC_IPV6], [
178 + AC_CHECK_DECL([AI_ADDRCONFIG],
179 + [AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
180 + [Define this to 1 if AI_ADDRCONFIG macro is defined])], ,
181 + [ #include <netdb.h> ])
183 + if test "$enable_ipv6" = yes; then
185 + dnl TI-RPC required for IPv6
186 + if test "$enable_tirpc" = no; then
187 + AC_MSG_ERROR(['--enable-ipv6' requires '--enable-tirpc'.])
190 + dnl IPv6-enabled networking functions required for IPv6
191 + AC_CHECK_FUNCS([getnameinfo bindresvport_sa], , ,
192 + [AC_MSG_ERROR([Missing functions needed for IPv6.])])
194 + dnl Need to detect presence of IPv6 networking at run time via
195 + dnl getaddrinfo(3); old versions of glibc do not support ADDRCONFIG
196 + AC_CHECK_DECL([AI_ADDRCONFIG], ,
197 + [AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support])],
198 + [ #include <netdb.h> ])
203 diff --git a/aclocal/libevent.m4 b/aclocal/libevent.m4
205 index 0000000..3c962b3
207 +++ b/aclocal/libevent.m4
209 +dnl Checks for libevent
210 +AC_DEFUN([AC_LIBEVENT], [
212 + dnl Check for libevent, but do not add -levent to LIBS
213 + AC_CHECK_LIB([event], [event_dispatch], [libevent=1],
214 + [AC_MSG_ERROR([libevent not found.])])
216 + AC_CHECK_HEADERS([event.h], ,
217 + [AC_MSG_ERROR([libevent headers not found.])])
220 diff --git a/aclocal/libnfsidmap.m4 b/aclocal/libnfsidmap.m4
222 index 0000000..cfcde2f
224 +++ b/aclocal/libnfsidmap.m4
226 +dnl Checks for libnfsidmap
228 +AC_DEFUN([AC_LIBNFSIDMAP], [
230 + dnl Check for libnfsidmap, but do not add -lnfsidmap to LIBS
231 + AC_CHECK_LIB([nfsidmap], [nfs4_init_name_mapping], [libnfsidmap=1],
232 + [AC_MSG_ERROR([libnfsidmap not found.])])
234 + AC_CHECK_HEADERS([nfsidmap.h], ,
235 + [AC_MSG_ERROR([libnfsidmap headers not found.])])
237 + dnl nfs4_set_debug() doesn't appear in all versions of libnfsidmap
238 + AC_CHECK_LIB([nfsidmap], [nfs4_set_debug],
239 + [AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1,
240 + [Define to 1 if you have the `nfs4_set_debug' function.])])
243 diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
245 index 0000000..d1dd25e
247 +++ b/aclocal/librpcsecgss.m4
249 +dnl Checks for rpcsecgss library and headers
250 +dnl KRB5LIBS must be set before this function is invoked.
252 +AC_DEFUN([AC_LIBRPCSECGSS], [
254 + dnl libtirpc provides an rpcsecgss API
255 + if test "$enable_tirpc" = no; then
257 + dnl Check for library, but do not add -lrpcsecgss to LIBS
258 + AC_CHECK_LIB([rpcsecgss], [authgss_create_default], [librpcsecgss=1],
259 + [AC_MSG_ERROR([librpcsecgss not found.])])
261 + AC_CHECK_LIB([rpcsecgss], [authgss_set_debug_level],
262 + [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
263 + [Define to 1 if you have the `authgss_set_debug_level' function.])])
268 diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
270 index 0000000..af4c7d3
272 +++ b/aclocal/libtirpc.m4
274 +dnl Checks for TI-RPC library and headers
276 +AC_DEFUN([AC_LIBTIRPC], [
278 + AC_ARG_WITH([tirpcinclude],
279 + [AC_HELP_STRING([--with-tirpcinclude=DIR],
280 + [use TI-RPC headers in DIR])],
281 + [tirpc_header_dir=$withval],
282 + [tirpc_header_dir=/usr/include/tirpc])
284 + dnl if --enable-tirpc was specifed, the following components
285 + dnl must be present, and we set up HAVE_ macros for them.
287 + if test "$enable_tirpc" = yes; then
289 + dnl look for the library; add to LIBS if found
290 + AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
291 + [AC_MSG_ERROR([libtirpc not found.])])
293 + dnl also must have the headers installed where we expect
294 + dnl look for headers; add -I compiler option if found
295 + AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h], ,
296 + [AC_MSG_ERROR([libtirpc headers not found.])])
297 + AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])
302 diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
304 index 0000000..e59c0aa
306 +++ b/aclocal/rpcsec_vers.m4
308 +dnl Checks librpcsec version
309 +AC_DEFUN([AC_RPCSEC_VERSION], [
311 + dnl TI-RPC replaces librpcsecgss, but we still need libgssglue
312 + if test "$enable_tirpc" = no; then
313 + PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.16], ,
314 + [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])])
316 + PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
320 diff --git a/configure.ac b/configure.ac
321 index b2c8190..ce5d308 100644
324 @@ -118,6 +118,11 @@ AC_ARG_ENABLE(mount,
325 enable_mount=$enableval,
327 AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"])
328 +AC_ARG_ENABLE(tirpc,
329 + [AC_HELP_STRING([--enable-tirpc],
330 + [enable use of TI-RPC @<:@default=no@:>@])],
331 + enable_tirpc=$enableval,
334 [AC_HELP_STRING([--enable-ipv6],
335 [enable support for IPv6 @<:@default=no@:>@])],
336 @@ -131,13 +136,8 @@ AC_ARG_ENABLE(ipv6,
337 AC_SUBST(enable_ipv6)
338 AM_CONDITIONAL(CONFIG_IPV6, [test "$enable_ipv6" = "yes"])
340 -AC_ARG_ENABLE(tirpc,
341 - [AC_HELP_STRING([--enable-tirpc],
342 - [enable use of TI-RPC @<:@default=no@:>@])],
343 - enable_tirpc=$enableval,
345 - AC_SUBST(enable_tirpc)
346 - AM_CONDITIONAL(CONFIG_TIRPC, [test "$enable_tirpc" = "yes"])
347 +dnl Check for TI-RPC library and headers
350 # Check whether user wants TCP wrappers support
352 @@ -176,39 +176,40 @@ AC_BSD_SIGNALS
353 dnl *************************************************************
354 dnl * Check for required libraries
355 dnl *************************************************************
356 -AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"])])
358 +AC_CHECK_FUNC([gethostbyname], ,
359 + [AC_CHECK_LIB([nsl], [gethostbyname], [LIBNSL="-lnsl"])])
362 -AC_CHECK_FUNC(connect, ,
363 - AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"],
364 - AC_MSG_ERROR(Function 'socket' not found.), $LIBNSL))
365 +AC_CHECK_FUNC([connect], ,
366 + [AC_CHECK_LIB([socket], [connect], [LIBSOCKET="-lsocket"],
367 + [AC_MSG_ERROR([Function 'socket' not found.])], [$LIBNSL])])
369 +AC_CHECK_FUNC([getaddrinfo], , ,
370 + [AC_MSG_ERROR([Function 'getaddrinfo' not found.])])
372 -AC_CHECK_FUNC(getaddrinfo, , ,
373 - AC_MSG_ERROR(Function 'getaddrinfo' not found.))
374 +AC_CHECK_FUNC([getrpcbynumber], , ,
375 + [AC_MSG_ERROR([Function 'getrpcbynumber' not found.])])
377 -AC_CHECK_FUNC(getrpcbynumber, , ,
378 - AC_MSG_ERROR(Function 'getrpcbynumber' not found.))
379 +AC_CHECK_FUNC([getservbyname], , ,
380 + [AC_MSG_ERROR([Function 'getservbyname' not found.])])
382 -AC_CHECK_FUNC(getservbyname, , ,
383 - AC_MSG_ERROR(Function 'getservbyname' not found.))
384 +AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
386 -AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
387 if test "$enable_nfsv4" = yes; then
388 - AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
389 - AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
390 - AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support]))
391 - AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
392 - dnl librpcsecgss already has a dependency on libgssapi,
393 - dnl but we need to make sure we get the right version
394 - if test "$enable_gss" = yes; then
395 - PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.16, ,
396 - [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])
399 - PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
401 + dnl check for libevent libraries and headers
404 + dnl check for nfsidmap libraries and headers
407 + dnl librpcsecgss already has a dependency on libgssapi,
408 + dnl but we need to make sure we get the right version
409 + if test "$enable_gss" = yes; then
414 if test "$knfsd_cv_glibc2" = no; then
415 AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
417 @@ -236,49 +237,21 @@ AC_SUBST(LIBBLKID)
419 if test "$enable_gss" = yes; then
420 dnl 'gss' also depends on nfsidmap.h - at least for svcgssd_proc.c
421 - AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for gss support]))
422 - AC_CHECK_HEADERS(spkm3.h, ,AC_MSG_WARN([could not locate SPKM3 header; will not have SPKM3 support]))
423 - dnl the nfs4_set_debug function doesn't appear in all version of the library
424 - AC_CHECK_LIB(nfsidmap, nfs4_set_debug,
425 - AC_DEFINE(HAVE_NFS4_SET_DEBUG,1,
426 - [Whether nfs4_set_debug() is present in libnfsidmap]),)
429 + AC_CHECK_HEADERS([spkm3.h], ,
430 + [AC_MSG_WARN([Could not locate SPKM3 header; will not have SPKM3 support])])
432 dnl Check for Kerberos V5
435 - dnl This is not done until here because we need to have KRBLIBS set
436 - dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS)
437 - AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), -lgssglue -ldl)
438 - AC_CHECK_LIB(rpcsecgss, authgss_set_debug_level,
439 - AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, -lgssglue -ldl)
440 + dnl Invoked after AC_KERBEROS_V5; AC_LIBRPCSECGSS needs to have KRBLIBS set
445 -AC_CHECK_DECL([AI_ADDRCONFIG],
446 - AC_DEFINE([HAVE_DECL_AI_ADDRCONFIG], 1,
447 - [Define this to 1 if AI_ADDRCONFIG macro is defined]), ,
448 - [ #include <netdb.h> ] )
450 -if test "$enable_tirpc" = yes; then
451 - AC_CHECK_LIB(tirpc, clnt_tli_create, ,
452 - AC_MSG_ERROR([libtirpc not found.]))
453 - AC_CHECK_HEADERS(tirpc/netconfig.h, ,
454 - AC_MSG_ERROR([libtirpc headers not found.]))
455 - AC_CHECK_FUNCS([bindresvport_sa getnetconfig \
456 - clnt_create clnt_create_timed \
457 - clnt_vc_create clnt_dg_create xdr_rpcb])
460 -if test "$enable_ipv6" = yes; then
461 - if test "$enable_tirpc" = no; then
462 - AC_MSG_ERROR('--enable-ipv6' requires '--enable-tirpc'.)
464 - AC_CHECK_FUNC(getnameinfo, , ,
465 - AC_MSG_ERROR(Function 'getnameinfo' not found.))
466 - AC_CHECK_DECL([AI_ADDRCONFIG], ,
467 - AC_MSG_ERROR([full getaddrinfo(3) implementation needed for IPv6 support]),
468 - [ #include <netdb.h> ] )
470 +dnl Check for IPv6 support
473 dnl *************************************************************
474 dnl Check for headers
475 diff --git a/support/nfs/getport.c b/support/nfs/getport.c
476 index 5da1749..734d21a 100644
477 --- a/support/nfs/getport.c
478 +++ b/support/nfs/getport.c
481 #include <rpc/pmap_prot.h>
483 -#ifdef HAVE_TIRPC_NETCONFIG_H
484 -#include <tirpc/netconfig.h>
485 -#include <tirpc/rpc/rpcb_prot.h>
486 +#ifdef HAVE_LIBTIRPC
487 +#include <netconfig.h>
488 +#include <rpc/rpcb_prot.h>
493 * Rpcbind's local socket service does not seem to be working.
494 * Disable this logic for now.
496 -#ifdef HAVE_XDR_RPCB
497 +#ifdef HAVE_LIBTIRPC
499 -#else /* HAVE_XDR_RPCB */
500 +#else /* !HAVE_LIBTIRPC */
502 -#endif /* HAVE_XDR_RPCB */
503 +#endif /* !HAVE_LIBTIRPC */
505 -#ifdef HAVE_XDR_RPCB
506 +#ifdef HAVE_LIBTIRPC
507 const static rpcvers_t default_rpcb_version = RPCBVERS_4;
509 +#else /* !HAVE_LIBTIRPC */
510 const static rpcvers_t default_rpcb_version = PMAPVERS;
512 +#endif /* !HAVE_LIBTIRPC */
514 #ifdef HAVE_DECL_AI_ADDRCONFIG
516 @@ -242,7 +242,7 @@ static CLIENT *nfs_gp_get_rpcbclient(const struct sockaddr *sap,
517 * Returns a '\0'-terminated string if successful; otherwise NULL.
518 * rpc_createerr.cf_stat is set to reflect the error.
520 -#ifdef HAVE_XDR_RPCB
521 +#ifdef HAVE_LIBTIRPC
523 static char *nfs_gp_get_netid(const sa_family_t family,
524 const unsigned short protocol)
525 @@ -290,7 +290,7 @@ out:
529 -#endif /* HAVE_XDR_RPCB */
530 +#endif /* HAVE_LIBTIRPC */
533 * Extract a port number from a universal address, and terminate the
534 @@ -453,7 +453,7 @@ static int nfs_gp_ping(CLIENT *client, struct timeval timeout)
535 return (int)(status == RPC_SUCCESS);
538 -#ifdef HAVE_XDR_RPCB
539 +#ifdef HAVE_LIBTIRPC
542 * Initialize the rpcb argument for a GETADDR request.
543 @@ -565,7 +565,7 @@ static unsigned short nfs_gp_rpcb_getaddr(CLIENT *client,
547 -#endif /* HAVE_XDR_RPCB */
548 +#endif /* HAVE_LIBTIRPC */
551 * Try GETPORT request via rpcbind version 2.
552 @@ -595,7 +595,7 @@ static unsigned long nfs_gp_pmap_getport(CLIENT *client,
556 -#ifdef HAVE_XDR_RPCB
557 +#ifdef HAVE_LIBTIRPC
559 static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
560 const struct sockaddr *sap,
561 @@ -617,7 +617,7 @@ static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
565 -#endif /* HAVE_XDR_RPCB */
566 +#endif /* HAVE_LIBTIRPC */
568 static unsigned long nfs_gp_getport_pmap(CLIENT *client,
569 const rpcprog_t program,
570 @@ -652,11 +652,11 @@ static unsigned short nfs_gp_getport(CLIENT *client,
571 struct timeval timeout)
573 switch (sap->sa_family) {
574 -#ifdef HAVE_XDR_RPCB
575 +#ifdef HAVE_LIBTIRPC
577 return nfs_gp_getport_rpcb(client, sap, salen, program,
578 version, protocol, timeout);
579 -#endif /* HAVE_XDR_RPCB */
580 +#endif /* HAVE_LIBTIRPC */
582 return nfs_gp_getport_pmap(client, program, version,
584 @@ -922,7 +922,7 @@ unsigned short nfs_getlocalport(const rpcprot_t program,
585 * address of the same address family. In this way an RPC server can
586 * advertise via rpcbind that it does not support AF_INET6.
588 -#ifdef HAVE_XDR_RPCB
589 +#ifdef HAVE_LIBTIRPC
591 unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
592 const socklen_t salen,
593 @@ -955,7 +955,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
597 -#else /* HAVE_XDR_RPCB */
598 +#else /* !HAVE_LIBTIRPC */
600 unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
601 const socklen_t salen,
602 @@ -971,7 +971,7 @@ unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
606 -#endif /* HAVE_XDR_RPCB */
607 +#endif /* !HAVE_LIBTIRPC */
610 * nfs_pmap_getport - query rpcbind via the portmap protocol (rpcbindv2)
611 diff --git a/support/nfs/rpc_socket.c b/support/nfs/rpc_socket.c
612 index b7420d1..2b11e35 100644
613 --- a/support/nfs/rpc_socket.c
614 +++ b/support/nfs/rpc_socket.c
619 -#ifdef HAVE_TIRPC_NETCONFIG_H
622 - * Most of the headers under /usr/include/tirpc are currently
623 - * unusable for various reasons. We statically define the bits
624 - * we need here until the official headers are fixed.
626 - * The commonly used RPC calls such as CLNT_CALL and CLNT_DESTROY
627 - * are actually virtual functions in both the legacy and TI-RPC
628 - * implementations. The proper _CALL or _DESTROY will be invoked
629 - * no matter if we used a legacy clnt_create() or clnt_tli_create()
633 -#include <tirpc/netconfig.h>
634 -#include <tirpc/rpc/rpcb_prot.h>
636 -/* definitions from tirpc/rpc/types.h */
639 - * The netbuf structure is used for transport-independent address storage.
642 - unsigned int maxlen;
647 -/* definitions from tirpc/rpc/clnt.h */
650 - * Low level clnt create routine for connectionless transports, e.g. udp.
652 -extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
653 - const rpcprog_t, const rpcvers_t,
654 - const u_int, const u_int);
657 - * Low level clnt create routine for connectionful transports, e.g. tcp.
659 -extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
660 - const rpcprog_t, const rpcvers_t,
663 -#endif /* HAVE_TIRPC_NETCONFIG_H */
664 +#ifdef HAVE_LIBTIRPC
665 +#include <netconfig.h>
666 +#include <rpc/rpcb_prot.h>
667 +#endif /* HAVE_LIBTIRPC */
670 * If "-1" is specified in the tv_sec field, use these defaults instead.
671 @@ -107,14 +66,14 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
672 const rpcvers_t version,
673 struct timeval *timeout)
675 -#ifdef HAVE_CLNT_VC_CREATE
676 +#ifdef HAVE_LIBTIRPC
677 struct sockaddr_storage address;
678 const struct netbuf nbuf = {
679 .maxlen = sizeof(struct sockaddr_un),
680 .len = (size_t)salen,
683 -#endif /* HAVE_CLNT_VC_CREATE */
684 +#endif /* HAVE_LIBTIRPC */
688 @@ -128,13 +87,13 @@ static CLIENT *nfs_get_localclient(const struct sockaddr *sap,
689 if (timeout->tv_sec == -1)
690 timeout->tv_sec = NFSRPC_TIMEOUT_TCP;
692 -#ifdef HAVE_CLNT_VC_CREATE
693 +#ifdef HAVE_LIBTIRPC
694 memcpy(nbuf.buf, sap, (size_t)salen);
695 client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
696 -#else /* HAVE_CLNT_VC_CREATE */
697 +#else /* !HAVE_LIBTIRPC */
698 client = clntunix_create((struct sockaddr_un *)sap,
699 program, version, &sock, 0, 0);
700 -#endif /* HAVE_CLNT_VC_CREATE */
701 +#endif /* !HAVE_LIBTIRPC */
703 CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
705 @@ -261,23 +220,23 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
706 const rpcvers_t version,
707 struct timeval *timeout)
709 -#ifdef HAVE_CLNT_DG_CREATE
712 +#ifdef HAVE_LIBTIRPC
713 struct sockaddr_storage address;
714 const struct netbuf nbuf = {
719 -#endif /* HAVE_CLNT_DG_CREATE */
723 -#ifndef HAVE_CLNT_DG_CREATE
724 +#else /* !HAVE_LIBTIRPC */
726 if (sap->sa_family != AF_INET) {
727 rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
730 -#endif /* !HAVE_CLNT_DG_CREATE */
731 +#endif /* !HAVE_LIBTIRPC */
733 sock = socket((int)sap->sa_family, SOCK_DGRAM, IPPROTO_UDP);
735 @@ -305,13 +264,13 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
739 -#ifdef HAVE_CLNT_DG_CREATE
740 +#ifdef HAVE_LIBTIRPC
741 memcpy(nbuf.buf, sap, (size_t)salen);
742 client = clnt_dg_create(sock, &nbuf, program, version, 0, 0);
743 -#else /* HAVE_CLNT_DG_CREATE */
744 +#else /* !HAVE_LIBTIRPC */
745 client = clntudp_create((struct sockaddr_in *)sap, program,
746 version, *timeout, &sock);
747 -#endif /* HAVE_CLNT_DG_CREATE */
748 +#endif /* !HAVE_LIBTIRPC */
749 if (client != NULL) {
750 CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)timeout);
751 CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
752 @@ -337,23 +296,23 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
753 const rpcvers_t version,
754 struct timeval *timeout)
756 -#ifdef HAVE_CLNT_VC_CREATE
759 +#ifdef HAVE_LIBTIRPC
760 struct sockaddr_storage address;
761 const struct netbuf nbuf = {
766 -#endif /* HAVE_CLNT_VC_CREATE */
770 -#ifndef HAVE_CLNT_VC_CREATE
771 +#else /* !HAVE_LIBTIRPC */
773 if (sap->sa_family != AF_INET) {
774 rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
777 -#endif /* !HAVE_CLNT_VC_CREATE */
778 +#endif /* !HAVE_LIBTIRPC */
780 sock = socket((int)sap->sa_family, SOCK_STREAM, IPPROTO_TCP);
782 @@ -381,13 +340,13 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
786 -#ifdef HAVE_CLNT_VC_CREATE
787 +#ifdef HAVE_LIBTIRPC
788 memcpy(nbuf.buf, sap, (size_t)salen);
789 client = clnt_vc_create(sock, &nbuf, program, version, 0, 0);
790 -#else /* HAVE_CLNT_VC_CREATE */
791 +#else /* !HAVE_LIBTIRPC */
792 client = clnttcp_create((struct sockaddr_in *)sap,
793 program, version, &sock, 0, 0);
794 -#endif /* HAVE_CLNT_VC_CREATE */
795 +#endif /* !HAVE_LIBTIRPC */
797 CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
799 diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am
800 index e42b339..95a2bd0 100644
801 --- a/utils/gssd/Makefile.am
802 +++ b/utils/gssd/Makefile.am
803 @@ -39,11 +39,11 @@ gssd_SOURCES = \
806 gssd_LDADD = ../../support/nfs/libnfs.a \
807 - $(RPCSECGSS_LIBS) $(KRBLIBS)
808 + $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
809 gssd_LDFLAGS = $(KRBLDFLAGS)
811 gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
812 - $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
813 + $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
817 @@ -56,18 +56,18 @@ svcgssd_SOURCES = \
820 ../../support/nfs/libnfs.a \
821 - $(RPCSECGSS_LIBS) -lnfsidmap \
822 + $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
825 svcgssd_LDFLAGS = $(KRBLDFLAGS)
827 svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
828 - $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
829 + $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
831 gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
833 gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
834 - $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
835 + $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
837 MAINTAINERCLEANFILES = Makefile.in
839 diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
840 index d0d3f7f..295c37d 100644
841 --- a/utils/gssd/gssd_proc.c
842 +++ b/utils/gssd/gssd_proc.c
845 #include "err_util.h"
846 #include "gss_util.h"
847 -#include "gss_oids.h"
848 #include "krb5_util.h"
851 @@ -778,8 +777,10 @@ handle_krb5_upcall(struct clnt_info *clp)
855 +#ifndef HAVE_LIBTIRPC
856 if (pd.pd_ctx_hndl.length != 0)
857 authgss_free_private_data(&pd);
862 diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
863 index 8923b3b..e3c6f5e 100644
864 --- a/utils/gssd/krb5_util.c
865 +++ b/utils/gssd/krb5_util.c
868 #include "err_util.h"
869 #include "gss_util.h"
870 -#include "gss_oids.h"
871 #include "krb5_util.h"
873 /* Global list of principals/cache file names for machine credentials */
874 diff --git a/utils/gssd/krb5_util.h b/utils/gssd/krb5_util.h
875 index 4b2da6b..7d808f5 100644
876 --- a/utils/gssd/krb5_util.h
877 +++ b/utils/gssd/krb5_util.h
882 +#ifdef HAVE_LIBTIRPC
883 +#include <rpc/auth_gss.h>
885 +#include "gss_oids.h"
889 * List of principals from our keytab that we
890 * will try to use to obtain credentials
891 diff --git a/utils/mountd/svc_run.c b/utils/mountd/svc_run.c
892 index 422e839..5ba5af6 100644
893 --- a/utils/mountd/svc_run.c
894 +++ b/utils/mountd/svc_run.c
899 +#ifdef HAVE_LIBTIRPC
900 +#include <rpc/rpc_com.h>
903 void cache_set_fds(fd_set *fdset);
904 int cache_process_req(fd_set *readfds);