From c6fe6a5e927861f73a870cf89c8ff6e42b752da3 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 7 May 2015 10:34:27 -0400 Subject: [PATCH] Updated to latest upstream release: libtirpc-0-3-3 Signed-off-by: Steve Dickson --- .gitignore | 8 +- libtirpc-0.2.5-rc1.patch | 744 ----------- libtirpc-0.2.5-rc3.patch | 893 ------------- libtirpc-0.2.6-rc2.patch | 270 ---- libtirpc-0.2.6-rc3.patch | 2721 -------------------------------------- libtirpc.spec | 16 +- sources | 2 +- 7 files changed, 10 insertions(+), 4644 deletions(-) delete mode 100644 libtirpc-0.2.5-rc1.patch delete mode 100644 libtirpc-0.2.5-rc3.patch delete mode 100644 libtirpc-0.2.6-rc2.patch delete mode 100644 libtirpc-0.2.6-rc3.patch diff --git a/.gitignore b/.gitignore index 36c6b1a..441d5b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ +Makefile cscope* -/libtirpc-0.2.2.tar.bz2 -libtirpc-0.2.2/ x86_64/ -/libtirpc-0.2.3.tar.bz2 -/libtirpc-0.2.4.tar.bz2 -/libtirpc-0.2.5.tar.bz2 +/libtirpc-0.3.0.tar.bz2 +libtirpc-0.3.0 diff --git a/libtirpc-0.2.5-rc1.patch b/libtirpc-0.2.5-rc1.patch deleted file mode 100644 index 25bbcd5..0000000 --- a/libtirpc-0.2.5-rc1.patch +++ /dev/null @@ -1,744 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 11df020..10d17ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,7 +1,6 @@ - AC_INIT(libtirpc, 0.2.4) - AM_INIT_AUTOMAKE([silent-rules]) - AM_SILENT_RULES([yes]) --AM_MAINTAINER_MODE - AC_CONFIG_SRCDIR([src/auth_des.c]) - AC_CONFIG_MACRO_DIR([m4]) - -diff --git a/man/Makefile.am b/man/Makefile.am -index 8f764b7..a37c7da 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -1,11 +1,19 @@ -+LOOKUP_MANS = getrpcent.3t getrpcport.3t -+NETCONFIG_MANS = getnetconfig.3t getnetpath.3t -+BIND_MANS = bindresvport.3t -+COMPAT_MANS = des_crypt.3t rpc_soc.3t rpc_secure.3t rtime.3t -+CLIENT_MANS = rpc_clnt_auth.3t rpc_clnt_calls.3t rpc_clnt_create.3t \ -+ rpcbind.3t -+SERVER_MANS = rpc_svc_calls.3t rpc_svc_create.3t rpc_svc_err.3t \ -+ rpc_svc_reg.3t -+GENERIC_MANS = rpc.3t rpc_xdr.3t - --man5_MANS = netconfig.5 --man3_MANS = bindresvport.3t des_crypt.3t getnetconfig.3t getnetpath.3t \ -- getrpcent.3t getrpcport.3t rpc.3t rpc_clnt_auth.3t rpc_clnt_calls.3t \ -- rpc_clnt_create.3t rpc_secure.3t rpc_soc.3t rpc_svc_calls.3t \ -- rpc_svc_create.3t rpc_svc_err.3t rpc_svc_reg.3t rpc_xdr.3t rtime.3t -+dist_man5_MANS = netconfig.5 -+dist_man3_MANS = $(LOOKUP_MANS) $(NETCONFIG_MANS) \ -+ $(BIND_MANS) $(GENERIC_MANS) $(COMPAT_MANS) \ -+ $(CLIENT_MANS) $(SERVER_MANS) - --EXTRA_DIST = $(man5_MANS) $(man3_MANS) -+EXTRA_DIST = publickey.3t publickey.5 rpc.5 - --CLEANFILES = cscope.* *~ --DISTCLEANFILES = Makefile.in -+CLEANFILES = cscope.* *~ -+DISTCLEANFILES = Makefile.in -diff --git a/man/bindresvport.3t b/man/bindresvport.3t -index 6724663..476e678 100644 ---- a/man/bindresvport.3t -+++ b/man/bindresvport.3t -@@ -7,8 +7,6 @@ - .Nm bindresvport , - .Nm bindresvport_sa - .Nd bind a socket to a privileged IP port --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In sys/types.h - .In rpc/rpc.h -@@ -94,8 +92,11 @@ for any of the errors specified for the calls - .Xr getsockopt 2 , - or - .Xr setsockopt 2 . -+.Sh AVAILABILITY -+The -+.Fn bindresvport -+function is part of libtirpc. - .Sh SEE ALSO - .Xr bind 2 , - .Xr getsockopt 2 , --.Xr setsockopt 2 , --.Xr ip 4 -+.Xr setsockopt 2 -diff --git a/man/des_crypt.3t b/man/des_crypt.3t -index b708f76..a2be1bd 100644 ---- a/man/des_crypt.3t -+++ b/man/des_crypt.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm des_crypt , ecb_crypt , cbc_crypt , des_setparity - .Nd "fast DES encryption" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/des_crypt.h - .Ft int -@@ -118,6 +116,13 @@ Given a result status - the macro - .Fn DES_FAILED stat - is false only for the first two statuses. -+.Sh AVAILABILITY -+The -+.Fn ecb_crypt , -+.Fn cbc_crypt , -+and -+.Fn des_setparity -+functions are part of libtirpc. - .Sh SEE ALSO - .\" .Xr des 1 , - .Xr crypt 3 -diff --git a/man/getnetconfig.3t b/man/getnetconfig.3t -index fbaa14d..6682319 100644 ---- a/man/getnetconfig.3t -+++ b/man/getnetconfig.3t -@@ -12,8 +12,6 @@ - .Nm nc_perror , - .Nm nc_sperror - .Nd get network configuration database entry --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In netconfig.h - .Ft "struct netconfig *" -@@ -215,6 +213,8 @@ implemented as thread-specific data. - .Bl -tag -width /etc/netconfig -compact - .It Pa /etc/netconfig - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetpath 3 , - .Xr netconfig 5 -diff --git a/man/getnetpath.3t b/man/getnetpath.3t -index b3712ad..474acf9 100644 ---- a/man/getnetpath.3t -+++ b/man/getnetpath.3t -@@ -12,8 +12,6 @@ - entry corresponding to - .Ev NETPATH - component --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In netconfig.h - .Ft "struct netconfig *" -@@ -162,6 +160,8 @@ has been exhausted, - .Fn getnetpath - returns - .Dv NULL . -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetconfig 3 , - .Xr netconfig 5 , -diff --git a/man/getrpcent.3t b/man/getrpcent.3t -index 261a8f4..2796de9 100644 ---- a/man/getrpcent.3t -+++ b/man/getrpcent.3t -@@ -10,8 +10,6 @@ - .Nm endrpcent , - .Nm setrpcent - .Nd get RPC entry --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft struct rpcent * -@@ -89,10 +87,11 @@ program number is found, or until end-of-file is encountered. - .Bl -tag -width /etc/rpc -compact - .It Pa /etc/rpc - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 5 , --.Xr rpcinfo 8 , --.Xr ypserv 8 -+.Xr rpcinfo 8 - .Sh DIAGNOSTICS - A - .Dv NULL -diff --git a/man/getrpcport.3t b/man/getrpcport.3t -index 8a072c7..1aa5773 100644 ---- a/man/getrpcport.3t -+++ b/man/getrpcport.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm getrpcport - .Nd get RPC port number --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .Ft int - .Fn getrpcport "char *host" "int prognum" "int versnum" "int proto" -@@ -32,3 +30,7 @@ is registered but not with version - it will still return a port number (for some version of the program) - indicating that the program is indeed registered. - The version mismatch will be detected upon the first call to the service. -+.Sh AVAILABILITY -+The -+.Fn getrpcport -+function is part of libtirpc. -diff --git a/man/rpc.3t b/man/rpc.3t -index b2927b1..9ff7423 100644 ---- a/man/rpc.3t -+++ b/man/rpc.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm rpc - .Nd library routines for remote procedure calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .In netconfig.h -@@ -499,6 +497,8 @@ pages on which they are described: - .Bl -tag -width /etc/netconfig - .It Pa /etc/netconfig - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetconfig 3 , - .Xr getnetpath 3 , -diff --git a/man/rpc_clnt_auth.3t b/man/rpc_clnt_auth.3t -index ee8fd1d..e20f322 100644 ---- a/man/rpc_clnt_auth.3t -+++ b/man/rpc_clnt_auth.3t -@@ -13,8 +13,6 @@ - .Nm authsys_create , - .Nm authsys_create_default - .Nd library routines for client side remote procedure call authentication --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "void" -@@ -90,6 +88,8 @@ Call - .Fn authsys_create - with the appropriate arguments. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_clnt_calls 3 , -diff --git a/man/rpc_clnt_calls.3t b/man/rpc_clnt_calls.3t -index 38b29d5..8c3804b 100644 ---- a/man/rpc_clnt_calls.3t -+++ b/man/rpc_clnt_calls.3t -@@ -19,8 +19,6 @@ - .Nm rpc_broadcast_exp , - .Nm rpc_call - .Nd library routines for client side calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "enum clnt_stat" -@@ -309,6 +307,8 @@ on which it can create a connection. - You do not have control of timeouts or authentication - using this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr printf 3 , - .Xr rpc 3 , -diff --git a/man/rpc_clnt_create.3t b/man/rpc_clnt_create.3t -index acdbab4..95b6fc8 100644 ---- a/man/rpc_clnt_create.3t -+++ b/man/rpc_clnt_create.3t -@@ -27,8 +27,6 @@ - .Nd "library routines for dealing with creation and manipulation of" - .Vt CLIENT - handles --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -507,6 +505,8 @@ It is used by the routine - .Fn clnt_pcreateerror - to print the reason for the failure. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_clnt_auth 3 , -diff --git a/man/rpc_secure.3t b/man/rpc_secure.3t -index 7969a91..7ad6e49 100644 ---- a/man/rpc_secure.3t -+++ b/man/rpc_secure.3t -@@ -258,10 +258,11 @@ if it succeeds and - if it fails. - Inverse of - .Fn netname2user . -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , --.Xr xdr 3 , --.Xr keyserv 8 -+.Xr xdr 3 - .Pp - The following manuals: - .Rs -diff --git a/man/rpc_soc.3t b/man/rpc_soc.3t -index 59058c0..f26c0af 100644 ---- a/man/rpc_soc.3t -+++ b/man/rpc_soc.3t -@@ -72,8 +72,6 @@ - .Nm xprt_register , - .Nm xprt_unregister - .Nd "library routines for remote procedure calls" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Pp -@@ -1707,6 +1705,8 @@ This routine modifies the global variable - .Va svc_fds . - Service implementors usually do not need this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc_secure 3 , - .Xr xdr 3 -diff --git a/man/rpc_svc_calls.3t b/man/rpc_svc_calls.3t -index 582b45d..4b3c08b 100644 ---- a/man/rpc_svc_calls.3t -+++ b/man/rpc_svc_calls.3t -@@ -21,8 +21,6 @@ - .Nm svc_run , - .Nm svc_sendreply - .Nd library routines for RPC servers --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft int -@@ -258,6 +256,8 @@ if it succeeds, - .Dv FALSE - otherwise. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr poll 2 , - .Xr select 2 , -diff --git a/man/rpc_svc_create.3t b/man/rpc_svc_create.3t -index d47be2b..6e28d2e 100644 ---- a/man/rpc_svc_create.3t -+++ b/man/rpc_svc_create.3t -@@ -18,8 +18,6 @@ - .Nm svc_tp_create , - .Nm svc_vc_create - .Nd library routines for the creation of server handles --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -329,6 +327,8 @@ The server is not registered with the - .Xr rpcbind 8 - service. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rpc_svc_err.3t b/man/rpc_svc_err.3t -index 49139cb..ffc7f53 100644 ---- a/man/rpc_svc_err.3t -+++ b/man/rpc_svc_err.3t -@@ -17,8 +17,6 @@ - .Nm svcerr_systemerr , - .Nm svcerr_weakauth - .Nd library routines for server side remote procedure call errors --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft void -@@ -90,6 +88,8 @@ authentication arguments. - The routine calls - .Fn svcerr_auth "xprt" "AUTH_TOOWEAK" . - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rpc_svc_reg.3t b/man/rpc_svc_reg.3t -index 56dd530..e74f7fc 100644 ---- a/man/rpc_svc_reg.3t -+++ b/man/rpc_svc_reg.3t -@@ -16,8 +16,6 @@ - .Nm xprt_register , - .Nm xprt_unregister - .Nd library routines for registering servers --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft int -@@ -173,6 +171,8 @@ This routine modifies the global variable - .Xr rpc_svc_calls 3 ) . - Service implementors usually do not need this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr select 2 , - .Xr rpc 3 , -diff --git a/man/rpc_xdr.3t b/man/rpc_xdr.3t -index feb708b..ae3d663 100644 ---- a/man/rpc_xdr.3t -+++ b/man/rpc_xdr.3t -@@ -15,8 +15,6 @@ - .Nm xdr_rejected_reply , - .Nm xdr_replymsg - .Nd XDR library routines for remote procedure calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -96,6 +94,8 @@ This reply could be either an acceptance, - rejection or - .Dv NULL . - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr xdr 3 -diff --git a/man/rpcbind.3t b/man/rpcbind.3t -index 99b03cf..ec492cc 100644 ---- a/man/rpcbind.3t -+++ b/man/rpcbind.3t -@@ -14,8 +14,6 @@ - .Nm rpcb_set , - .Nm rpcb_unset - .Nd library routines for RPC bind service --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "rpcblist *" -@@ -187,6 +185,8 @@ Only the owner of the service or the super-user can destroy the mapping. - in - .Xr rpc_svc_calls 3 . ) - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc_clnt_calls 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rtime.3t b/man/rtime.3t -index 6e61350..bc93af6 100644 ---- a/man/rtime.3t -+++ b/man/rtime.3t -@@ -7,8 +7,6 @@ - .Sh NAME - .Nm rtime - .Nd "get remote time" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In sys/types.h - .In sys/time.h -@@ -46,5 +44,7 @@ however, the routine will instead use - and block until a reply is received from the time server. - .Sh RETURN VALUES - .Rv -std rtime --.Sh SEE ALSO --.Xr timed 8 -+.Sh AVAILABILITY -+The -+.Fn rtime -+function is part of libtirpc. -diff --git a/src/auth_gss.c b/src/auth_gss.c -index 703bc3f..fd6191b 100644 ---- a/src/auth_gss.c -+++ b/src/auth_gss.c -@@ -49,14 +49,14 @@ - #include - #include - --static void authgss_nextverf(); --static bool_t authgss_marshal(); --static bool_t authgss_refresh(); --static bool_t authgss_validate(); --static void authgss_destroy(); --static void authgss_destroy_context(); --static bool_t authgss_wrap(); --static bool_t authgss_unwrap(); -+static void authgss_nextverf(AUTH *); -+static bool_t authgss_marshal(AUTH *, XDR *); -+static bool_t authgss_refresh(AUTH *, void *); -+static bool_t authgss_validate(AUTH *, struct opaque_auth *); -+static void authgss_destroy(AUTH *); -+static void authgss_destroy_context(AUTH *); -+static bool_t authgss_wrap(AUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t authgss_unwrap(AUTH *, XDR *, xdrproc_t, caddr_t); - - - /* -@@ -198,7 +198,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec) - save_auth = clnt->cl_auth; - clnt->cl_auth = auth; - -- if (!authgss_refresh(auth)) -+ if (!authgss_refresh(auth, NULL)) - auth = NULL; - else - auth_get(auth); /* Reference for caller */ -@@ -418,7 +418,7 @@ authgss_validate(AUTH *auth, struct opaque_auth *verf) - } - - static bool_t --authgss_refresh(AUTH *auth) -+authgss_refresh(AUTH *auth, void *dummy) - { - struct rpc_gss_data *gd; - struct rpc_gss_init_res gr; -@@ -639,7 +639,7 @@ authgss_destroy(AUTH *auth) - free(auth); - } - --bool_t -+static bool_t - authgss_wrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct rpc_gss_data *gd; -@@ -656,7 +656,7 @@ authgss_wrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - gd->sec.svc, gd->gc.gc_seq)); - } - --bool_t -+static bool_t - authgss_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct rpc_gss_data *gd; -diff --git a/src/clnt_simple.c b/src/clnt_simple.c -index e66da6a..7ee9542 100644 ---- a/src/clnt_simple.c -+++ b/src/clnt_simple.c -@@ -104,9 +104,9 @@ rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) - extern thread_key_t rpc_call_key; - extern mutex_t tsd_lock; - -- if (rpc_call_key == -1) { -+ if (rpc_call_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (rpc_call_key == -1) -+ if (rpc_call_key == KEY_INITIALIZER) - thr_keycreate(&rpc_call_key, rpc_call_destroy); - mutex_unlock(&tsd_lock); - } -diff --git a/src/getnetconfig.c b/src/getnetconfig.c -index 78de0f6..635c03a 100644 ---- a/src/getnetconfig.c -+++ b/src/getnetconfig.c -@@ -137,10 +137,10 @@ __nc_error() - * (including non-threaded programs), or if an allocation - * fails. - */ -- if (nc_key == -1) { -+ if (nc_key == KEY_INITIALIZER) { - error = 0; - mutex_lock(&nc_lock); -- if (nc_key == -1) -+ if (nc_key == KEY_INITIALIZER) - error = thr_keycreate(&nc_key, free); - mutex_unlock(&nc_lock); - if (error) -diff --git a/src/mt_misc.c b/src/mt_misc.c -index d459dec..093086e 100644 ---- a/src/mt_misc.c -+++ b/src/mt_misc.c -@@ -78,12 +78,12 @@ pthread_mutex_t svcraw_lock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_t tsd_lock = PTHREAD_MUTEX_INITIALIZER; - - /* Library global tsd keys */ --thread_key_t clnt_broadcast_key; --thread_key_t rpc_call_key = -1; --thread_key_t tcp_key = -1; --thread_key_t udp_key = -1; --thread_key_t nc_key = -1; --thread_key_t rce_key = -1; -+thread_key_t clnt_broadcast_key = KEY_INITIALIZER; -+thread_key_t rpc_call_key = KEY_INITIALIZER; -+thread_key_t tcp_key = KEY_INITIALIZER; -+thread_key_t udp_key = KEY_INITIALIZER; -+thread_key_t nc_key = KEY_INITIALIZER; -+thread_key_t rce_key = KEY_INITIALIZER; - - /* xprtlist (svc_generic.c) */ - pthread_mutex_t xprtlist_lock = PTHREAD_MUTEX_INITIALIZER; -@@ -110,7 +110,7 @@ __rpc_createerr() - struct rpc_createerr *rce_addr; - - mutex_lock(&tsd_lock); -- if (rce_key == -1) -+ if (rce_key == KEY_INITIALIZER) - thr_keycreate(&rce_key, free); - mutex_unlock(&tsd_lock); - -@@ -131,17 +131,17 @@ __rpc_createerr() - - void tsd_key_delete(void) - { -- if (clnt_broadcast_key != -1) -+ if (clnt_broadcast_key != KEY_INITIALIZER) - pthread_key_delete(clnt_broadcast_key); -- if (rpc_call_key != -1) -+ if (rpc_call_key != KEY_INITIALIZER) - pthread_key_delete(rpc_call_key); -- if (tcp_key != -1) -+ if (tcp_key != KEY_INITIALIZER) - pthread_key_delete(tcp_key); -- if (udp_key != -1) -+ if (udp_key != KEY_INITIALIZER) - pthread_key_delete(udp_key); -- if (nc_key != -1) -+ if (nc_key != KEY_INITIALIZER) - pthread_key_delete(nc_key); -- if (rce_key != -1) -+ if (rce_key != KEY_INITIALIZER) - pthread_key_delete(rce_key); - return; - } -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index 2eb91ad..a43906c 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -228,16 +228,16 @@ __rpc_getconfip(nettype) - extern thread_key_t tcp_key, udp_key; - extern mutex_t tsd_lock; - -- if (tcp_key == -1) { -+ if (tcp_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (tcp_key == -1) -+ if (tcp_key == KEY_INITIALIZER) - thr_keycreate(&tcp_key, free); - mutex_unlock(&tsd_lock); - } - netid_tcp = (char *)thr_getspecific(tcp_key); -- if (udp_key == -1) { -+ if (udp_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (udp_key == -1) -+ if (udp_key == KEY_INITIALIZER) - thr_keycreate(&udp_key, free); - mutex_unlock(&tsd_lock); - } -diff --git a/src/rpc_soc.c b/src/rpc_soc.c -index 4213ca0..338edbb 100644 ---- a/src/rpc_soc.c -+++ b/src/rpc_soc.c -@@ -508,9 +508,9 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - { - extern mutex_t tsd_lock; - -- if (clnt_broadcast_key == -1) { -+ if (clnt_broadcast_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (clnt_broadcast_key == -1) -+ if (clnt_broadcast_key == KEY_INITIALIZER) - thr_keycreate(&clnt_broadcast_key, free); - mutex_unlock(&tsd_lock); - } -diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c -index 9c74313..601a691 100644 ---- a/src/svc_auth_gss.c -+++ b/src/svc_auth_gss.c -@@ -53,11 +53,11 @@ typedef struct gss_union_ctx_id_t { - - - --static bool_t svcauth_gss_destroy(); --static bool_t svcauth_gss_wrap(); --static bool_t svcauth_gss_unwrap(); -+static bool_t svcauth_gss_wrap(SVCAUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t svcauth_gss_unwrap(SVCAUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t svcauth_gss_destroy(SVCAUTH *); - --struct svc_auth_ops svc_auth_gss_ops = { -+static struct svc_auth_ops svc_auth_gss_ops = { - svcauth_gss_wrap, - svcauth_gss_unwrap, - svcauth_gss_destroy -@@ -79,7 +79,7 @@ struct svc_rpc_gss_data { - ((struct svc_rpc_gss_data *)(auth)->svc_ah_private) - - /* Global server credentials. */ --gss_cred_id_t _svcauth_gss_creds; -+static gss_cred_id_t _svcauth_gss_creds; - static gss_name_t _svcauth_gss_name = NULL; - - bool_t -@@ -332,7 +332,7 @@ svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) - return (TRUE); - } - --bool_t -+static bool_t - svcauth_gss_nextverf(struct svc_req *rqst, u_int num) - { - struct svc_rpc_gss_data *gd; -@@ -513,7 +513,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch) - return (AUTH_OK); - } - --bool_t -+static bool_t - svcauth_gss_destroy(SVCAUTH *auth) - { - struct svc_rpc_gss_data *gd; -@@ -535,7 +535,7 @@ svcauth_gss_destroy(SVCAUTH *auth) - return (TRUE); - } - --bool_t -+static bool_t - svcauth_gss_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct svc_rpc_gss_data *gd; -@@ -552,7 +552,7 @@ svcauth_gss_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - gd->sec.svc, gd->seq)); - } - --bool_t -+static bool_t - svcauth_gss_unwrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct svc_rpc_gss_data *gd; -diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h -index 9489b15..5f5c96e 100644 ---- a/tirpc/reentrant.h -+++ b/tirpc/reentrant.h -@@ -46,6 +46,8 @@ - #define once_t pthread_once_t - - #define thread_key_t pthread_key_t -+ -+#define KEY_INITIALIZER ((thread_key_t)-1) - #define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - #define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER - #define ONCE_INITIALIZER PTHREAD_ONCE_INIT diff --git a/libtirpc-0.2.5-rc3.patch b/libtirpc-0.2.5-rc3.patch deleted file mode 100644 index f126a5e..0000000 --- a/libtirpc-0.2.5-rc3.patch +++ /dev/null @@ -1,893 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 11df020..10d17ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,7 +1,6 @@ - AC_INIT(libtirpc, 0.2.4) - AM_INIT_AUTOMAKE([silent-rules]) - AM_SILENT_RULES([yes]) --AM_MAINTAINER_MODE - AC_CONFIG_SRCDIR([src/auth_des.c]) - AC_CONFIG_MACRO_DIR([m4]) - -diff --git a/man/Makefile.am b/man/Makefile.am -index 8f764b7..a37c7da 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -1,11 +1,19 @@ -+LOOKUP_MANS = getrpcent.3t getrpcport.3t -+NETCONFIG_MANS = getnetconfig.3t getnetpath.3t -+BIND_MANS = bindresvport.3t -+COMPAT_MANS = des_crypt.3t rpc_soc.3t rpc_secure.3t rtime.3t -+CLIENT_MANS = rpc_clnt_auth.3t rpc_clnt_calls.3t rpc_clnt_create.3t \ -+ rpcbind.3t -+SERVER_MANS = rpc_svc_calls.3t rpc_svc_create.3t rpc_svc_err.3t \ -+ rpc_svc_reg.3t -+GENERIC_MANS = rpc.3t rpc_xdr.3t - --man5_MANS = netconfig.5 --man3_MANS = bindresvport.3t des_crypt.3t getnetconfig.3t getnetpath.3t \ -- getrpcent.3t getrpcport.3t rpc.3t rpc_clnt_auth.3t rpc_clnt_calls.3t \ -- rpc_clnt_create.3t rpc_secure.3t rpc_soc.3t rpc_svc_calls.3t \ -- rpc_svc_create.3t rpc_svc_err.3t rpc_svc_reg.3t rpc_xdr.3t rtime.3t -+dist_man5_MANS = netconfig.5 -+dist_man3_MANS = $(LOOKUP_MANS) $(NETCONFIG_MANS) \ -+ $(BIND_MANS) $(GENERIC_MANS) $(COMPAT_MANS) \ -+ $(CLIENT_MANS) $(SERVER_MANS) - --EXTRA_DIST = $(man5_MANS) $(man3_MANS) -+EXTRA_DIST = publickey.3t publickey.5 rpc.5 - --CLEANFILES = cscope.* *~ --DISTCLEANFILES = Makefile.in -+CLEANFILES = cscope.* *~ -+DISTCLEANFILES = Makefile.in -diff --git a/man/bindresvport.3t b/man/bindresvport.3t -index 6724663..476e678 100644 ---- a/man/bindresvport.3t -+++ b/man/bindresvport.3t -@@ -7,8 +7,6 @@ - .Nm bindresvport , - .Nm bindresvport_sa - .Nd bind a socket to a privileged IP port --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In sys/types.h - .In rpc/rpc.h -@@ -94,8 +92,11 @@ for any of the errors specified for the calls - .Xr getsockopt 2 , - or - .Xr setsockopt 2 . -+.Sh AVAILABILITY -+The -+.Fn bindresvport -+function is part of libtirpc. - .Sh SEE ALSO - .Xr bind 2 , - .Xr getsockopt 2 , --.Xr setsockopt 2 , --.Xr ip 4 -+.Xr setsockopt 2 -diff --git a/man/des_crypt.3t b/man/des_crypt.3t -index b708f76..a2be1bd 100644 ---- a/man/des_crypt.3t -+++ b/man/des_crypt.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm des_crypt , ecb_crypt , cbc_crypt , des_setparity - .Nd "fast DES encryption" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/des_crypt.h - .Ft int -@@ -118,6 +116,13 @@ Given a result status - the macro - .Fn DES_FAILED stat - is false only for the first two statuses. -+.Sh AVAILABILITY -+The -+.Fn ecb_crypt , -+.Fn cbc_crypt , -+and -+.Fn des_setparity -+functions are part of libtirpc. - .Sh SEE ALSO - .\" .Xr des 1 , - .Xr crypt 3 -diff --git a/man/getnetconfig.3t b/man/getnetconfig.3t -index fbaa14d..6682319 100644 ---- a/man/getnetconfig.3t -+++ b/man/getnetconfig.3t -@@ -12,8 +12,6 @@ - .Nm nc_perror , - .Nm nc_sperror - .Nd get network configuration database entry --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In netconfig.h - .Ft "struct netconfig *" -@@ -215,6 +213,8 @@ implemented as thread-specific data. - .Bl -tag -width /etc/netconfig -compact - .It Pa /etc/netconfig - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetpath 3 , - .Xr netconfig 5 -diff --git a/man/getnetpath.3t b/man/getnetpath.3t -index b3712ad..474acf9 100644 ---- a/man/getnetpath.3t -+++ b/man/getnetpath.3t -@@ -12,8 +12,6 @@ - entry corresponding to - .Ev NETPATH - component --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In netconfig.h - .Ft "struct netconfig *" -@@ -162,6 +160,8 @@ has been exhausted, - .Fn getnetpath - returns - .Dv NULL . -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetconfig 3 , - .Xr netconfig 5 , -diff --git a/man/getrpcent.3t b/man/getrpcent.3t -index 261a8f4..2796de9 100644 ---- a/man/getrpcent.3t -+++ b/man/getrpcent.3t -@@ -10,8 +10,6 @@ - .Nm endrpcent , - .Nm setrpcent - .Nd get RPC entry --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft struct rpcent * -@@ -89,10 +87,11 @@ program number is found, or until end-of-file is encountered. - .Bl -tag -width /etc/rpc -compact - .It Pa /etc/rpc - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 5 , --.Xr rpcinfo 8 , --.Xr ypserv 8 -+.Xr rpcinfo 8 - .Sh DIAGNOSTICS - A - .Dv NULL -diff --git a/man/getrpcport.3t b/man/getrpcport.3t -index 8a072c7..1aa5773 100644 ---- a/man/getrpcport.3t -+++ b/man/getrpcport.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm getrpcport - .Nd get RPC port number --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .Ft int - .Fn getrpcport "char *host" "int prognum" "int versnum" "int proto" -@@ -32,3 +30,7 @@ is registered but not with version - it will still return a port number (for some version of the program) - indicating that the program is indeed registered. - The version mismatch will be detected upon the first call to the service. -+.Sh AVAILABILITY -+The -+.Fn getrpcport -+function is part of libtirpc. -diff --git a/man/rpc.3t b/man/rpc.3t -index b2927b1..9ff7423 100644 ---- a/man/rpc.3t -+++ b/man/rpc.3t -@@ -6,8 +6,6 @@ - .Sh NAME - .Nm rpc - .Nd library routines for remote procedure calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .In netconfig.h -@@ -499,6 +497,8 @@ pages on which they are described: - .Bl -tag -width /etc/netconfig - .It Pa /etc/netconfig - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr getnetconfig 3 , - .Xr getnetpath 3 , -diff --git a/man/rpc_clnt_auth.3t b/man/rpc_clnt_auth.3t -index ee8fd1d..e20f322 100644 ---- a/man/rpc_clnt_auth.3t -+++ b/man/rpc_clnt_auth.3t -@@ -13,8 +13,6 @@ - .Nm authsys_create , - .Nm authsys_create_default - .Nd library routines for client side remote procedure call authentication --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "void" -@@ -90,6 +88,8 @@ Call - .Fn authsys_create - with the appropriate arguments. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_clnt_calls 3 , -diff --git a/man/rpc_clnt_calls.3t b/man/rpc_clnt_calls.3t -index 38b29d5..8c3804b 100644 ---- a/man/rpc_clnt_calls.3t -+++ b/man/rpc_clnt_calls.3t -@@ -19,8 +19,6 @@ - .Nm rpc_broadcast_exp , - .Nm rpc_call - .Nd library routines for client side calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "enum clnt_stat" -@@ -309,6 +307,8 @@ on which it can create a connection. - You do not have control of timeouts or authentication - using this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr printf 3 , - .Xr rpc 3 , -diff --git a/man/rpc_clnt_create.3t b/man/rpc_clnt_create.3t -index acdbab4..95b6fc8 100644 ---- a/man/rpc_clnt_create.3t -+++ b/man/rpc_clnt_create.3t -@@ -27,8 +27,6 @@ - .Nd "library routines for dealing with creation and manipulation of" - .Vt CLIENT - handles --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -507,6 +505,8 @@ It is used by the routine - .Fn clnt_pcreateerror - to print the reason for the failure. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_clnt_auth 3 , -diff --git a/man/rpc_secure.3t b/man/rpc_secure.3t -index 7969a91..7ad6e49 100644 ---- a/man/rpc_secure.3t -+++ b/man/rpc_secure.3t -@@ -258,10 +258,11 @@ if it succeeds and - if it fails. - Inverse of - .Fn netname2user . -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , --.Xr xdr 3 , --.Xr keyserv 8 -+.Xr xdr 3 - .Pp - The following manuals: - .Rs -diff --git a/man/rpc_soc.3t b/man/rpc_soc.3t -index 59058c0..f26c0af 100644 ---- a/man/rpc_soc.3t -+++ b/man/rpc_soc.3t -@@ -72,8 +72,6 @@ - .Nm xprt_register , - .Nm xprt_unregister - .Nd "library routines for remote procedure calls" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Pp -@@ -1707,6 +1705,8 @@ This routine modifies the global variable - .Va svc_fds . - Service implementors usually do not need this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc_secure 3 , - .Xr xdr 3 -diff --git a/man/rpc_svc_calls.3t b/man/rpc_svc_calls.3t -index 582b45d..4b3c08b 100644 ---- a/man/rpc_svc_calls.3t -+++ b/man/rpc_svc_calls.3t -@@ -21,8 +21,6 @@ - .Nm svc_run , - .Nm svc_sendreply - .Nd library routines for RPC servers --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft int -@@ -258,6 +256,8 @@ if it succeeds, - .Dv FALSE - otherwise. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr poll 2 , - .Xr select 2 , -diff --git a/man/rpc_svc_create.3t b/man/rpc_svc_create.3t -index d47be2b..6e28d2e 100644 ---- a/man/rpc_svc_create.3t -+++ b/man/rpc_svc_create.3t -@@ -18,8 +18,6 @@ - .Nm svc_tp_create , - .Nm svc_vc_create - .Nd library routines for the creation of server handles --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -329,6 +327,8 @@ The server is not registered with the - .Xr rpcbind 8 - service. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rpc_svc_err.3t b/man/rpc_svc_err.3t -index 49139cb..ffc7f53 100644 ---- a/man/rpc_svc_err.3t -+++ b/man/rpc_svc_err.3t -@@ -17,8 +17,6 @@ - .Nm svcerr_systemerr , - .Nm svcerr_weakauth - .Nd library routines for server side remote procedure call errors --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft void -@@ -90,6 +88,8 @@ authentication arguments. - The routine calls - .Fn svcerr_auth "xprt" "AUTH_TOOWEAK" . - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rpc_svc_reg.3t b/man/rpc_svc_reg.3t -index 56dd530..e74f7fc 100644 ---- a/man/rpc_svc_reg.3t -+++ b/man/rpc_svc_reg.3t -@@ -16,8 +16,6 @@ - .Nm xprt_register , - .Nm xprt_unregister - .Nd library routines for registering servers --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft int -@@ -173,6 +171,8 @@ This routine modifies the global variable - .Xr rpc_svc_calls 3 ) . - Service implementors usually do not need this routine. - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr select 2 , - .Xr rpc 3 , -diff --git a/man/rpc_xdr.3t b/man/rpc_xdr.3t -index feb708b..ae3d663 100644 ---- a/man/rpc_xdr.3t -+++ b/man/rpc_xdr.3t -@@ -15,8 +15,6 @@ - .Nm xdr_rejected_reply , - .Nm xdr_replymsg - .Nd XDR library routines for remote procedure calls --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft bool_t -@@ -96,6 +94,8 @@ This reply could be either an acceptance, - rejection or - .Dv NULL . - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc 3 , - .Xr xdr 3 -diff --git a/man/rpcbind.3t b/man/rpcbind.3t -index 99b03cf..ec492cc 100644 ---- a/man/rpcbind.3t -+++ b/man/rpcbind.3t -@@ -14,8 +14,6 @@ - .Nm rpcb_set , - .Nm rpcb_unset - .Nd library routines for RPC bind service --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In rpc/rpc.h - .Ft "rpcblist *" -@@ -187,6 +185,8 @@ Only the owner of the service or the super-user can destroy the mapping. - in - .Xr rpc_svc_calls 3 . ) - .El -+.Sh AVAILABILITY -+These functions are part of libtirpc. - .Sh SEE ALSO - .Xr rpc_clnt_calls 3 , - .Xr rpc_svc_calls 3 , -diff --git a/man/rtime.3t b/man/rtime.3t -index 6e61350..bc93af6 100644 ---- a/man/rtime.3t -+++ b/man/rtime.3t -@@ -7,8 +7,6 @@ - .Sh NAME - .Nm rtime - .Nd "get remote time" --.Sh LIBRARY --.Lb libc - .Sh SYNOPSIS - .In sys/types.h - .In sys/time.h -@@ -46,5 +44,7 @@ however, the routine will instead use - and block until a reply is received from the time server. - .Sh RETURN VALUES - .Rv -std rtime --.Sh SEE ALSO --.Xr timed 8 -+.Sh AVAILABILITY -+The -+.Fn rtime -+function is part of libtirpc. -diff --git a/src/auth_gss.c b/src/auth_gss.c -index 703bc3f..fd6191b 100644 ---- a/src/auth_gss.c -+++ b/src/auth_gss.c -@@ -49,14 +49,14 @@ - #include - #include - --static void authgss_nextverf(); --static bool_t authgss_marshal(); --static bool_t authgss_refresh(); --static bool_t authgss_validate(); --static void authgss_destroy(); --static void authgss_destroy_context(); --static bool_t authgss_wrap(); --static bool_t authgss_unwrap(); -+static void authgss_nextverf(AUTH *); -+static bool_t authgss_marshal(AUTH *, XDR *); -+static bool_t authgss_refresh(AUTH *, void *); -+static bool_t authgss_validate(AUTH *, struct opaque_auth *); -+static void authgss_destroy(AUTH *); -+static void authgss_destroy_context(AUTH *); -+static bool_t authgss_wrap(AUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t authgss_unwrap(AUTH *, XDR *, xdrproc_t, caddr_t); - - - /* -@@ -198,7 +198,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec) - save_auth = clnt->cl_auth; - clnt->cl_auth = auth; - -- if (!authgss_refresh(auth)) -+ if (!authgss_refresh(auth, NULL)) - auth = NULL; - else - auth_get(auth); /* Reference for caller */ -@@ -418,7 +418,7 @@ authgss_validate(AUTH *auth, struct opaque_auth *verf) - } - - static bool_t --authgss_refresh(AUTH *auth) -+authgss_refresh(AUTH *auth, void *dummy) - { - struct rpc_gss_data *gd; - struct rpc_gss_init_res gr; -@@ -639,7 +639,7 @@ authgss_destroy(AUTH *auth) - free(auth); - } - --bool_t -+static bool_t - authgss_wrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct rpc_gss_data *gd; -@@ -656,7 +656,7 @@ authgss_wrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - gd->sec.svc, gd->gc.gc_seq)); - } - --bool_t -+static bool_t - authgss_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct rpc_gss_data *gd; -diff --git a/src/clnt_simple.c b/src/clnt_simple.c -index e66da6a..7ee9542 100644 ---- a/src/clnt_simple.c -+++ b/src/clnt_simple.c -@@ -104,9 +104,9 @@ rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) - extern thread_key_t rpc_call_key; - extern mutex_t tsd_lock; - -- if (rpc_call_key == -1) { -+ if (rpc_call_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (rpc_call_key == -1) -+ if (rpc_call_key == KEY_INITIALIZER) - thr_keycreate(&rpc_call_key, rpc_call_destroy); - mutex_unlock(&tsd_lock); - } -diff --git a/src/getnetconfig.c b/src/getnetconfig.c -index 78de0f6..635c03a 100644 ---- a/src/getnetconfig.c -+++ b/src/getnetconfig.c -@@ -137,10 +137,10 @@ __nc_error() - * (including non-threaded programs), or if an allocation - * fails. - */ -- if (nc_key == -1) { -+ if (nc_key == KEY_INITIALIZER) { - error = 0; - mutex_lock(&nc_lock); -- if (nc_key == -1) -+ if (nc_key == KEY_INITIALIZER) - error = thr_keycreate(&nc_key, free); - mutex_unlock(&nc_lock); - if (error) -diff --git a/src/mt_misc.c b/src/mt_misc.c -index d459dec..093086e 100644 ---- a/src/mt_misc.c -+++ b/src/mt_misc.c -@@ -78,12 +78,12 @@ pthread_mutex_t svcraw_lock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_t tsd_lock = PTHREAD_MUTEX_INITIALIZER; - - /* Library global tsd keys */ --thread_key_t clnt_broadcast_key; --thread_key_t rpc_call_key = -1; --thread_key_t tcp_key = -1; --thread_key_t udp_key = -1; --thread_key_t nc_key = -1; --thread_key_t rce_key = -1; -+thread_key_t clnt_broadcast_key = KEY_INITIALIZER; -+thread_key_t rpc_call_key = KEY_INITIALIZER; -+thread_key_t tcp_key = KEY_INITIALIZER; -+thread_key_t udp_key = KEY_INITIALIZER; -+thread_key_t nc_key = KEY_INITIALIZER; -+thread_key_t rce_key = KEY_INITIALIZER; - - /* xprtlist (svc_generic.c) */ - pthread_mutex_t xprtlist_lock = PTHREAD_MUTEX_INITIALIZER; -@@ -110,7 +110,7 @@ __rpc_createerr() - struct rpc_createerr *rce_addr; - - mutex_lock(&tsd_lock); -- if (rce_key == -1) -+ if (rce_key == KEY_INITIALIZER) - thr_keycreate(&rce_key, free); - mutex_unlock(&tsd_lock); - -@@ -131,17 +131,17 @@ __rpc_createerr() - - void tsd_key_delete(void) - { -- if (clnt_broadcast_key != -1) -+ if (clnt_broadcast_key != KEY_INITIALIZER) - pthread_key_delete(clnt_broadcast_key); -- if (rpc_call_key != -1) -+ if (rpc_call_key != KEY_INITIALIZER) - pthread_key_delete(rpc_call_key); -- if (tcp_key != -1) -+ if (tcp_key != KEY_INITIALIZER) - pthread_key_delete(tcp_key); -- if (udp_key != -1) -+ if (udp_key != KEY_INITIALIZER) - pthread_key_delete(udp_key); -- if (nc_key != -1) -+ if (nc_key != KEY_INITIALIZER) - pthread_key_delete(nc_key); -- if (rce_key != -1) -+ if (rce_key != KEY_INITIALIZER) - pthread_key_delete(rce_key); - return; - } -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index 2eb91ad..a43906c 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -228,16 +228,16 @@ __rpc_getconfip(nettype) - extern thread_key_t tcp_key, udp_key; - extern mutex_t tsd_lock; - -- if (tcp_key == -1) { -+ if (tcp_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (tcp_key == -1) -+ if (tcp_key == KEY_INITIALIZER) - thr_keycreate(&tcp_key, free); - mutex_unlock(&tsd_lock); - } - netid_tcp = (char *)thr_getspecific(tcp_key); -- if (udp_key == -1) { -+ if (udp_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (udp_key == -1) -+ if (udp_key == KEY_INITIALIZER) - thr_keycreate(&udp_key, free); - mutex_unlock(&tsd_lock); - } -diff --git a/src/rpc_soc.c b/src/rpc_soc.c -index 4213ca0..338edbb 100644 ---- a/src/rpc_soc.c -+++ b/src/rpc_soc.c -@@ -508,9 +508,9 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - { - extern mutex_t tsd_lock; - -- if (clnt_broadcast_key == -1) { -+ if (clnt_broadcast_key == KEY_INITIALIZER) { - mutex_lock(&tsd_lock); -- if (clnt_broadcast_key == -1) -+ if (clnt_broadcast_key == KEY_INITIALIZER) - thr_keycreate(&clnt_broadcast_key, free); - mutex_unlock(&tsd_lock); - } -diff --git a/src/svc.c b/src/svc.c -index 08cd6c9..8afd15d 100644 ---- a/src/svc.c -+++ b/src/svc.c -@@ -649,6 +649,7 @@ svc_getreq_common (fd) - { - if (SVC_RECV (xprt, &msg)) - { -+ bool_t no_dispatch; - - /* now find the exported program and call it */ - struct svc_callout *s; -@@ -660,11 +661,14 @@ svc_getreq_common (fd) - r.rq_proc = msg.rm_call.cb_proc; - r.rq_cred = msg.rm_call.cb_cred; - /* first authenticate the message */ -- if ((why = _authenticate (&r, &msg)) != AUTH_OK) -+ why = _gss_authenticate(&r, &msg, &no_dispatch); -+ if (why != AUTH_OK) - { - svcerr_auth (xprt, why); - goto call_done; - } -+ if (no_dispatch) -+ goto call_done; - /* now match message with a registered service */ - prog_found = FALSE; - low_vers = (rpcvers_t) - 1L; -diff --git a/src/svc_auth.c b/src/svc_auth.c -index e80d5f9..31241c9 100644 ---- a/src/svc_auth.c -+++ b/src/svc_auth.c -@@ -82,9 +82,10 @@ static struct authsvc *Auths = NULL; - * invalid. - */ - enum auth_stat --_authenticate(rqst, msg) -+_gss_authenticate(rqst, msg, no_dispatch) - struct svc_req *rqst; - struct rpc_msg *msg; -+ bool_t *no_dispatch; - { - int cred_flavor; - struct authsvc *asp; -@@ -97,6 +98,7 @@ _authenticate(rqst, msg) - rqst->rq_xprt->xp_verf.oa_flavor = _null_auth.oa_flavor; - rqst->rq_xprt->xp_verf.oa_length = 0; - cred_flavor = rqst->rq_cred.oa_flavor; -+ *no_dispatch = FALSE; - switch (cred_flavor) { - case AUTH_NONE: - dummy = _svcauth_none(rqst, msg); -@@ -112,6 +114,11 @@ _authenticate(rqst, msg) - dummy = _svcauth_des(rqst, msg); - return (dummy); - #endif -+#ifdef HAVE_RPCSEC_GSS -+ case RPCSEC_GSS: -+ dummy = _svcauth_gss(rqst, msg, no_dispatch); -+ return (dummy); -+#endif - default: - break; - } -@@ -132,6 +139,13 @@ _authenticate(rqst, msg) - return (AUTH_REJECTEDCRED); - } - -+enum auth_stat -+_authenticate(struct svc_req *rqst, struct rpc_msg *msg) -+{ -+ bool_t no_dispatch; -+ return _gss_authenticate(rqst, msg, &no_dispatch); -+} -+ - /* - * Allow the rpc service to register new authentication types that it is - * prepared to handle. When an authentication flavor is registered, -@@ -161,6 +175,9 @@ svc_auth_reg(cred_flavor, handler) - #ifdef DES_BUILTIN - case AUTH_DES: - #endif -+#ifdef HAVE_RPCSEC_GSS -+ case RPCSEC_GSS: -+#endif - /* already registered */ - return (1); - -diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c -index 9c74313..26c1065 100644 ---- a/src/svc_auth_gss.c -+++ b/src/svc_auth_gss.c -@@ -53,11 +53,11 @@ typedef struct gss_union_ctx_id_t { - - - --static bool_t svcauth_gss_destroy(); --static bool_t svcauth_gss_wrap(); --static bool_t svcauth_gss_unwrap(); -+static bool_t svcauth_gss_wrap(SVCAUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t svcauth_gss_unwrap(SVCAUTH *, XDR *, xdrproc_t, caddr_t); -+static bool_t svcauth_gss_destroy(SVCAUTH *); - --struct svc_auth_ops svc_auth_gss_ops = { -+static struct svc_auth_ops svc_auth_gss_ops = { - svcauth_gss_wrap, - svcauth_gss_unwrap, - svcauth_gss_destroy -@@ -79,7 +79,7 @@ struct svc_rpc_gss_data { - ((struct svc_rpc_gss_data *)(auth)->svc_ah_private) - - /* Global server credentials. */ --gss_cred_id_t _svcauth_gss_creds; -+static gss_cred_id_t _svcauth_gss_creds; - static gss_name_t _svcauth_gss_name = NULL; - - bool_t -@@ -286,21 +286,19 @@ svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) - struct opaque_auth *oa; - gss_buffer_desc rpcbuf, checksum; - OM_uint32 maj_stat, min_stat, qop_state; -- u_char rpchdr[128]; -+ u_char *rpchdr; - int32_t *buf; - - gss_log_debug("in svcauth_gss_validate()"); - -- memset(rpchdr, 0, sizeof(rpchdr)); -- - /* XXX - Reconstruct RPC header for signing (from xdr_callmsg). */ - oa = &msg->rm_call.cb_cred; - if (oa->oa_length > MAX_AUTH_BYTES) - return (FALSE); -- -- /* 8 XDR units from the IXDR macro calls. */ -- if (sizeof(rpchdr) < (8 * BYTES_PER_XDR_UNIT + -- RNDUP(oa->oa_length))) -+ -+ rpchdr = (u_char *)calloc(((8 * BYTES_PER_XDR_UNIT) + -+ RNDUP(oa->oa_length)), 1); -+ if (rpchdr == NULL) - return (FALSE); - - buf = (int32_t *)rpchdr; -@@ -325,6 +323,8 @@ svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) - maj_stat = gss_verify_mic(&min_stat, gd->ctx, &rpcbuf, &checksum, - &qop_state); - -+ free(rpchdr); -+ - if (maj_stat != GSS_S_COMPLETE) { - gss_log_status("gss_verify_mic", maj_stat, min_stat); - return (FALSE); -@@ -332,7 +332,7 @@ svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) - return (TRUE); - } - --bool_t -+static bool_t - svcauth_gss_nextverf(struct svc_req *rqst, u_int num) - { - struct svc_rpc_gss_data *gd; -@@ -513,7 +513,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch) - return (AUTH_OK); - } - --bool_t -+static bool_t - svcauth_gss_destroy(SVCAUTH *auth) - { - struct svc_rpc_gss_data *gd; -@@ -535,7 +535,7 @@ svcauth_gss_destroy(SVCAUTH *auth) - return (TRUE); - } - --bool_t -+static bool_t - svcauth_gss_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct svc_rpc_gss_data *gd; -@@ -552,7 +552,7 @@ svcauth_gss_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - gd->sec.svc, gd->seq)); - } - --bool_t -+static bool_t - svcauth_gss_unwrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) - { - struct svc_rpc_gss_data *gd; -diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h -index 9489b15..5f5c96e 100644 ---- a/tirpc/reentrant.h -+++ b/tirpc/reentrant.h -@@ -46,6 +46,8 @@ - #define once_t pthread_once_t - - #define thread_key_t pthread_key_t -+ -+#define KEY_INITIALIZER ((thread_key_t)-1) - #define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - #define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER - #define ONCE_INITIALIZER PTHREAD_ONCE_INIT -diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h -index 4ce11f0..7c8f813 100644 ---- a/tirpc/rpc/auth.h -+++ b/tirpc/rpc/auth.h -@@ -399,6 +399,7 @@ struct rpc_msg; - enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *); - enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); - enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); -+enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *); - __END_DECLS - - #define AUTH_NONE 0 /* no authentication */ -diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h -index 14269d1..723c989 100644 ---- a/tirpc/rpc/svc_auth.h -+++ b/tirpc/rpc/svc_auth.h -@@ -66,6 +66,8 @@ typedef struct SVCAUTH { - * Server side authenticator - */ - __BEGIN_DECLS -+extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *, -+ bool_t *); - extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); - extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *, - struct rpc_msg *)); diff --git a/libtirpc-0.2.6-rc2.patch b/libtirpc-0.2.6-rc2.patch deleted file mode 100644 index bbb2cbd..0000000 --- a/libtirpc-0.2.6-rc2.patch +++ /dev/null @@ -1,270 +0,0 @@ -diff --git a/INSTALL b/INSTALL -index 8b641e3..f812f5a 120000 ---- a/INSTALL -+++ b/INSTALL -@@ -1 +1 @@ --/usr/share/automake-1.13/INSTALL -\ No newline at end of file -+/usr/share/automake-1.14/INSTALL -\ No newline at end of file -diff --git a/configure.ac b/configure.ac -index bcbe911..10d17ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,4 +1,4 @@ --AC_INIT(libtirpc, 0.2.5) -+AC_INIT(libtirpc, 0.2.4) - AM_INIT_AUTOMAKE([silent-rules]) - AM_SILENT_RULES([yes]) - AC_CONFIG_SRCDIR([src/auth_des.c]) -diff --git a/libtirpc.pc.in b/libtirpc.pc.in -index ec4cf75..38034c5 100644 ---- a/libtirpc.pc.in -+++ b/libtirpc.pc.in -@@ -8,4 +8,5 @@ Description: Transport Independent RPC Library - Requires: - Version: @PACKAGE_VERSION@ - Libs: -L@libdir@ -ltirpc -+Libs.private: -lpthread - Cflags: -I@includedir@/tirpc -diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c -index 373d8a5..ddcb694 100644 ---- a/src/clnt_bcast.c -+++ b/src/clnt_bcast.c -@@ -142,7 +142,8 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list) - return 0; - - for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { -- if (ifap->ifa_addr->sa_family != af || -+ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */ -+ ifap->ifa_addr->sa_family != af || - !(ifap->ifa_flags & IFF_UP)) - continue; - bip = (struct broadif *)malloc(sizeof *bip); -@@ -588,9 +589,11 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, - LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp)); - np = uaddr2taddr( - fdlist[i].nconf, uaddrp); -- done = (*eachresult)(resultsp, -- np, fdlist[i].nconf); -- free(np); -+ if (np != NULL) { -+ done = (*eachresult)(resultsp, -+ np, fdlist[i].nconf); -+ free(np); -+ } - #ifdef PORTMAP - } - #endif /* PORTMAP */ -diff --git a/src/debug.h b/src/debug.h -index afc8d57..c971ac3 100644 ---- a/src/debug.h -+++ b/src/debug.h -@@ -21,6 +21,8 @@ - - #ifndef _DEBUG_H - #define _DEBUG_H -+ -+#include - #include - - extern int libtirpc_debug_level; -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index a43906c..764a25c 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -608,6 +608,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - struct sockaddr_in6 *sin6; - char namebuf6[INET6_ADDRSTRLEN]; - #endif -+ int path_len; - u_int16_t port; - - if (nbuf->len <= 0) -@@ -638,13 +639,12 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - #endif - case AF_LOCAL: - sun = nbuf->buf; -- /* if (asprintf(&ret, "%.*s", (int)(sun->sun_len - -- offsetof(struct sockaddr_un, sun_path)), -- sun->sun_path) < 0)*/ -- if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) - -- offsetof(struct sockaddr_un, sun_path)), -- sun->sun_path) < 0) - -+ path_len = nbuf->len - offsetof(struct sockaddr_un, sun_path); -+ if (path_len < 0) -+ return NULL; -+ -+ if (asprintf(&ret, "%.*s", path_len, sun->sun_path) < 0) - return (NULL); - break; - default: -diff --git a/src/rpc_soc.c b/src/rpc_soc.c -index 338edbb..e146ed4 100644 ---- a/src/rpc_soc.c -+++ b/src/rpc_soc.c -@@ -564,16 +564,12 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - u_int sendsz; - u_int recvsz; - { -- struct netbuf *svcaddr; -- CLIENT *cl; -+ struct netbuf svcaddr = {0, 0, NULL}; -+ CLIENT *cl = NULL; - int len; - -- cl = NULL; -- svcaddr = NULL; -- if (((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) || -- ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) { -- if (svcaddr != NULL) -- free(svcaddr); -+ memset(&svcaddr, 0, sizeof(svcaddr)); -+ if (__rpc_set_netbuf(&svcaddr, raddr, sizeof(*raddr)) == NULL) { - rpc_createerr.cf_stat = RPC_SYSTEMERROR; - rpc_createerr.cf_error.re_errno = errno; - return(cl); -@@ -590,14 +586,10 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - goto done; - } - } -- svcaddr->buf = raddr; -- svcaddr->len = sizeof(raddr); -- svcaddr->maxlen = sizeof (struct sockaddr_un); -- cl = clnt_vc_create(*sockp, svcaddr, prog, -+ cl = clnt_vc_create(*sockp, &svcaddr, prog, - vers, sendsz, recvsz); - done: -- free(svcaddr->buf); -- free(svcaddr); -+ free(svcaddr.buf); - return(cl); - } - -diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c -index a796593..f1c71a2 100644 ---- a/src/rpcb_clnt.c -+++ b/src/rpcb_clnt.c -@@ -401,6 +401,44 @@ out_err: - return (client); - } - -+/* -+ * Create a PMAP client handle. -+ */ -+static CLIENT * -+getpmaphandle(nconf, hostname, tgtaddr) -+ const struct netconfig *nconf; -+ const char *hostname; -+ char **tgtaddr; -+{ -+ CLIENT *client = NULL; -+ rpcvers_t pmapvers = 2; -+ -+ /* -+ * Try UDP only - there are some portmappers out -+ * there that use UDP only. -+ */ -+ if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) { -+ struct netconfig *newnconf; -+ -+ if ((newnconf = getnetconfigent("udp")) == NULL) { -+ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; -+ return NULL; -+ } -+ client = getclnthandle(hostname, newnconf, tgtaddr); -+ freenetconfigent(newnconf); -+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) { -+ if (strcmp(nconf->nc_protofmly, NC_INET) != 0) -+ return NULL; -+ client = getclnthandle(hostname, nconf, tgtaddr); -+ } -+ -+ /* Set version */ -+ if (client != NULL) -+ CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); -+ -+ return client; -+} -+ - /* XXX */ - #define IN4_LOCALHOST_STRING "127.0.0.1" - #define IN6_LOCALHOST_STRING "::1" -@@ -733,34 +771,20 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - u_short port = 0; - struct netbuf remote; -- rpcvers_t pmapvers = 2; - struct pmap pmapparms; - -- /* -- * Try UDP only - there are some portmappers out -- * there that use UDP only. -- */ -- if (strcmp(nconf->nc_proto, NC_TCP) == 0) { -- struct netconfig *newnconf; -- -- if ((newnconf = getnetconfigent("udp")) == NULL) { -- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; -- return (NULL); -- } -- client = getclnthandle(host, newnconf, &parms.r_addr); -- freenetconfigent(newnconf); -- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) -- client = getclnthandle(host, nconf, &parms.r_addr); -- else -+ if (strcmp(nconf->nc_proto, NC_UDP) != 0 -+ && strcmp(nconf->nc_proto, NC_TCP) != 0) - goto try_rpcbind; -+ -+ client = getpmaphandle(nconf, host, &parms.r_addr); - if (client == NULL) - return (NULL); - - /* -- * Set version and retry timeout. -+ * Set retry timeout. - */ - CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime); -- CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); - - pmapparms.pm_prog = program; - pmapparms.pm_vers = version; -diff --git a/src/svc_vc.c b/src/svc_vc.c -index 4c70de8..4d3ea51 100644 ---- a/src/svc_vc.c -+++ b/src/svc_vc.c -@@ -559,20 +559,19 @@ write_vc(xprtp, buf, len) - cd->strm_stat = XPRT_DIED; - return (-1); - } -- if (cd->nonblock && i != cnt) { -- /* -- * For non-blocking connections, do not -- * take more than 2 seconds writing the -- * data out. -- * -- * XXX 2 is an arbitrary amount. -- */ -- gettimeofday(&tv1, NULL); -- if (tv1.tv_sec - tv0.tv_sec >= 2) { -- cd->strm_stat = XPRT_DIED; -- return (-1); -- } -+ /* -+ * For non-blocking connections, do not -+ * take more than 2 seconds writing the -+ * data out. -+ * -+ * XXX 2 is an arbitrary amount. -+ */ -+ gettimeofday(&tv1, NULL); -+ if (tv1.tv_sec - tv0.tv_sec >= 2) { -+ cd->strm_stat = XPRT_DIED; -+ return (-1); - } -+ i = 0; /* Don't change buf and cnt */ - } - } - diff --git a/libtirpc-0.2.6-rc3.patch b/libtirpc-0.2.6-rc3.patch deleted file mode 100644 index 5df66ef..0000000 --- a/libtirpc-0.2.6-rc3.patch +++ /dev/null @@ -1,2721 +0,0 @@ -diff --git a/HACKING b/HACKING -new file mode 100644 -index 0000000..d562427 ---- /dev/null -+++ b/HACKING -@@ -0,0 +1,2 @@ -+Patches can be sent to libtirpc-devel@lists.sourceforge.net with a CC -+to linux-nfs@vger.kernel.org -diff --git a/INSTALL b/INSTALL -new file mode 100644 -index 0000000..2099840 ---- /dev/null -+++ b/INSTALL -@@ -0,0 +1,370 @@ -+Installation Instructions -+************************* -+ -+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -+Inc. -+ -+ Copying and distribution of this file, with or without modification, -+are permitted in any medium without royalty provided the copyright -+notice and this notice are preserved. This file is offered as-is, -+without warranty of any kind. -+ -+Basic Installation -+================== -+ -+ Briefly, the shell command `./configure && make && make install' -+should configure, build, and install this package. The following -+more-detailed instructions are generic; see the `README' file for -+instructions specific to this package. Some packages provide this -+`INSTALL' file but do not implement all of the features documented -+below. The lack of an optional feature in a given package is not -+necessarily a bug. More recommendations for GNU packages can be found -+in *note Makefile Conventions: (standards)Makefile Conventions. -+ -+ The `configure' shell script attempts to guess correct values for -+various system-dependent variables used during compilation. It uses -+those values to create a `Makefile' in each directory of the package. -+It may also create one or more `.h' files containing system-dependent -+definitions. Finally, it creates a shell script `config.status' that -+you can run in the future to recreate the current configuration, and a -+file `config.log' containing compiler output (useful mainly for -+debugging `configure'). -+ -+ It can also use an optional file (typically called `config.cache' -+and enabled with `--cache-file=config.cache' or simply `-C') that saves -+the results of its tests to speed up reconfiguring. Caching is -+disabled by default to prevent problems with accidental use of stale -+cache files. -+ -+ If you need to do unusual things to compile the package, please try -+to figure out how `configure' could check whether to do them, and mail -+diffs or instructions to the address given in the `README' so they can -+be considered for the next release. If you are using the cache, and at -+some point `config.cache' contains results you don't want to keep, you -+may remove or edit it. -+ -+ The file `configure.ac' (or `configure.in') is used to create -+`configure' by a program called `autoconf'. You need `configure.ac' if -+you want to change it or regenerate `configure' using a newer version -+of `autoconf'. -+ -+ The simplest way to compile this package is: -+ -+ 1. `cd' to the directory containing the package's source code and type -+ `./configure' to configure the package for your system. -+ -+ Running `configure' might take a while. While running, it prints -+ some messages telling which features it is checking for. -+ -+ 2. Type `make' to compile the package. -+ -+ 3. Optionally, type `make check' to run any self-tests that come with -+ the package, generally using the just-built uninstalled binaries. -+ -+ 4. Type `make install' to install the programs and any data files and -+ documentation. When installing into a prefix owned by root, it is -+ recommended that the package be configured and built as a regular -+ user, and only the `make install' phase executed with root -+ privileges. -+ -+ 5. Optionally, type `make installcheck' to repeat any self-tests, but -+ this time using the binaries in their final installed location. -+ This target does not install anything. Running this target as a -+ regular user, particularly if the prior `make install' required -+ root privileges, verifies that the installation completed -+ correctly. -+ -+ 6. You can remove the program binaries and object files from the -+ source code directory by typing `make clean'. To also remove the -+ files that `configure' created (so you can compile the package for -+ a different kind of computer), type `make distclean'. There is -+ also a `make maintainer-clean' target, but that is intended mainly -+ for the package's developers. If you use it, you may have to get -+ all sorts of other programs in order to regenerate files that came -+ with the distribution. -+ -+ 7. Often, you can also type `make uninstall' to remove the installed -+ files again. In practice, not all packages have tested that -+ uninstallation works correctly, even though it is required by the -+ GNU Coding Standards. -+ -+ 8. Some packages, particularly those that use Automake, provide `make -+ distcheck', which can by used by developers to test that all other -+ targets like `make install' and `make uninstall' work correctly. -+ This target is generally not run by end users. -+ -+Compilers and Options -+===================== -+ -+ Some systems require unusual options for compilation or linking that -+the `configure' script does not know about. Run `./configure --help' -+for details on some of the pertinent environment variables. -+ -+ You can give `configure' initial values for configuration parameters -+by setting variables in the command line or in the environment. Here -+is an example: -+ -+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix -+ -+ *Note Defining Variables::, for more details. -+ -+Compiling For Multiple Architectures -+==================================== -+ -+ You can compile the package for more than one kind of computer at the -+same time, by placing the object files for each architecture in their -+own directory. To do this, you can use GNU `make'. `cd' to the -+directory where you want the object files and executables to go and run -+the `configure' script. `configure' automatically checks for the -+source code in the directory that `configure' is in and in `..'. This -+is known as a "VPATH" build. -+ -+ With a non-GNU `make', it is safer to compile the package for one -+architecture at a time in the source code directory. After you have -+installed the package for one architecture, use `make distclean' before -+reconfiguring for another architecture. -+ -+ On MacOS X 10.5 and later systems, you can create libraries and -+executables that work on multiple system types--known as "fat" or -+"universal" binaries--by specifying multiple `-arch' options to the -+compiler but only a single `-arch' option to the preprocessor. Like -+this: -+ -+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ -+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ -+ CPP="gcc -E" CXXCPP="g++ -E" -+ -+ This is not guaranteed to produce working output in all cases, you -+may have to build one architecture at a time and combine the results -+using the `lipo' tool if you have problems. -+ -+Installation Names -+================== -+ -+ By default, `make install' installs the package's commands under -+`/usr/local/bin', include files under `/usr/local/include', etc. You -+can specify an installation prefix other than `/usr/local' by giving -+`configure' the option `--prefix=PREFIX', where PREFIX must be an -+absolute file name. -+ -+ You can specify separate installation prefixes for -+architecture-specific files and architecture-independent files. If you -+pass the option `--exec-prefix=PREFIX' to `configure', the package uses -+PREFIX as the prefix for installing programs and libraries. -+Documentation and other data files still use the regular prefix. -+ -+ In addition, if you use an unusual directory layout you can give -+options like `--bindir=DIR' to specify different values for particular -+kinds of files. Run `configure --help' for a list of the directories -+you can set and what kinds of files go in them. In general, the -+default for these options is expressed in terms of `${prefix}', so that -+specifying just `--prefix' will affect all of the other directory -+specifications that were not explicitly provided. -+ -+ The most portable way to affect installation locations is to pass the -+correct locations to `configure'; however, many packages provide one or -+both of the following shortcuts of passing variable assignments to the -+`make install' command line to change installation locations without -+having to reconfigure or recompile. -+ -+ The first method involves providing an override variable for each -+affected directory. For example, `make install -+prefix=/alternate/directory' will choose an alternate location for all -+directory configuration variables that were expressed in terms of -+`${prefix}'. Any directories that were specified during `configure', -+but not in terms of `${prefix}', must each be overridden at install -+time for the entire installation to be relocated. The approach of -+makefile variable overrides for each directory variable is required by -+the GNU Coding Standards, and ideally causes no recompilation. -+However, some platforms have known limitations with the semantics of -+shared libraries that end up requiring recompilation when using this -+method, particularly noticeable in packages that use GNU Libtool. -+ -+ The second method involves providing the `DESTDIR' variable. For -+example, `make install DESTDIR=/alternate/directory' will prepend -+`/alternate/directory' before all installation names. The approach of -+`DESTDIR' overrides is not required by the GNU Coding Standards, and -+does not work on platforms that have drive letters. On the other hand, -+it does better at avoiding recompilation issues, and works well even -+when some directory options were not specified in terms of `${prefix}' -+at `configure' time. -+ -+Optional Features -+================= -+ -+ If the package supports it, you can cause programs to be installed -+with an extra prefix or suffix on their names by giving `configure' the -+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -+ -+ Some packages pay attention to `--enable-FEATURE' options to -+`configure', where FEATURE indicates an optional part of the package. -+They may also pay attention to `--with-PACKAGE' options, where PACKAGE -+is something like `gnu-as' or `x' (for the X Window System). The -+`README' should mention any `--enable-' and `--with-' options that the -+package recognizes. -+ -+ For packages that use the X Window System, `configure' can usually -+find the X include and library files automatically, but if it doesn't, -+you can use the `configure' options `--x-includes=DIR' and -+`--x-libraries=DIR' to specify their locations. -+ -+ Some packages offer the ability to configure how verbose the -+execution of `make' will be. For these packages, running `./configure -+--enable-silent-rules' sets the default to minimal output, which can be -+overridden with `make V=1'; while running `./configure -+--disable-silent-rules' sets the default to verbose, which can be -+overridden with `make V=0'. -+ -+Particular systems -+================== -+ -+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU -+CC is not installed, it is recommended to use the following options in -+order to use an ANSI C compiler: -+ -+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" -+ -+and if that doesn't work, install pre-built binaries of GCC for HP-UX. -+ -+ HP-UX `make' updates targets which have the same time stamps as -+their prerequisites, which makes it generally unusable when shipped -+generated files such as `configure' are involved. Use GNU `make' -+instead. -+ -+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -+parse its `' header file. The option `-nodtk' can be used as -+a workaround. If GNU CC is not installed, it is therefore recommended -+to try -+ -+ ./configure CC="cc" -+ -+and if that doesn't work, try -+ -+ ./configure CC="cc -nodtk" -+ -+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This -+directory contains several dysfunctional programs; working variants of -+these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -+in your `PATH', put it _after_ `/usr/bin'. -+ -+ On Haiku, software installed for all users goes in `/boot/common', -+not `/usr/local'. It is recommended to use the following options: -+ -+ ./configure --prefix=/boot/common -+ -+Specifying the System Type -+========================== -+ -+ There may be some features `configure' cannot figure out -+automatically, but needs to determine by the type of machine the package -+will run on. Usually, assuming the package is built to be run on the -+_same_ architectures, `configure' can figure that out, but if it prints -+a message saying it cannot guess the machine type, give it the -+`--build=TYPE' option. TYPE can either be a short name for the system -+type, such as `sun4', or a canonical name which has the form: -+ -+ CPU-COMPANY-SYSTEM -+ -+where SYSTEM can have one of these forms: -+ -+ OS -+ KERNEL-OS -+ -+ See the file `config.sub' for the possible values of each field. If -+`config.sub' isn't included in this package, then this package doesn't -+need to know the machine type. -+ -+ If you are _building_ compiler tools for cross-compiling, you should -+use the option `--target=TYPE' to select the type of system they will -+produce code for. -+ -+ If you want to _use_ a cross compiler, that generates code for a -+platform different from the build platform, you should specify the -+"host" platform (i.e., that on which the generated programs will -+eventually be run) with `--host=TYPE'. -+ -+Sharing Defaults -+================ -+ -+ If you want to set default values for `configure' scripts to share, -+you can create a site shell script called `config.site' that gives -+default values for variables like `CC', `cache_file', and `prefix'. -+`configure' looks for `PREFIX/share/config.site' if it exists, then -+`PREFIX/etc/config.site' if it exists. Or, you can set the -+`CONFIG_SITE' environment variable to the location of the site script. -+A warning: not all `configure' scripts look for a site script. -+ -+Defining Variables -+================== -+ -+ Variables not defined in a site shell script can be set in the -+environment passed to `configure'. However, some packages may run -+configure again during the build, and the customized values of these -+variables may be lost. In order to avoid this problem, you should set -+them in the `configure' command line, using `VAR=value'. For example: -+ -+ ./configure CC=/usr/local2/bin/gcc -+ -+causes the specified `gcc' to be used as the C compiler (unless it is -+overridden in the site shell script). -+ -+Unfortunately, this technique does not work for `CONFIG_SHELL' due to -+an Autoconf limitation. Until the limitation is lifted, you can use -+this workaround: -+ -+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -+ -+`configure' Invocation -+====================== -+ -+ `configure' recognizes the following options to control how it -+operates. -+ -+`--help' -+`-h' -+ Print a summary of all of the options to `configure', and exit. -+ -+`--help=short' -+`--help=recursive' -+ Print a summary of the options unique to this package's -+ `configure', and exit. The `short' variant lists options used -+ only in the top level, while the `recursive' variant lists options -+ also present in any nested packages. -+ -+`--version' -+`-V' -+ Print the version of Autoconf used to generate the `configure' -+ script, and exit. -+ -+`--cache-file=FILE' -+ Enable the cache: use and save the results of the tests in FILE, -+ traditionally `config.cache'. FILE defaults to `/dev/null' to -+ disable caching. -+ -+`--config-cache' -+`-C' -+ Alias for `--cache-file=config.cache'. -+ -+`--quiet' -+`--silent' -+`-q' -+ Do not print messages saying which checks are being made. To -+ suppress all normal output, redirect it to `/dev/null' (any error -+ messages will still be shown). -+ -+`--srcdir=DIR' -+ Look for the package's source code in directory DIR. Usually -+ `configure' can determine that directory automatically. -+ -+`--prefix=DIR' -+ Use DIR as the installation prefix. *note Installation Names:: -+ for more details, including other options available for fine-tuning -+ the installation locations. -+ -+`--no-create' -+`-n' -+ Run the configure checks, but stop before creating any output -+ files. -+ -+`configure' also accepts some other, not widely useful, options. Run -+`configure --help' for more details. -diff --git a/autogen.sh b/autogen.sh -index 3aef4d9..1613b6d 100644 ---- a/autogen.sh -+++ b/autogen.sh -@@ -37,6 +37,6 @@ fi - - aclocal - libtoolize --force --copy --#autoheader -+autoheader - automake --add-missing --copy --gnu # -Wall - autoconf # -Wall -diff --git a/bootstrap b/bootstrap -index dde1a77..9f35619 100755 ---- a/bootstrap -+++ b/bootstrap -@@ -3,8 +3,10 @@ rm -rf autom4te.cache configure Makefile stamp-h1 - rm -rf src/Makefile src/.deps - rm -rf Makefile.in aclocal.m4 config.log config.h - rm -rf depcomp missing install-sh config.status --aclocal -+mkdir -p m4 -+aclocal -I m4 - autoheader -+libtoolize --automake --copy - automake --gnu --add-missing -c - autoconf - rm -rf autom4te.cache config.log libtool stamp-h1* -diff --git a/configure.ac b/configure.ac -index bcbe911..80dec85 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,4 +1,4 @@ --AC_INIT(libtirpc, 0.2.5) -+AC_INIT(libtirpc, 0.2.4) - AM_INIT_AUTOMAKE([silent-rules]) - AM_SILENT_RULES([yes]) - AC_CONFIG_SRCDIR([src/auth_des.c]) -@@ -15,6 +15,12 @@ if test x$enable_gssapi = xyes; then - AC_SUBST([GSSAPI_CFLAGS]) - AC_SUBST([GSSAPI_LIBS]) - fi -+ -+AC_ARG_ENABLE(authdes, -+ [AC_HELP_STRING([--disable-authdes], [Disable DES authentication @<:@default=no@:>@])], -+ [],[enable_authdes=yes]) -+AM_CONDITIONAL(AUTHDES, test x$enable_authdes = xyes) -+ - AC_ARG_ENABLE(ipv6, - [AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support @<:@default=no@:>@])], - [],[enable_ipv6=yes]) -@@ -24,14 +30,16 @@ if test "x$enable_ipv6" != xno; then - fi - - AC_PROG_CC --m4_pattern_allow(AM_CONFIG_HEADERS(config.h)) -+AC_CONFIG_HEADERS([config.h]) - AC_PROG_LIBTOOL - AC_HEADER_DIRENT - AC_PREFIX_DEFAULT(/usr) --AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h]) -+AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h]) - AC_CHECK_LIB([pthread], [pthread_create]) - AC_CHECK_LIB([nsl], [yp_get_default_domain]) -- -+AC_CHECK_FUNCS([getrpcbyname getrpcbynumber]) - - AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile]) - AC_OUTPUT(libtirpc.pc) -+ -+ -diff --git a/libtirpc.pc.in b/libtirpc.pc.in -index ec4cf75..38034c5 100644 ---- a/libtirpc.pc.in -+++ b/libtirpc.pc.in -@@ -8,4 +8,5 @@ Description: Transport Independent RPC Library - Requires: - Version: @PACKAGE_VERSION@ - Libs: -L@libdir@ -ltirpc -+Libs.private: -lpthread - Cflags: -I@includedir@/tirpc -diff --git a/src/Makefile.am b/src/Makefile.am -index de57c8f..26ccbdf 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -42,6 +42,7 @@ lib_LTLIBRARIES = libtirpc.la - # misunderstanding of the purpose of library versions." - # - libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0 -+libtirpc_la_CFLAGS = - - libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \ - clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \ -@@ -51,7 +52,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln - rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \ - rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \ - svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \ -- auth_time.c auth_des.c authdes_prot.c debug.c -+ auth_time.c debug.c - - ## XDR - libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c -@@ -60,9 +61,16 @@ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_ref - if GSS - libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c - libtirpc_la_LDFLAGS += $(GSSAPI_LIBS) -- libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS) -+ libtirpc_la_CFLAGS += -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS) - endif - -+## DES authentication -+if AUTHDES -+ libtirpc_la_SOURCES += auth_des.c authdes_prot.c -+ libtirpc_la_CFLAGS += -DHAVE_AUTHDES -+endif -+ -+ - ## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c - ## libtirpc_a_SOURCES += netname.c netnamer.c rpcdname.c \ - ## libtirpc_a_SOURCES += rtime.c \ -diff --git a/src/auth_des.c b/src/auth_des.c -index cff777c..f8749b0 100644 ---- a/src/auth_des.c -+++ b/src/auth_des.c -@@ -38,7 +38,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -52,7 +51,6 @@ - - #if defined(LIBC_SCCS) && !defined(lint) - #endif --#include - - #include "debug.h" - -@@ -66,7 +64,7 @@ - - extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); - extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); --extern int key_encryptsession_pk(); -+extern int key_encryptsession_pk( char *, netobj *, des_block *); - - extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *, - char **, char **); -diff --git a/src/auth_none.c b/src/auth_none.c -index affc92b..0b0bbd1 100644 ---- a/src/auth_none.c -+++ b/src/auth_none.c -@@ -31,7 +31,6 @@ - static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; - static char *sccsid = "@(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC"; - #endif --#include - __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $"); - */ - -diff --git a/src/auth_time.c b/src/auth_time.c -index 7cfbb7e..13717ff 100644 ---- a/src/auth_time.c -+++ b/src/auth_time.c -@@ -25,15 +25,14 @@ - * needed to deal with TCP connections. - */ - --#include - #include - #include - #include - #include - #include - #include --#include --#include -+#include -+#include - #include - #include - #include -diff --git a/src/auth_unix.c b/src/auth_unix.c -index 4b9b13f..3009543 100644 ---- a/src/auth_unix.c -+++ b/src/auth_unix.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * auth_unix.c, Implements UNIX style authentication parameters. -diff --git a/src/authdes_prot.c b/src/authdes_prot.c -index ed061a5..227d08a 100644 ---- a/src/authdes_prot.c -+++ b/src/authdes_prot.c -@@ -1,4 +1,3 @@ --#include - /* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. -diff --git a/src/authgss_prot.c b/src/authgss_prot.c -index 669eab7..d80ba17 100644 ---- a/src/authgss_prot.c -+++ b/src/authgss_prot.c -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/src/authunix_prot.c b/src/authunix_prot.c -index bf76a9d..0a04336 100644 ---- a/src/authunix_prot.c -+++ b/src/authunix_prot.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * authunix_prot.c -diff --git a/src/bindresvport.c b/src/bindresvport.c -index d6d9c14..2d8f2bc 100644 ---- a/src/bindresvport.c -+++ b/src/bindresvport.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * Copyright (c) 1987 by Sun Microsystems, Inc. -@@ -37,6 +36,7 @@ - #include - #include - -+#include - #include - - #include -diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c -index 373d8a5..98cf061 100644 ---- a/src/clnt_bcast.c -+++ b/src/clnt_bcast.c -@@ -28,7 +28,6 @@ - /* - * Copyright (c) 1986-1991 by Sun Microsystems Inc. - */ --#include - - /* - * clnt_bcast.c -@@ -46,7 +45,7 @@ - #include - #include - #include --#include -+#include - #include - #ifdef PORTMAP - #include -@@ -142,7 +141,8 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list) - return 0; - - for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { -- if (ifap->ifa_addr->sa_family != af || -+ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */ -+ ifap->ifa_addr->sa_family != af || - !(ifap->ifa_flags & IFF_UP)) - continue; - bip = (struct broadif *)malloc(sizeof *bip); -@@ -222,6 +222,39 @@ __rpc_broadenable(int af, int s, struct broadif *bip) - return 0; - } - -+/* -+ * Some rpcbind implementations use an IPv6 socket to serve both -+ * IPv4 and IPv6 messages, but neglect to check for the caller's -+ * address family when sending broadcast replies. These rpcbind -+ * implementations return an IPv6 address in reply to an IPv4 -+ * broadcast. We can either ignore them, or try to patch them up. -+ */ -+static struct netbuf * -+__ipv6v4_fixup(struct sockaddr_storage *ss, const char *uaddr) -+{ -+ struct sockaddr_in sin; -+ struct netbuf *np; -+ -+ /* ss is the remote rpcbind server's address */ -+ if (ss->ss_family != AF_INET) -+ return NULL; -+ memcpy(&sin, ss, sizeof(sin)); -+ -+ np = __rpc_uaddr2taddr_af(AF_INET6, uaddr); -+ if (np == NULL) -+ return NULL; -+ -+ /* Overwrite the port with that of the service we -+ * wanted to talk to. */ -+ sin.sin_port = ((struct sockaddr_in6 *) np)->sin6_port; -+ -+ /* We know netbuf holds a sockaddr_in6, so it can easily -+ * hold a sockaddr_in as well. */ -+ memcpy(np->buf, &sin, sizeof(sin)); -+ np->len = sizeof(sin); -+ -+ return np; -+} - - enum clnt_stat - rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, -@@ -588,9 +621,18 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, - LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp)); - np = uaddr2taddr( - fdlist[i].nconf, uaddrp); -- done = (*eachresult)(resultsp, -- np, fdlist[i].nconf); -- free(np); -+ /* Some misguided rpcbind implemenations -+ * seem to return an IPv6 uaddr in IPv4 -+ * responses. */ -+ if (np == NULL) -+ np = __ipv6v4_fixup( -+ &fdlist[i].raddr, -+ uaddrp); -+ if (np != NULL) { -+ done = (*eachresult)(resultsp, -+ np, fdlist[i].nconf); -+ free(np); -+ } - #ifdef PORTMAP - } - #endif /* PORTMAP */ -diff --git a/src/clnt_dg.c b/src/clnt_dg.c -index dcc621c..248138b 100644 ---- a/src/clnt_dg.c -+++ b/src/clnt_dg.c -@@ -37,7 +37,7 @@ - #include - #include - #include --#include -+#include - - #include - -diff --git a/src/clnt_generic.c b/src/clnt_generic.c -index b9b07bc..3f3dabf 100644 ---- a/src/clnt_generic.c -+++ b/src/clnt_generic.c -@@ -29,7 +29,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -diff --git a/src/clnt_perror.c b/src/clnt_perror.c -index bcd8af8..fb7fb80 100644 ---- a/src/clnt_perror.c -+++ b/src/clnt_perror.c -@@ -27,9 +27,6 @@ - */ - - /* --#include --*/ --/* - * clnt_perror.c - * - * Copyright (C) 1984, Sun Microsystems, Inc. -diff --git a/src/clnt_simple.c b/src/clnt_simple.c -index 7ee9542..1700060 100644 ---- a/src/clnt_simple.c -+++ b/src/clnt_simple.c -@@ -29,7 +29,6 @@ - * Copyright (c) 1986-1991 by Sun Microsystems Inc. - */ - --#include - - /* - * clnt_simple.c -diff --git a/src/clnt_vc.c b/src/clnt_vc.c -index 61264d4..a72f9f7 100644 ---- a/src/clnt_vc.c -+++ b/src/clnt_vc.c -@@ -48,7 +48,7 @@ - - #include - #include --#include -+#include - #include - #include - #include -diff --git a/src/crypt_client.c b/src/crypt_client.c -index 670b253..f393926 100644 ---- a/src/crypt_client.c -+++ b/src/crypt_client.c -@@ -30,7 +30,6 @@ - * SUCH DAMAGE. - */ - --#include - - #include - #include -diff --git a/src/debug.h b/src/debug.h -index afc8d57..c971ac3 100644 ---- a/src/debug.h -+++ b/src/debug.h -@@ -21,6 +21,8 @@ - - #ifndef _DEBUG_H - #define _DEBUG_H -+ -+#include - #include - - extern int libtirpc_debug_level; -diff --git a/src/des_crypt.c b/src/des_crypt.c -index 37a1022..980a6cb 100644 ---- a/src/des_crypt.c -+++ b/src/des_crypt.c -@@ -39,7 +39,6 @@ - static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI"; - #endif - #endif --#include - - static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * ); - int (*__des_crypt_LOCAL)() = 0; -diff --git a/src/getnetconfig.c b/src/getnetconfig.c -index 635c03a..92e7c43 100644 ---- a/src/getnetconfig.c -+++ b/src/getnetconfig.c -@@ -32,7 +32,6 @@ - - #include - #include --#include - #include - #include - #include -diff --git a/src/getnetpath.c b/src/getnetpath.c -index cd80dca..7c19932 100644 ---- a/src/getnetpath.c -+++ b/src/getnetpath.c -@@ -25,13 +25,11 @@ - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ --#include - - /* - * Copyright (c) 1989 by Sun Microsystems, Inc. - */ - --#include - #include - #include - #include -diff --git a/src/getpeereid.c b/src/getpeereid.c -index 57ee197..dd85270 100644 ---- a/src/getpeereid.c -+++ b/src/getpeereid.c -@@ -24,7 +24,6 @@ - * SUCH DAMAGE. - */ - --#include - - #include - #include -diff --git a/src/getpublickey.c b/src/getpublickey.c -index 85935d8..764a5f9 100644 ---- a/src/getpublickey.c -+++ b/src/getpublickey.c -@@ -25,9 +25,6 @@ - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ --/* --#include --*/ - - /* - * publickey.c -diff --git a/src/getrpcent.c b/src/getrpcent.c -index 1b54b6d..6da006a 100644 ---- a/src/getrpcent.c -+++ b/src/getrpcent.c -@@ -50,6 +50,10 @@ - #include - #endif - -+#if HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - /* - * Internet version. - */ -@@ -89,7 +93,7 @@ _rpcdata() - return (d); - } - --#ifdef GQ -+#if !HAVE_GETRPCBYNYMBER - struct rpcent * - getrpcbynumber(number) - int number; -@@ -135,7 +139,9 @@ no_yp: - endrpcent(); - return (p); - } -+#endif /* !HAVE_GETRPCBYNUMBER */ - -+#if !HAVE_GETRPCBYNAME - struct rpcent * - getrpcbyname(name) - const char *name; -@@ -158,7 +164,7 @@ done: - endrpcent(); - return (rpc); - } --#endif /* GQ */ -+#endif /* !HAVE_GETRPCBYNAME */ - - void - setrpcent(f) -diff --git a/src/key_call.c b/src/key_call.c -index 8b9f388..589fd6f 100644 ---- a/src/key_call.c -+++ b/src/key_call.c -@@ -30,7 +30,6 @@ - */ - - --#include - - /* - * key_call.c, Interface to keyserver -@@ -57,7 +56,7 @@ - #include - #include - #include --#include -+#include - - #include "dump.h" - -diff --git a/src/key_prot_xdr.c b/src/key_prot_xdr.c -index df2842f..772f582 100644 ---- a/src/key_prot_xdr.c -+++ b/src/key_prot_xdr.c -@@ -33,7 +33,6 @@ - */ - /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */ - --#include - - /* - * Compiled from key_prot.x using rpcgen. -diff --git a/src/mt_misc.c b/src/mt_misc.c -index 093086e..a50f385 100644 ---- a/src/mt_misc.c -+++ b/src/mt_misc.c -@@ -1,5 +1,4 @@ - --#include - #include - #include - #include -diff --git a/src/pmap_clnt.c b/src/pmap_clnt.c -index 1d5d153..4b5fd85 100644 ---- a/src/pmap_clnt.c -+++ b/src/pmap_clnt.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * pmap_clnt.c -diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c -index 54338f7..853f724 100644 ---- a/src/pmap_getmaps.c -+++ b/src/pmap_getmaps.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * pmap_getmap.c -diff --git a/src/pmap_rmt.c b/src/pmap_rmt.c -index b81d771..1c76114 100644 ---- a/src/pmap_rmt.c -+++ b/src/pmap_rmt.c -@@ -36,7 +36,7 @@ - - #include - #include --#include -+#include - #include - - #include -diff --git a/src/rpc_com.h b/src/rpc_com.h -index 38c2cfe..52a8c48 100644 ---- a/src/rpc_com.h -+++ b/src/rpc_com.h -@@ -40,7 +40,6 @@ - #ifndef _TIRPC_RPCCOM_H - #define _TIRPC_RPCCOM_H - --#include - - /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ - -@@ -54,7 +53,9 @@ - #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \ - (u_int32_t)(now)->tv_usec) - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern u_int __rpc_get_a_size(int); - extern int __rpc_dtbsize(void); - extern struct netconfig * __rpcgettp(int); -@@ -90,6 +91,8 @@ void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *); - SVCXPRT **__svc_xports; - int __svc_maxrec; - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* _TIRPC_RPCCOM_H */ -diff --git a/src/rpc_generic.c b/src/rpc_generic.c -index a43906c..6148830 100644 ---- a/src/rpc_generic.c -+++ b/src/rpc_generic.c -@@ -29,7 +29,6 @@ - * Copyright (c) 1986-1991 by Sun Microsystems Inc. - */ - --#include - - /* - * rpc_generic.c, Miscl routines for RPC. -@@ -608,6 +607,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - struct sockaddr_in6 *sin6; - char namebuf6[INET6_ADDRSTRLEN]; - #endif -+ int path_len; - u_int16_t port; - - if (nbuf->len <= 0) -@@ -638,13 +638,12 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) - #endif - case AF_LOCAL: - sun = nbuf->buf; -- /* if (asprintf(&ret, "%.*s", (int)(sun->sun_len - -- offsetof(struct sockaddr_un, sun_path)), -- sun->sun_path) < 0)*/ -- if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) - -- offsetof(struct sockaddr_un, sun_path)), -- sun->sun_path) < 0) - -+ path_len = nbuf->len - offsetof(struct sockaddr_un, sun_path); -+ if (path_len < 0) -+ return NULL; -+ -+ if (asprintf(&ret, "%.*s", path_len, sun->sun_path) < 0) - return (NULL); - break; - default: -diff --git a/src/rpc_soc.c b/src/rpc_soc.c -index 338edbb..6574323 100644 ---- a/src/rpc_soc.c -+++ b/src/rpc_soc.c -@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - (resultproc_t) rpc_wrap_bcast, "udp"); - } - -+#if HAVE_AUTHDES - /* - * Create the client des authentication object. Obsoleted by - * authdes_seccreate(). -@@ -551,6 +552,7 @@ fallback: - dummy = authdes_seccreate(servername, window, NULL, ckey); - return (dummy); - } -+#endif - - /* - * Create a client handle for a unix connection. Obsoleted by clnt_vc_create() -@@ -564,16 +566,12 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - u_int sendsz; - u_int recvsz; - { -- struct netbuf *svcaddr; -- CLIENT *cl; -+ struct netbuf svcaddr = {0, 0, NULL}; -+ CLIENT *cl = NULL; - int len; - -- cl = NULL; -- svcaddr = NULL; -- if (((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) || -- ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) { -- if (svcaddr != NULL) -- free(svcaddr); -+ memset(&svcaddr, 0, sizeof(svcaddr)); -+ if (__rpc_set_netbuf(&svcaddr, raddr, sizeof(*raddr)) == NULL) { - rpc_createerr.cf_stat = RPC_SYSTEMERROR; - rpc_createerr.cf_error.re_errno = errno; - return(cl); -@@ -590,14 +588,10 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - goto done; - } - } -- svcaddr->buf = raddr; -- svcaddr->len = sizeof(raddr); -- svcaddr->maxlen = sizeof (struct sockaddr_un); -- cl = clnt_vc_create(*sockp, svcaddr, prog, -+ cl = clnt_vc_create(*sockp, &svcaddr, prog, - vers, sendsz, recvsz); - done: -- free(svcaddr->buf); -- free(svcaddr); -+ free(svcaddr.buf); - return(cl); - } - -diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c -index a796593..78b1534 100644 ---- a/src/rpcb_clnt.c -+++ b/src/rpcb_clnt.c -@@ -282,6 +282,18 @@ getclnthandle(host, nconf, targaddr) - struct address_cache *ad_cache; - char *tmpaddr; - -+ if (nconf == NULL) { -+ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; -+ return NULL; -+ } -+ -+ if (nconf->nc_protofmly != NULL && -+ strcmp(nconf->nc_protofmly, NC_LOOPBACK) != 0 && -+ host == NULL) { -+ rpc_createerr.cf_stat = RPC_UNKNOWNHOST; -+ return NULL; -+ } -+ - /* VARIABLES PROTECTED BY rpcbaddr_cache_lock: ad_cache */ - - /* Get the address of the rpcbind. Check cache first */ -@@ -291,6 +303,7 @@ getclnthandle(host, nconf, targaddr) - addr_to_delete.len = 0; - rwlock_rdlock(&rpcbaddr_cache_lock); - ad_cache = NULL; -+ - if (host != NULL) - ad_cache = check_cache(host, nconf->nc_netid); - if (ad_cache != NULL) { -@@ -298,7 +311,7 @@ getclnthandle(host, nconf, targaddr) - client = clnt_tli_create(RPC_ANYFD, nconf, addr, - (rpcprog_t)RPCBPROG, (rpcvers_t)RPCBVERS4, 0, 0); - if (client != NULL) { -- if (targaddr) -+ if (targaddr && ad_cache->ac_uaddr) - *targaddr = strdup(ad_cache->ac_uaddr); - rwlock_unlock(&rpcbaddr_cache_lock); - return (client); -@@ -345,9 +358,11 @@ getclnthandle(host, nconf, targaddr) - } else { - struct sockaddr_un sun; - -- *targaddr = malloc(sizeof(sun.sun_path)); -- strncpy(*targaddr, _PATH_RPCBINDSOCK, -- sizeof(sun.sun_path)); -+ if (targaddr) { -+ *targaddr = malloc(sizeof(sun.sun_path)); -+ strncpy(*targaddr, _PATH_RPCBINDSOCK, -+ sizeof(sun.sun_path)); -+ } - return (client); - } - } else { -@@ -387,7 +402,8 @@ getclnthandle(host, nconf, targaddr) - - if (client) { - tmpaddr = targaddr ? taddr2uaddr(nconf, &taddr) : NULL; -- add_cache(host, nconf->nc_netid, &taddr, tmpaddr); -+ if (host) -+ add_cache(host, nconf->nc_netid, &taddr, tmpaddr); - if (targaddr) - *targaddr = tmpaddr; - break; -@@ -401,6 +417,44 @@ out_err: - return (client); - } - -+/* -+ * Create a PMAP client handle. -+ */ -+static CLIENT * -+getpmaphandle(nconf, hostname, tgtaddr) -+ const struct netconfig *nconf; -+ const char *hostname; -+ char **tgtaddr; -+{ -+ CLIENT *client = NULL; -+ rpcvers_t pmapvers = 2; -+ -+ /* -+ * Try UDP only - there are some portmappers out -+ * there that use UDP only. -+ */ -+ if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) { -+ struct netconfig *newnconf; -+ -+ if ((newnconf = getnetconfigent("udp")) == NULL) { -+ rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; -+ return NULL; -+ } -+ client = getclnthandle(hostname, newnconf, tgtaddr); -+ freenetconfigent(newnconf); -+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) { -+ if (strcmp(nconf->nc_protofmly, NC_INET) != 0) -+ return NULL; -+ client = getclnthandle(hostname, nconf, tgtaddr); -+ } -+ -+ /* Set version */ -+ if (client != NULL) -+ CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); -+ -+ return client; -+} -+ - /* XXX */ - #define IN4_LOCALHOST_STRING "127.0.0.1" - #define IN6_LOCALHOST_STRING "::1" -@@ -733,34 +787,20 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - u_short port = 0; - struct netbuf remote; -- rpcvers_t pmapvers = 2; - struct pmap pmapparms; - -- /* -- * Try UDP only - there are some portmappers out -- * there that use UDP only. -- */ -- if (strcmp(nconf->nc_proto, NC_TCP) == 0) { -- struct netconfig *newnconf; -- -- if ((newnconf = getnetconfigent("udp")) == NULL) { -- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; -- return (NULL); -- } -- client = getclnthandle(host, newnconf, &parms.r_addr); -- freenetconfigent(newnconf); -- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) -- client = getclnthandle(host, nconf, &parms.r_addr); -- else -+ if (strcmp(nconf->nc_proto, NC_UDP) != 0 -+ && strcmp(nconf->nc_proto, NC_TCP) != 0) - goto try_rpcbind; -+ -+ client = getpmaphandle(nconf, host, &parms.r_addr); - if (client == NULL) - return (NULL); - - /* -- * Set version and retry timeout. -+ * Set retry timeout. - */ - CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime); -- CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); - - pmapparms.pm_prog = program; - pmapparms.pm_vers = version; -diff --git a/src/rpcb_st_xdr.c b/src/rpcb_st_xdr.c -index c5d3575..08db745 100644 ---- a/src/rpcb_st_xdr.c -+++ b/src/rpcb_st_xdr.c -@@ -35,7 +35,6 @@ - * routines used with the rpcbind stats facility. - */ - --#include - - #include - -diff --git a/src/rpcdname.c b/src/rpcdname.c -index 094cea3..3e6a988 100644 ---- a/src/rpcdname.c -+++ b/src/rpcdname.c -@@ -25,7 +25,6 @@ - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ --#include - - /* - * rpcdname.c -diff --git a/src/svc.c b/src/svc.c -index 8afd15d..32c84f1 100644 ---- a/src/svc.c -+++ b/src/svc.c -@@ -40,7 +40,7 @@ - - #include - #include --#include -+#include - #include - #include - #include -diff --git a/src/svc_dg.c b/src/svc_dg.c -index f8255cc..1fd6f92 100644 ---- a/src/svc_dg.c -+++ b/src/svc_dg.c -@@ -31,7 +31,6 @@ - * Copyright (c) 1986-1991 by Sun Microsystems Inc. - */ - --#include - - /* - * svc_dg.c, Server side for connectionless RPC. -diff --git a/src/svc_simple.c b/src/svc_simple.c -index b6c371e..cb58002 100644 ---- a/src/svc_simple.c -+++ b/src/svc_simple.c -@@ -29,7 +29,6 @@ - * Copyright (c) 1986-1991 by Sun Microsystems Inc. - */ - --#include - - /* - * svc_simple.c -diff --git a/src/svc_vc.c b/src/svc_vc.c -index 4c70de8..9824631 100644 ---- a/src/svc_vc.c -+++ b/src/svc_vc.c -@@ -27,7 +27,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * svc_vc.c, Server side for Connection Oriented based RPC. -@@ -41,7 +40,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -559,20 +558,19 @@ write_vc(xprtp, buf, len) - cd->strm_stat = XPRT_DIED; - return (-1); - } -- if (cd->nonblock && i != cnt) { -- /* -- * For non-blocking connections, do not -- * take more than 2 seconds writing the -- * data out. -- * -- * XXX 2 is an arbitrary amount. -- */ -- gettimeofday(&tv1, NULL); -- if (tv1.tv_sec - tv0.tv_sec >= 2) { -- cd->strm_stat = XPRT_DIED; -- return (-1); -- } -+ /* -+ * For non-blocking connections, do not -+ * take more than 2 seconds writing the -+ * data out. -+ * -+ * XXX 2 is an arbitrary amount. -+ */ -+ gettimeofday(&tv1, NULL); -+ if (tv1.tv_sec - tv0.tv_sec >= 2) { -+ cd->strm_stat = XPRT_DIED; -+ return (-1); - } -+ i = 0; /* Don't change buf and cnt */ - } - } - -diff --git a/src/xdr.c b/src/xdr.c -index 1142a88..f3fb9ad 100644 ---- a/src/xdr.c -+++ b/src/xdr.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * xdr.c, Generic XDR routines implementation. -diff --git a/src/xdr_array.c b/src/xdr_array.c -index 216173d..7fc8fb8 100644 ---- a/src/xdr_array.c -+++ b/src/xdr_array.c -@@ -27,7 +27,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * xdr_array.c, Generic XDR routines impelmentation. -diff --git a/src/xdr_float.c b/src/xdr_float.c -index 90daf3f..26bc865 100644 ---- a/src/xdr_float.c -+++ b/src/xdr_float.c -@@ -27,7 +27,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * xdr_float.c, Generic XDR routines implementation. -diff --git a/src/xdr_mem.c b/src/xdr_mem.c -index bd86f00..ecdc932 100644 ---- a/src/xdr_mem.c -+++ b/src/xdr_mem.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * xdr_mem.h, XDR implementation using memory buffers. -diff --git a/src/xdr_rec.c b/src/xdr_rec.c -index 2aca623..7d535cf 100644 ---- a/src/xdr_rec.c -+++ b/src/xdr_rec.c -@@ -27,8 +27,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include --#include - - /* - * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking" -diff --git a/src/xdr_reference.c b/src/xdr_reference.c -index affe19e..13f6410 100644 ---- a/src/xdr_reference.c -+++ b/src/xdr_reference.c -@@ -26,8 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include --#include - - /* - * xdr_reference.c, Generic XDR routines impelmentation. -diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c -index a805e31..cc5414b 100644 ---- a/src/xdr_sizeof.c -+++ b/src/xdr_sizeof.c -@@ -34,7 +34,6 @@ - * when serialized using XDR. - */ - --#include - - #include - #include -diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c -index 45b1150..4410262 100644 ---- a/src/xdr_stdio.c -+++ b/src/xdr_stdio.c -@@ -26,7 +26,6 @@ - * POSSIBILITY OF SUCH DAMAGE. - */ - --#include - - /* - * xdr_stdio.c, XDR implementation on standard i/o file. -diff --git a/tirpc/netconfig.h b/tirpc/netconfig.h -index 7d6c2bc..3f1a685 100644 ---- a/tirpc/netconfig.h -+++ b/tirpc/netconfig.h -@@ -1,7 +1,9 @@ - #ifndef _NETCONFIG_H_ - #define _NETCONFIG_H_ - -+#ifdef HAVE_FEATURES_H - #include -+#endif - - #define NETCONFIG "/etc/netconfig" - #define NETPATH "NETPATH" -@@ -74,7 +76,9 @@ typedef struct { - #define NC_UDP "udp" - #define NC_ICMP "icmp" - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - extern void *setnetconfig (void); - extern struct netconfig *getnetconfig (void *); -@@ -89,6 +93,8 @@ extern int endnetpath (void *); - extern void nc_perror (const char *); - extern char *nc_sperror (void); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* _NETCONFIG_H_ */ -diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h -index 7c8f813..434d35c 100644 ---- a/tirpc/rpc/auth.h -+++ b/tirpc/rpc/auth.h -@@ -48,7 +48,6 @@ - - #include - #include --#include - #include - #include - -@@ -164,9 +163,13 @@ union des_block { - char c[8]; - }; - typedef union des_block des_block; --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_des_block(XDR *, des_block *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Authentication info. Opaque to client. -@@ -277,9 +280,13 @@ auth_put(AUTH *auth) - xfunc, xwhere)) - - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern struct opaque_auth _null_auth; --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Any style authentication. These routines can be used by any -@@ -300,11 +307,15 @@ int authany_wrap(void), authany_unwrap(void); - * int len; - * int *aup_gids; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *); - extern AUTH *authunix_create_default(void); /* takes no parameters */ - extern AUTH *authnone_create(void); /* takes no parameters */ --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - /* - * DES style authentication - * AUTH *authsecdes_create(servername, window, timehost, ckey) -@@ -313,15 +324,23 @@ __END_DECLS - * const char *timehost; - optional hostname to sync with - * des_block *ckey; - optional conversation key to use - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *); - extern AUTH *authdes_seccreate (const char *, const u_int, const char *, - const des_block *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip)) - #define authsys_create_default() authunix_create_default() -@@ -329,36 +348,48 @@ __END_DECLS - /* - * Netname manipulation routines. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int getnetname(char *); - extern int host2netname(char *, const char *, const char *); - extern int user2netname(char *, const uid_t, const char *); - extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); - extern int netname2host(char *, char *, const int); - extern void passwd2des ( char *, char * ); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * - * These routines interface to the keyserv daemon - * - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int key_decryptsession(const char *, des_block *); - extern int key_encryptsession(const char *, des_block *); - extern int key_gendes(des_block *); - extern int key_setsecret(const char *); - extern int key_secretkey_is_set(void); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Publickey routines. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int getpublickey (const char *, char *); - extern int getpublicandprivatekey (char *, char *); - extern int getsecretkey (char *, char *, char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #ifdef KERBEROS - /* -@@ -371,10 +402,14 @@ __END_DECLS - * const char *timehost; - optional hostname to sync with - * int *status; - kerberos status returned - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern AUTH *authkerb_seccreate(const char *, const char *, const char *, - const u_int, const char *, int *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Map a kerberos credential into a unix cred. -@@ -387,20 +422,28 @@ __END_DECLS - * int *groups; - * - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, - short *, int * */); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - #endif /* KERBEROS */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - struct svc_req; - struct rpc_msg; - enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *); - enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); - enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); - enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #define AUTH_NONE 0 /* no authentication */ - #define AUTH_NULL 0 /* backward compatibility */ -diff --git a/tirpc/rpc/auth_des.h b/tirpc/rpc/auth_des.h -index 39b5332..77e169d 100644 ---- a/tirpc/rpc/auth_des.h -+++ b/tirpc/rpc/auth_des.h -@@ -114,17 +114,25 @@ struct authdes_verf { - * Map a des credential into a unix cred. - * - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * ); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *); - extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *); - extern int rtime(dev_t, struct netbuf *, int, struct timeval *, - struct timeval *); - extern void kgetnetname(char *); - extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* ndef _TI_AUTH_DES_ */ -diff --git a/tirpc/rpc/auth_gss.h b/tirpc/rpc/auth_gss.h -index d6f2bbd..a17b34b 100644 ---- a/tirpc/rpc/auth_gss.h -+++ b/tirpc/rpc/auth_gss.h -@@ -104,28 +104,29 @@ struct rpc_gss_init_res { - #define MAXSEQ 0x80000000 - - /* Prototypes. */ --__BEGIN_DECLS --bool_t xdr_rpc_gss_cred __P((XDR *xdrs, struct rpc_gss_cred *p)); --bool_t xdr_rpc_gss_init_args __P((XDR *xdrs, gss_buffer_desc *p)); --bool_t xdr_rpc_gss_init_res __P((XDR *xdrs, struct rpc_gss_init_res *p)); --bool_t xdr_rpc_gss_data __P((XDR *xdrs, xdrproc_t xdr_func, -- caddr_t xdr_ptr, gss_ctx_id_t ctx, -- gss_qop_t qop, rpc_gss_svc_t svc, -- u_int seq)); -- --AUTH *authgss_create __P((CLIENT *, gss_name_t, -- struct rpc_gss_sec *)); --AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *)); --bool_t authgss_service __P((AUTH *auth, int svc)); --bool_t authgss_get_private_data __P((AUTH *auth, -- struct authgss_private_data *)); --bool_t authgss_free_private_data __P((struct authgss_private_data *)); -- --void gss_log_debug __P((const char *fmt, ...)); --void gss_log_status __P((char *m, OM_uint32 major, -- OM_uint32 minor)); --void gss_log_hexdump __P((const u_char *buf, int len, int offset)); -- --__END_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif -+bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p); -+bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p); -+bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p); -+bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func, -+ caddr_t xdr_ptr, gss_ctx_id_t ctx, -+ gss_qop_t qop, rpc_gss_svc_t svc, -+ u_int seq); -+ -+AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *); -+AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *); -+bool_t authgss_service (AUTH *auth, int svc); -+bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *); -+bool_t authgss_free_private_data (struct authgss_private_data *); -+ -+void gss_log_debug (const char *fmt, ...); -+void gss_log_status (char *m, OM_uint32 major, OM_uint32 minor); -+void gss_log_hexdump (const u_char *buf, int len, int offset); -+ -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_TIRPC_AUTH_GSS_H */ -diff --git a/tirpc/rpc/auth_unix.h b/tirpc/rpc/auth_unix.h -index 602889b..b10e71d 100644 ---- a/tirpc/rpc/auth_unix.h -+++ b/tirpc/rpc/auth_unix.h -@@ -45,7 +45,6 @@ - - #ifndef _TIRPC_AUTH_UNIX_H - #define _TIRPC_AUTH_UNIX_H --#include - - /* The machine name is part of a credential; it may not exceed 255 bytes */ - #define MAX_MACHINE_NAME 255 -@@ -67,9 +66,13 @@ struct authunix_parms { - - #define authsys_parms authunix_parms - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * If a response verifier has flavor AUTH_SHORT, -diff --git a/tirpc/rpc/clnt.h b/tirpc/rpc/clnt.h -index 9ee619e..05f2215 100644 ---- a/tirpc/rpc/clnt.h -+++ b/tirpc/rpc/clnt.h -@@ -42,7 +42,6 @@ - #include - #include - --#include - #include - #include - -@@ -267,7 +266,9 @@ struct rpc_timers { - * Generic client creation routine. Supported protocols are those that - * belong to the nettype namespace (/etc/netconfig). - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t, - const char *); - /* -@@ -414,32 +415,46 @@ extern CLIENT *clnt_dg_create(const int, const struct netbuf *, - */ - extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* - * Print why creation failed - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void clnt_pcreateerror(const char *); /* stderr */ - extern char *clnt_spcreateerror(const char *); /* string */ --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Like clnt_perror(), but is more verbose in its output - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void clnt_perrno(enum clnt_stat); /* stderr */ - extern char *clnt_sperrno(enum clnt_stat); /* string */ --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Print an English error message, given the client error code - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void clnt_perror(CLIENT *, const char *); /* stderr */ - extern char *clnt_sperror(CLIENT *, const char *); /* string */ --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* -@@ -450,9 +465,13 @@ struct rpc_createerr { - struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ - }; - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern struct rpc_createerr *__rpc_createerr(void); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - #define get_rpc_createerr() (*(__rpc_createerr())) - #define rpc_createerr (*(__rpc_createerr())) - -@@ -469,12 +488,16 @@ __END_DECLS - * char *out; - * const char *nettype; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern enum clnt_stat rpc_call(const char *, const rpcprog_t, - const rpcvers_t, const rpcproc_t, - const xdrproc_t, const char *, - const xdrproc_t, char *, const char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * RPC broadcast interface -@@ -522,7 +545,9 @@ __END_DECLS - - typedef bool_t (*resultproc_t)(caddr_t, ...); - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t, - const rpcproc_t, const xdrproc_t, - caddr_t, const xdrproc_t, caddr_t, -@@ -532,7 +557,9 @@ extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t, - caddr_t, const xdrproc_t, caddr_t, - const resultproc_t, const int, - const int, const char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* For backward compatibility */ - #include -diff --git a/tirpc/rpc/clnt_soc.h b/tirpc/rpc/clnt_soc.h -index 82330a3..6ec545c 100644 ---- a/tirpc/rpc/clnt_soc.h -+++ b/tirpc/rpc/clnt_soc.h -@@ -46,7 +46,6 @@ - * with TS-RPC. - */ - --#include - - #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ - -@@ -61,27 +60,39 @@ - * u_int sendsz; - * u_int recvsz; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *, - u_int, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Raw (memory) rpc. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern CLIENT *clntraw_create(u_long, u_long); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* - IPv6 socket version - */ - #ifdef INET6 --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *, - u_int, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - #endif - - /* -@@ -105,7 +116,9 @@ __END_DECLS - * u_int sendsz; - * u_int recvsz; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, - struct timeval, int *); - extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, -@@ -116,7 +129,9 @@ extern CLIENT *clntudp6_create(struct sockaddr_in6 *, u_long, u_long, - extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long, - struct timeval, int *, u_int, u_int); - #endif --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - #endif /* _RPC_CLNT_SOC_H */ -diff --git a/tirpc/rpc/des_crypt.h b/tirpc/rpc/des_crypt.h -index 837088c..2358960 100644 ---- a/tirpc/rpc/des_crypt.h -+++ b/tirpc/rpc/des_crypt.h -@@ -43,7 +43,6 @@ - #ifndef _DES_DES_CRYPT_H - #define _DES_DES_CRYPT_H - --#include - #include - - #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ -@@ -83,23 +82,35 @@ - /* - * Cipher Block Chaining mode - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - int cbc_crypt( char *, char *, unsigned int, unsigned int, char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Electronic Code Book mode - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - int ecb_crypt( char *, char *, unsigned int, unsigned int ); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Set des parity for a key. - * DES parity is odd and in the low bit of each byte - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - void des_setparity( char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* _DES_DES_CRYPT_H */ -diff --git a/tirpc/rpc/nettype.h b/tirpc/rpc/nettype.h -index 92063c6..926797a 100644 ---- a/tirpc/rpc/nettype.h -+++ b/tirpc/rpc/nettype.h -@@ -53,11 +53,15 @@ - #define _RPC_TCP 7 - #define _RPC_UDP 8 - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void *__rpc_setconf(const char *); - extern void __rpc_endconf(void *); - extern struct netconfig *__rpc_getconf(void *); - extern struct netconfig *__rpc_getconfip(const char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_TIRPC_NETTYPE_H */ -diff --git a/tirpc/rpc/pmap_clnt.h b/tirpc/rpc/pmap_clnt.h -index 0d23908..6abd583 100644 ---- a/tirpc/rpc/pmap_clnt.h -+++ b/tirpc/rpc/pmap_clnt.h -@@ -63,9 +63,10 @@ - - #ifndef _RPC_PMAP_CLNT_H_ - #define _RPC_PMAP_CLNT_H_ --#include - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t pmap_set(u_long, u_long, int, int); - extern bool_t pmap_unset(u_long, u_long); - extern struct pmaplist *pmap_getmaps(struct sockaddr_in *); -@@ -80,6 +81,8 @@ extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long, - resultproc_t); - extern u_short pmap_getport(struct sockaddr_in *, - u_long, u_long, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_PMAP_CLNT_H_ */ -diff --git a/tirpc/rpc/pmap_prot.h b/tirpc/rpc/pmap_prot.h -index c1a2546..75354ce 100644 ---- a/tirpc/rpc/pmap_prot.h -+++ b/tirpc/rpc/pmap_prot.h -@@ -71,7 +71,6 @@ - - #ifndef _RPC_PMAP_PROT_H - #define _RPC_PMAP_PROT_H --#include - - #define PMAPPORT ((u_short)111) - #define PMAPPROG ((u_long)100000) -@@ -97,10 +96,14 @@ struct pmaplist { - struct pmaplist *pml_next; - }; - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_pmap(XDR *, struct pmap *); - extern bool_t xdr_pmaplist(XDR *, struct pmaplist **); - extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_PMAP_PROT_H */ -diff --git a/tirpc/rpc/pmap_rmt.h b/tirpc/rpc/pmap_rmt.h -index dd59a15..2a385e7 100644 ---- a/tirpc/rpc/pmap_rmt.h -+++ b/tirpc/rpc/pmap_rmt.h -@@ -41,7 +41,6 @@ - - #ifndef _RPC_PMAP_RMT_H - #define _RPC_PMAP_RMT_H --#include - - struct rmtcallargs { - u_long prog, vers, proc, arglen; -@@ -56,9 +55,13 @@ struct rmtcallres { - xdrproc_t xdr_results; - }; - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *); - extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_PMAP_RMT_H */ -diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h -index 6c0222e..fac2fa9 100644 ---- a/tirpc/rpc/rpc.h -+++ b/tirpc/rpc/rpc.h -@@ -79,9 +79,11 @@ - #define UDPMSGSIZE 8800 - #endif - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern int get_myaddress(struct sockaddr_in *); --extern int bindresvport(int, struct sockaddr_in *) __THROW; -+extern int bindresvport(int, struct sockaddr_in *); - extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]), - xdrproc_t, xdrproc_t); - extern int callrpc(const char *, int, int, int, xdrproc_t, void *, -@@ -93,18 +95,24 @@ struct netbuf *uaddr2taddr(const struct netconfig *, const char *); - - struct sockaddr; - extern int bindresvport_sa(int, struct sockaddr *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * The following are not exported interfaces, they are for internal library - * and rpcbind use only. Do not use, they may change without notice. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - int __rpc_nconf2fd(const struct netconfig *); - int __rpc_nconf2fd_flags(const struct netconfig *, int); - int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *); - int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *); - u_int __rpc_get_t_size(int, int, int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_RPC_H */ -diff --git a/tirpc/rpc/rpc_com.h b/tirpc/rpc/rpc_com.h -index cb3bbbb..236fcee 100644 ---- a/tirpc/rpc/rpc_com.h -+++ b/tirpc/rpc/rpc_com.h -@@ -41,7 +41,6 @@ - #ifndef _RPC_RPCCOM_H - #define _RPC_RPCCOM_H - --#include - - /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ - -@@ -55,7 +54,9 @@ - #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \ - (u_int32_t)(now)->tv_usec) - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern u_int __rpc_get_a_size(int); - extern int __rpc_dtbsize(void); - extern int _rpc_dtablesize(void); -@@ -77,6 +78,8 @@ bool_t rpc_control(int,void *); - - char *_get_next_token(char *, int); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* _RPC_RPCCOM_H */ -diff --git a/tirpc/rpc/rpc_msg.h b/tirpc/rpc/rpc_msg.h -index 16d8eef..f7aabd8 100644 ---- a/tirpc/rpc/rpc_msg.h -+++ b/tirpc/rpc/rpc_msg.h -@@ -161,7 +161,9 @@ struct rpc_msg { - #define acpted_rply ru.RM_rmb.ru.RP_ar - #define rjcted_rply ru.RM_rmb.ru.RP_dr - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - /* - * XDR routine to handle a rpc message. - * xdr_callmsg(xdrs, cmsg) -@@ -210,6 +212,8 @@ extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); - * struct rpc_err *error; - */ - extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_TIRPC_RPC_MSG_H */ -diff --git a/tirpc/rpc/rpcb_clnt.h b/tirpc/rpc/rpcb_clnt.h -index 7e64f8f..86d81f6 100644 ---- a/tirpc/rpc/rpcb_clnt.h -+++ b/tirpc/rpc/rpcb_clnt.h -@@ -59,7 +59,9 @@ - - #include - #include --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t, - const struct netconfig *, const struct netbuf *); - extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t, -@@ -78,6 +80,8 @@ extern bool_t rpcb_getaddr(const rpcprog_t, const rpcvers_t, - extern bool_t rpcb_gettime(const char *, time_t *); - extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *); - extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_RPCB_CLNT_H */ -diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h -index c865e51..147f909 100644 ---- a/tirpc/rpc/rpcent.h -+++ b/tirpc/rpc/rpcent.h -@@ -44,10 +44,12 @@ - /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */ - /* @(#)rpcent.h 1.1 88/12/06 SMI */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - /* These are defined in /usr/include/rpc/netdb.h */ --#if 0 -+#if !defined(__GLIBC__) - struct rpcent { - char *r_name; /* name of server for this rpc program */ - char **r_aliases; /* alias list */ -@@ -60,8 +62,10 @@ extern struct rpcent *getrpcbynumber(int); - extern struct rpcent *getrpcent(void); - #endif - --extern void setrpcent(int) __THROW; --extern void endrpcent(void) __THROW; --__END_DECLS -+extern void setrpcent(int); -+extern void endrpcent(void); -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_CENT_H */ -diff --git a/tirpc/rpc/svc.h b/tirpc/rpc/svc.h -index b9691a8..8273c95 100644 ---- a/tirpc/rpc/svc.h -+++ b/tirpc/rpc/svc.h -@@ -40,7 +40,6 @@ - - #ifndef _TIRPC_SVC_H - #define _TIRPC_SVC_H --#include - - /* - * This interface must manage two items concerning remote procedure calling: -@@ -200,11 +199,15 @@ struct svc_req { - * const struct netconfig *nconf; - */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t, - void (*)(struct svc_req *, SVCXPRT *), - const struct netconfig *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Service un-registration -@@ -214,9 +217,13 @@ __END_DECLS - * const rpcvers_t vers; - */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void svc_unreg(const rpcprog_t, const rpcvers_t); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Transport registration. -@@ -224,9 +231,13 @@ __END_DECLS - * xprt_register(xprt) - * SVCXPRT *xprt; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void xprt_register(SVCXPRT *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Transport un-register -@@ -234,9 +245,13 @@ __END_DECLS - * xprt_unregister(xprt) - * SVCXPRT *xprt; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void xprt_unregister(SVCXPRT *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* -@@ -265,7 +280,9 @@ __END_DECLS - * deadlock the caller and server processes! - */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *); - extern void svcerr_decode(SVCXPRT *); - extern void svcerr_weakauth(SVCXPRT *); -@@ -277,7 +294,9 @@ extern void svcerr_systemerr(SVCXPRT *); - extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t, - char *(*)(char *), xdrproc_t, xdrproc_t, - char *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Lowest level dispatching -OR- who owns this process anyway. -@@ -306,11 +325,17 @@ extern int svc_fds; - * a small program implemented by the svc_rpc implementation itself; - * also see clnt.h for protocol numbers. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void rpctest_service(void); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void svc_getreq(int); - extern void svc_getreqset(fd_set *); - extern void svc_getreq_common(int); -@@ -319,7 +344,9 @@ extern void svc_getreq_poll(struct pollfd *, int); - - extern void svc_run(void); - extern void svc_exit(void); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Socket to use on svcxxx_create call to get default socket -@@ -331,7 +358,9 @@ __END_DECLS - * These are the existing service side transport implementations - */ - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - /* - * Transport independent svc_create routine. - */ -@@ -427,7 +456,9 @@ int svc_dg_enablecache(SVCXPRT *, const u_int); - - int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* for backward compatibility */ -diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h -index 723c989..67608d0 100644 ---- a/tirpc/rpc/svc_auth.h -+++ b/tirpc/rpc/svc_auth.h -@@ -65,13 +65,17 @@ typedef struct SVCAUTH { - /* - * Server side authenticator - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *, - bool_t *); - extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); - extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *, - struct rpc_msg *)); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_SVC_AUTH_H */ -diff --git a/tirpc/rpc/svc_soc.h b/tirpc/rpc/svc_soc.h -index 6148d7b..9b7befa 100644 ---- a/tirpc/rpc/svc_soc.h -+++ b/tirpc/rpc/svc_soc.h -@@ -38,7 +38,6 @@ - - #ifndef _RPC_SVC_SOC_H - #define _RPC_SVC_SOC_H --#include - - /* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */ - /* svc_soc.h 1.8 89/05/01 SMI */ -@@ -64,10 +63,14 @@ - * void (*dispatch)(); - * int protocol; like TCP or UDP, zero means do not register - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t svc_register(SVCXPRT *, u_long, u_long, - void (*)(struct svc_req *, SVCXPRT *), int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Service un-registration -@@ -76,44 +79,64 @@ __END_DECLS - * u_long prog; - * u_long vers; - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern void svc_unregister(u_long, u_long); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* - * Memory based rpc for testing and timing. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern SVCXPRT *svcraw_create(void); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* - * Udp based rpc. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern SVCXPRT *svcudp_create(int); - extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); - extern int svcudp_enablecache(SVCXPRT *, u_long); - extern SVCXPRT *svcudp6_create(int); - extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - - /* - * Tcp based rpc. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern SVCXPRT *svctcp_create(int, u_int, u_int); - extern SVCXPRT *svctcp6_create(int, u_int, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Fd based rpc. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern SVCXPRT *svcfd_create(int, u_int, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_RPC_SVC_SOC_H */ -diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h -index 613fab0..917c067 100644 ---- a/tirpc/rpc/xdr.h -+++ b/tirpc/rpc/xdr.h -@@ -40,7 +40,6 @@ - - #ifndef _TIRPC_XDR_H - #define _TIRPC_XDR_H --#include - #include - #include - -@@ -287,7 +286,9 @@ struct xdr_discrim { - /* - * These are the "generic" xdr routines. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - extern bool_t xdr_void(void); - extern bool_t xdr_int(XDR *, int *); - extern bool_t xdr_u_int(XDR *, u_int *); -@@ -330,7 +331,9 @@ extern bool_t xdr_hyper(XDR *, quad_t *); - extern bool_t xdr_u_hyper(XDR *, u_quad_t *); - extern bool_t xdr_longlong_t(XDR *, quad_t *); - extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - /* - * Common opaque bytes objects used by many rpc protocols; -@@ -348,7 +351,9 @@ extern bool_t xdr_netobj(XDR *, struct netobj *); - * These are the public routines for the various implementations of - * xdr streams. - */ --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - /* XDR using memory buffers */ - extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op); - -@@ -369,6 +374,8 @@ extern bool_t xdrrec_skiprecord(XDR *); - /* true if no more input */ - extern bool_t xdrrec_eof(XDR *); - extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* !_TIRPC_XDR_H */ diff --git a/libtirpc.spec b/libtirpc.spec index aace0f9..f40802c 100644 --- a/libtirpc.spec +++ b/libtirpc.spec @@ -1,8 +1,8 @@ %define _root_libdir /%{_lib} Name: libtirpc -Version: 0.2.5 -Release: 3.0%{?dist} +Version: 0.3.0 +Release: 0.0%{?dist} Summary: Transport Independent RPC Library Group: System Environment/Libraries License: SISSL and BSD @@ -10,8 +10,6 @@ URL: http://nfsv4.bullopensource.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: http://downloads.sourceforge.net/libtirpc/libtirpc-%{version}.tar.bz2 -Patch001: libtirpc-0.2.6-rc3.patch - BuildRequires: automake, autoconf, libtool, pkgconfig BuildRequires: krb5-devel @@ -41,9 +39,6 @@ developing programs which use the tirpc library. %prep %setup -q -rm -f INSTALL -%patch001 -p1 - # Remove .orig files find . -name "*.orig" | xargs rm -f @@ -101,15 +96,13 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libtirpc.pc %{_includedir}/tirpc/netconfig.h %{_includedir}/tirpc/rpc/auth.h -%{_includedir}/tirpc/rpc/auth_des.h %{_includedir}/tirpc/rpc/auth_gss.h %{_includedir}/tirpc/rpc/auth_kerb.h %{_includedir}/tirpc/rpc/auth_unix.h +%{_includedir}/tirpc/rpc/rpcsec_gss.h %{_includedir}/tirpc/rpc/clnt.h %{_includedir}/tirpc/rpc/clnt_soc.h %{_includedir}/tirpc/rpc/clnt_stat.h -%{_includedir}/tirpc/rpc/des.h -%{_includedir}/tirpc/rpc/des_crypt.h %{_includedir}/tirpc/rpc/nettype.h %{_includedir}/tirpc/rpc/pmap_clnt.h %{_includedir}/tirpc/rpc/pmap_prot.h @@ -133,6 +126,9 @@ rm -rf %{buildroot} %{_mandir}/*/* %changelog +* Thu May 7 2015 Steve Dickson 0.3.0-0.0 +- Updated to latest upstream release: libtirpc-0-3-3 + * Thu Apr 23 2015 Steve Dickson 0.2.5-3.0 - Update to latest RC release: libtirpc-0-2-6-rc3 diff --git a/sources b/sources index ef9a44b..d9ad9e5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8cd41a5ef5a9b50d0fb6abb98af15368 libtirpc-0.2.5.tar.bz2 +34b07c50e6e3fc1ca18182e9f0fd5a67 libtirpc-0.3.0.tar.bz2