]> git.pld-linux.org Git - packages/nfs-utils.git/blob - nfs-utils-git-cel.patch
- rel 1
[packages/nfs-utils.git] / nfs-utils-git-cel.patch
1 commit 5245fa971d220896bfdb4f35f0c0d7dff8ea5e9b
2 Author: Jeff Layton <jlayton@redhat.com>
3 Date:   Wed Mar 4 18:41:20 2009 -0500
4
5     nfs-utils: clean up handling of libgssglue in gssd Makefile
6     
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.
10     
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.
14     
15     Signed-off-by: Jeff Layton <jlayton@redhat.com>
16     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
17
18 commit a60410dcf62185f9f4abf2d8a77e638eea75e476
19 Author: Chuck Lever <chuck.lever@oracle.com>
20 Date:   Wed Mar 4 18:38:35 2009 -0500
21
22     nfs-utils: Include legacy or TI-RPC headers, not both
23     
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.
31     
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.
38     
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.
42     
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.
49     
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.
54     
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.
60     
61     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
62
63 commit 4069fc444b9f50459abad1cd19cb6278ad76f81b
64 Author: Chuck Lever <chuck.lever@oracle.com>
65 Date:   Wed Mar 4 18:38:33 2009 -0500
66
67     configure: move IPv6 feature checks into aclocal/
68     
69     Clean up: for consistency with other local feature checks, move IPv6
70     feature checks into aclocal/
71     
72     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
73
74 commit d4cf713e88bdbf4bcad9c76d19f83828e3de9db2
75 Author: Jeff Layton <jlayton@redhat.com>
76 Date:   Wed Mar 4 18:38:19 2009 -0500
77
78     nfs-utils: don't need extra libs to do AC_CHECK_LIBS for librpcsecgss
79     
80     The conftest should work without these extra libs being included.
81     
82     Signed-off-by: Jeff Layton <jlayton@redhat.com>
83     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
84
85 commit bff44d423f6e7c199deaaffb3a786f4878301dee
86 Author: Chuck Lever <chuck.lever@oracle.com>
87 Date:   Wed Mar 4 18:23:28 2009 -0500
88
89     configure: Move rpcsecgss checking into aclocal
90     
91     Clean up: Introduce two more aclocal scripts for handling rpcsecgss
92     dependency checking.
93     
94     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
95
96 commit c25e45c7cdf64826a4ead9bd7d8ff11b98861d47
97 Author: Chuck Lever <chuck.lever@oracle.com>
98 Date:   Wed Mar 4 18:23:28 2009 -0500
99
100     configure: pull common nfsidmap and event checks into aclocal/
101     
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.
105     
106     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
107
108 commit a15242aa10c97bc5bc930266a7b87ab327b29307
109 Author: Chuck Lever <chuck.lever@oracle.com>
110 Date:   Wed Mar 4 18:23:28 2009 -0500
111
112     nfs-utils: replace function-specific switches with HAVE_LIBTIRPC
113     
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.
117     
118     This simplifies ./configure (always a good thing), and makes it more
119     clear in the source code exactly what the extra conditionally compiled
120     code is for.
121     
122     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
123
124 commit 33ea560291d280555ac2aacdbda561cf962f79c2
125 Author: Chuck Lever <chuck.lever@oracle.com>
126 Date:   Wed Mar 4 18:23:27 2009 -0500
127
128     configure: move TI-RPC checks into aclocal/
129     
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.
133     
134     Since bindresvport_sa is required just for IPv6 support, move that
135     check to the IPv6 feature tests.
136     
137     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
138
139 commit cf8c8619de71bd82c15bd9be00bc74a1edd29067
140 Author: Chuck Lever <chuck.lever@oracle.com>
141 Date:   Wed Mar 4 18:23:27 2009 -0500
142
143     configure: add defensive quoting in some function checks
144     
145     Clean up: Add proper m4 quoting in macros that check for the presence
146     of some functions in configure.ac.
147     
148     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
149
150 diff --git a/Makefile.am b/Makefile.am
151 index 88ae210..b3a6e91 100644
152 --- a/Makefile.am
153 +++ b/Makefile.am
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 \
164 +       aclocal/ipv6.m4
165  
166  ACLOCAL_AMFLAGS = -I aclocal
167  
168 diff --git a/aclocal/ipv6.m4 b/aclocal/ipv6.m4
169 new file mode 100644
170 index 0000000..0564b3e
171 --- /dev/null
172 +++ b/aclocal/ipv6.m4
173 @@ -0,0 +1,29 @@
174 +dnl Checks for IPv6 support
175 +dnl
176 +AC_DEFUN([AC_IPV6], [
177 +
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> ])
182 +
183 +  if test "$enable_ipv6" = yes; then
184 +
185 +    dnl TI-RPC required for IPv6
186 +    if test "$enable_tirpc" = no; then
187 +      AC_MSG_ERROR(['--enable-ipv6' requires '--enable-tirpc'.])
188 +    fi
189 +
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.])])
193 +
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> ])
199 +
200 +  fi
201 +
202 +])dnl
203 diff --git a/aclocal/libevent.m4 b/aclocal/libevent.m4
204 new file mode 100644
205 index 0000000..3c962b3
206 --- /dev/null
207 +++ b/aclocal/libevent.m4
208 @@ -0,0 +1,11 @@
209 +dnl Checks for libevent
210 +AC_DEFUN([AC_LIBEVENT], [
211 +
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.])])
215 +
216 +  AC_CHECK_HEADERS([event.h], ,
217 +                   [AC_MSG_ERROR([libevent headers not found.])])
218 +
219 +])dnl
220 diff --git a/aclocal/libnfsidmap.m4 b/aclocal/libnfsidmap.m4
221 new file mode 100644
222 index 0000000..cfcde2f
223 --- /dev/null
224 +++ b/aclocal/libnfsidmap.m4
225 @@ -0,0 +1,17 @@
226 +dnl Checks for libnfsidmap
227 +dnl
228 +AC_DEFUN([AC_LIBNFSIDMAP], [
229 +
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.])])
233 +
234 +  AC_CHECK_HEADERS([nfsidmap.h], ,
235 +                   [AC_MSG_ERROR([libnfsidmap headers not found.])])
236 +
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.])])
241 +
242 +])dnl
243 diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
244 new file mode 100644
245 index 0000000..d1dd25e
246 --- /dev/null
247 +++ b/aclocal/librpcsecgss.m4
248 @@ -0,0 +1,19 @@
249 +dnl Checks for rpcsecgss library and headers
250 +dnl KRB5LIBS must be set before this function is invoked.
251 +dnl
252 +AC_DEFUN([AC_LIBRPCSECGSS], [
253 +
254 +  dnl libtirpc provides an rpcsecgss API
255 +  if test "$enable_tirpc" = no; then
256 +
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.])])
260 +
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.])])
264 +
265 +  fi
266 +
267 +])dnl
268 diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
269 new file mode 100644
270 index 0000000..af4c7d3
271 --- /dev/null
272 +++ b/aclocal/libtirpc.m4
273 @@ -0,0 +1,28 @@
274 +dnl Checks for TI-RPC library and headers
275 +dnl
276 +AC_DEFUN([AC_LIBTIRPC], [
277 +
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])
283 +
284 +  dnl if --enable-tirpc was specifed, the following components
285 +  dnl must be present, and we set up HAVE_ macros for them.
286 +
287 +  if test "$enable_tirpc" = yes; then
288 +
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.])])
292 +
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}"])
298 +
299 +  fi
300 +
301 +])dnl
302 diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
303 new file mode 100644
304 index 0000000..e59c0aa
305 --- /dev/null
306 +++ b/aclocal/rpcsec_vers.m4
307 @@ -0,0 +1,12 @@
308 +dnl Checks librpcsec version
309 +AC_DEFUN([AC_RPCSEC_VERSION], [
310 +
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])])
315 +  else
316 +    PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
317 +  fi
318 +
319 +])dnl
320 diff --git a/configure.ac b/configure.ac
321 index b2c8190..ce5d308 100644
322 --- a/configure.ac
323 +++ b/configure.ac
324 @@ -118,6 +118,11 @@ AC_ARG_ENABLE(mount,
325         enable_mount=$enableval,
326         enable_mount=yes)
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,
332 +       enable_tirpc=no)
333  AC_ARG_ENABLE(ipv6,
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"])
339  
340 -AC_ARG_ENABLE(tirpc,
341 -       [AC_HELP_STRING([--enable-tirpc],
342 -                        [enable use of TI-RPC @<:@default=no@:>@])],
343 -       enable_tirpc=$enableval,
344 -       enable_tirpc=no)
345 -       AC_SUBST(enable_tirpc)
346 -       AM_CONDITIONAL(CONFIG_TIRPC, [test "$enable_tirpc" = "yes"])
347 +dnl Check for TI-RPC library and headers
348 +AC_LIBTIRPC
349  
350  # Check whether user wants TCP wrappers support
351  AC_TCP_WRAPPERS
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"])])
357 +
358 +AC_CHECK_FUNC([gethostbyname], ,
359 +              [AC_CHECK_LIB([nsl], [gethostbyname], [LIBNSL="-lnsl"])])
360  AC_SUBST(LIBNSL)
361  
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])])
368 +
369 +AC_CHECK_FUNC([getaddrinfo], , ,
370 +              [AC_MSG_ERROR([Function 'getaddrinfo' not found.])])
371  
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.])])
376  
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.])])
381  
382 -AC_CHECK_FUNC(getservbyname, , ,
383 -                AC_MSG_ERROR(Function 'getservbyname' not found.))
384 +AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
385  
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])
397 -      ]
398 -     )
399 -    PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
400 -    fi
401 +  dnl check for libevent libraries and headers
402 +  AC_LIBEVENT
403 +
404 +  dnl check for nfsidmap libraries and headers
405 +  AC_LIBNFSIDMAP
406  
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
410 +    AC_RPCSEC_VERSION
411 +  fi
412  fi
413 +
414  if test "$knfsd_cv_glibc2" = no; then
415      AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
416  fi
417 @@ -236,49 +237,21 @@ AC_SUBST(LIBBLKID)
418  
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]),)
427 +  AC_LIBNFSIDMAP
428 +
429 +  AC_CHECK_HEADERS([spkm3.h], ,
430 +                   [AC_MSG_WARN([Could not locate SPKM3 header; will not have SPKM3 support])])
431  
432    dnl Check for Kerberos V5
433    AC_KERBEROS_V5
434  
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
441 +  AC_LIBRPCSECGSS
442  
443  fi
444  
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> ] )
449 -
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])
458 -fi
459 -
460 -if test "$enable_ipv6" = yes; then
461 -  if test "$enable_tirpc" = no; then
462 -    AC_MSG_ERROR('--enable-ipv6' requires '--enable-tirpc'.)
463 -  fi
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> ] )
469 -fi
470 +dnl Check for IPv6 support
471 +AC_IPV6
472  
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
479 @@ -40,9 +40,9 @@
480  #include <rpc/rpc.h>
481  #include <rpc/pmap_prot.h>
482  
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>
489  #endif
490  
491  #include "nfsrpc.h"
492 @@ -53,17 +53,17 @@
493   * Rpcbind's local socket service does not seem to be working.
494   * Disable this logic for now.
495   */
496 -#ifdef HAVE_XDR_RPCB
497 +#ifdef HAVE_LIBTIRPC
498  #undef NFS_GP_LOCAL
499 -#else  /* HAVE_XDR_RPCB */
500 +#else  /* !HAVE_LIBTIRPC */
501  #undef NFS_GP_LOCAL
502 -#endif /* HAVE_XDR_RPCB */
503 +#endif /* !HAVE_LIBTIRPC */
504  
505 -#ifdef HAVE_XDR_RPCB
506 +#ifdef HAVE_LIBTIRPC
507  const static rpcvers_t default_rpcb_version = RPCBVERS_4;
508 -#else
509 +#else  /* !HAVE_LIBTIRPC */
510  const static rpcvers_t default_rpcb_version = PMAPVERS;
511 -#endif
512 +#endif /* !HAVE_LIBTIRPC */
513  
514  #ifdef HAVE_DECL_AI_ADDRCONFIG
515  /*
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.
519   */
520 -#ifdef HAVE_XDR_RPCB
521 +#ifdef HAVE_LIBTIRPC
522  
523  static char *nfs_gp_get_netid(const sa_family_t family,
524                               const unsigned short protocol)
525 @@ -290,7 +290,7 @@ out:
526         return NULL;
527  }
528  
529 -#endif /* HAVE_XDR_RPCB */
530 +#endif /* HAVE_LIBTIRPC */
531  
532  /*
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);
536  }
537  
538 -#ifdef HAVE_XDR_RPCB
539 +#ifdef HAVE_LIBTIRPC
540  
541  /*
542   * Initialize the rpcb argument for a GETADDR request.
543 @@ -565,7 +565,7 @@ static unsigned short nfs_gp_rpcb_getaddr(CLIENT *client,
544         return port;
545  }
546  
547 -#endif /* HAVE_XDR_RPCB */
548 +#endif /* HAVE_LIBTIRPC */
549  
550  /*
551   * Try GETPORT request via rpcbind version 2.
552 @@ -595,7 +595,7 @@ static unsigned long nfs_gp_pmap_getport(CLIENT *client,
553         return port;
554  }
555  
556 -#ifdef HAVE_XDR_RPCB
557 +#ifdef HAVE_LIBTIRPC
558  
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,
562         return port;
563  }
564  
565 -#endif /* HAVE_XDR_RPCB */
566 +#endif /* HAVE_LIBTIRPC */
567  
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)
572  {
573         switch (sap->sa_family) {
574 -#ifdef HAVE_XDR_RPCB
575 +#ifdef HAVE_LIBTIRPC
576         case AF_INET6:
577                 return nfs_gp_getport_rpcb(client, sap, salen, program,
578                                                 version, protocol, timeout);
579 -#endif /* HAVE_XDR_RPCB */
580 +#endif /* HAVE_LIBTIRPC */
581         case AF_INET:
582                 return nfs_gp_getport_pmap(client, program, version,
583                                                         protocol, timeout);
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.
587   */
588 -#ifdef HAVE_XDR_RPCB
589 +#ifdef HAVE_LIBTIRPC
590  
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,
594         return port;
595  }
596  
597 -#else  /* HAVE_XDR_RPCB */
598 +#else  /* !HAVE_LIBTIRPC */
599  
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,
603         return 0;
604  }
605  
606 -#endif /* HAVE_XDR_RPCB */
607 +#endif /* !HAVE_LIBTIRPC */
608  
609  /**
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
615 @@ -40,51 +40,10 @@
616  
617  #include "nfsrpc.h"
618  
619 -#ifdef HAVE_TIRPC_NETCONFIG_H
620 -
621 -/*
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.
625 - *
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()
630 - * from libtirpc.
631 - */
632 -
633 -#include <tirpc/netconfig.h>
634 -#include <tirpc/rpc/rpcb_prot.h>
635 -
636 -/* definitions from tirpc/rpc/types.h */
637 -
638 -/*
639 - * The netbuf structure is used for transport-independent address storage.
640 - */
641 -struct netbuf {
642 -       unsigned int    maxlen;
643 -       unsigned int    len;
644 -       void            *buf;
645 -};
646 -
647 -/* definitions from tirpc/rpc/clnt.h */
648 -
649 -/*
650 - * Low level clnt create routine for connectionless transports, e.g. udp.
651 - */
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);
655 -
656 -/*
657 - * Low level clnt create routine for connectionful transports, e.g. tcp.
658 - */
659 -extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
660 -                             const rpcprog_t, const rpcvers_t,
661 -                             u_int, u_int);
662 -
663 -#endif /* HAVE_TIRPC_NETCONFIG_H */
664 +#ifdef HAVE_LIBTIRPC
665 +#include <netconfig.h>
666 +#include <rpc/rpcb_prot.h>
667 +#endif /* HAVE_LIBTIRPC */
668  
669  /*
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)
674  {
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,
681                 .buf            = &address,
682         };
683 -#endif /* HAVE_CLNT_VC_CREATE */
684 +#endif /* HAVE_LIBTIRPC */
685         CLIENT *client;
686         int sock;
687  
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;
691  
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 */
702         if (client != NULL)
703                 CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
704         else
705 @@ -261,23 +220,23 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
706                                  const rpcvers_t version,
707                                  struct timeval *timeout)
708  {
709 -#ifdef HAVE_CLNT_DG_CREATE
710 +       CLIENT *client;
711 +       int ret, sock;
712 +#ifdef HAVE_LIBTIRPC
713         struct sockaddr_storage address;
714         const struct netbuf nbuf = {
715                 .maxlen         = salen,
716                 .len            = salen,
717                 .buf            = &address,
718         };
719 -#endif /* HAVE_CLNT_DG_CREATE */
720 -       CLIENT *client;
721 -       int ret, sock;
722  
723 -#ifndef HAVE_CLNT_DG_CREATE
724 +#else  /* !HAVE_LIBTIRPC */
725 +
726         if (sap->sa_family != AF_INET) {
727                 rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
728                 return NULL;
729         }
730 -#endif /* !HAVE_CLNT_DG_CREATE */
731 +#endif /* !HAVE_LIBTIRPC */
732  
733         sock = socket((int)sap->sa_family, SOCK_DGRAM, IPPROTO_UDP);
734         if (sock == -1) {
735 @@ -305,13 +264,13 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
736                 return NULL;
737         }
738  
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)
755  {
756 -#ifdef HAVE_CLNT_VC_CREATE
757 +       CLIENT *client;
758 +       int ret, sock;
759 +#ifdef HAVE_LIBTIRPC
760         struct sockaddr_storage address;
761         const struct netbuf nbuf = {
762                 .maxlen         = salen,
763                 .len            = salen,
764                 .buf            = &address,
765         };
766 -#endif /* HAVE_CLNT_VC_CREATE */
767 -       CLIENT *client;
768 -       int ret, sock;
769  
770 -#ifndef HAVE_CLNT_VC_CREATE
771 +#else  /* !HAVE_LIBTIRPC */
772 +
773         if (sap->sa_family != AF_INET) {
774                 rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
775                 return NULL;
776         }
777 -#endif /* !HAVE_CLNT_VC_CREATE */
778 +#endif /* !HAVE_LIBTIRPC */
779  
780         sock = socket((int)sap->sa_family, SOCK_STREAM, IPPROTO_TCP);
781         if (sock == -1) {
782 @@ -381,13 +340,13 @@ static CLIENT *nfs_get_tcpclient(const struct sockaddr *sap,
783                 return NULL;
784         }
785  
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 */
796         if (client != NULL)
797                 CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
798         else
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 = \
804         write_bytes.h
805  
806  gssd_LDADD =   ../../support/nfs/libnfs.a \
807 -               $(RPCSECGSS_LIBS) $(KRBLIBS)
808 +               $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
809  gssd_LDFLAGS = $(KRBLDFLAGS)
810  
811  gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
812 -             $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
813 +             $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
814  
815  svcgssd_SOURCES = \
816         $(COMMON_SRCS) \
817 @@ -56,18 +56,18 @@ svcgssd_SOURCES = \
818  
819  svcgssd_LDADD = \
820         ../../support/nfs/libnfs.a \
821 -       $(RPCSECGSS_LIBS) -lnfsidmap \
822 +       $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
823         $(KRBLIBS)
824  
825  svcgssd_LDFLAGS = $(KRBLDFLAGS)
826  
827  svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
828 -                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
829 +                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
830  
831  gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
832  
833  gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
834 -                $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
835 +                $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
836  
837  MAINTAINERCLEANFILES = Makefile.in
838  
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
843 @@ -70,7 +70,6 @@
844  #include "gssd.h"
845  #include "err_util.h"
846  #include "gss_util.h"
847 -#include "gss_oids.h"
848  #include "krb5_util.h"
849  #include "context.h"
850  
851 @@ -778,8 +777,10 @@ handle_krb5_upcall(struct clnt_info *clp)
852  out:
853         if (token.value)
854                 free(token.value);
855 +#ifndef HAVE_LIBTIRPC
856         if (pd.pd_ctx_hndl.length != 0)
857                 authgss_free_private_data(&pd);
858 +#endif
859         if (auth)
860                 AUTH_DESTROY(auth);
861         if (rpc_clnt)
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
866 @@ -124,7 +124,6 @@
867  #include "gssd.h"
868  #include "err_util.h"
869  #include "gss_util.h"
870 -#include "gss_oids.h"
871  #include "krb5_util.h"
872  
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
878 @@ -3,6 +3,12 @@
879  
880  #include <krb5.h>
881  
882 +#ifdef HAVE_LIBTIRPC
883 +#include <rpc/auth_gss.h>
884 +#else
885 +#include "gss_oids.h"
886 +#endif
887 +
888  /*
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
895 @@ -54,6 +54,10 @@
896  #include <errno.h>
897  #include <time.h>
898  
899 +#ifdef HAVE_LIBTIRPC
900 +#include <rpc/rpc_com.h>
901 +#endif
902 +
903  void cache_set_fds(fd_set *fdset);
904  int cache_process_req(fd_set *readfds);
905  
This page took 0.09934 seconds and 3 git commands to generate.