diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-03-16 13:40:47 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-03-16 13:40:47 -0400 |
commit | 336f8bca825416082d62ef38314f3e0b7e8f5cc2 (patch) | |
tree | bc98b4e6b475f186cf1d173853a7fd27e75ae55c /utils | |
parent | 530abf870f5188b2bdd4a9211d7c93fb6ce68854 (diff) | |
download | nfs-utils-336f8bca825416082d62ef38314f3e0b7e8f5cc2.tar.gz nfs-utils-336f8bca825416082d62ef38314f3e0b7e8f5cc2.tar.xz nfs-utils-336f8bca825416082d62ef38314f3e0b7e8f5cc2.zip |
nfs-utils: Include legacy or TI-RPC headers, not both
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>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/gssd/gssd_proc.c | 3 | ||||
-rw-r--r-- | utils/gssd/krb5_util.c | 1 | ||||
-rw-r--r-- | utils/gssd/krb5_util.h | 6 | ||||
-rw-r--r-- | utils/mountd/svc_run.c | 4 |
4 files changed, 12 insertions, 2 deletions
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); |