- Fix for taddr2addr conversion bug of local addresses

- Fixed some of warnings in: src/auth_time.c, src/clnt_dg.c and
    src/clnt_raw.c
- Added some #ifdef NOTUSED around some code in src/rpbc_clnt.c that was
    not being used...
This commit is contained in:
Steve Dickson 2008-09-16 16:05:33 +00:00
parent 66af2ac9a7
commit 417f73f30b
3 changed files with 185 additions and 3 deletions

View File

@ -0,0 +1,27 @@
commit 9e7ba0c7a02031294fefadfbca42b3dd5f2d841f
Author: Olaf Kirch <okir@suse.de>
Date: Tue Sep 16 08:46:29 2008 -0400
Fix for taddr2addr conversion bug of local addresses
When converting af_local socket addresses in taddr2uaddr, an incorrect
sizeof() would result in a truncated path string. As a result,
rpcbind will report the local /var/lib/rpcbind address to clients
as "/v" on a 32bit machine.
Signed-off-by: okir@suse.de
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
index ff4ba16..b436e3a 100644
--- a/src/rpc_generic.c
+++ b/src/rpc_generic.c
@@ -629,7 +629,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
/* 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) -
+ if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) -
offsetof(struct sockaddr_un, sun_path)),
sun->sun_path) < 0)

View File

@ -0,0 +1,145 @@
commit 628788c1cc84c86ee4cb36ee5d4fe8954e90fca5
Author: Steve Dickson <steved@redhat.com>
Date: Tue Sep 16 11:32:31 2008 -0400
- Fixed some of warnings in: src/auth_time.c, src/clnt_dg.c and
src/clnt_raw.c
- Added some #ifdef NOTUSED around some code in src/rpbc_clnt.c
that was not being used...
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/auth_time.c b/src/auth_time.c
index d77bcf5..7cfbb7e 100644
--- a/src/auth_time.c
+++ b/src/auth_time.c
@@ -248,7 +248,8 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
nis_server tsrv;
void (*oldsig)() = NULL; /* old alarm handler */
struct sockaddr_in sin;
- int s = RPC_ANYSOCK, len;
+ int s = RPC_ANYSOCK;
+ socklen_t len;
int type = 0;
td->tv_sec = 0;
diff --git a/src/clnt_dg.c b/src/clnt_dg.c
index 0e35742..da01c5b 100644
--- a/src/clnt_dg.c
+++ b/src/clnt_dg.c
@@ -306,7 +306,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
int nrefreshes = 2; /* number of times to refresh cred */
struct timeval timeout;
struct pollfd fd;
- int total_time, nextsend_time, tv;
+ int total_time, nextsend_time, tv=0;
struct sockaddr *sa;
sigset_t mask;
sigset_t newmask;
diff --git a/src/clnt_raw.c b/src/clnt_raw.c
index 36035c8..f184066 100644
--- a/src/clnt_raw.c
+++ b/src/clnt_raw.c
@@ -84,8 +84,8 @@ clnt_raw_create(prog, vers)
{
struct clntraw_private *clp;
struct rpc_msg call_msg;
- XDR *xdrs = &clp->xdr_stream;
- CLIENT *client = &clp->client_object;
+ XDR *xdrs;
+ CLIENT *client;
mutex_lock(&clntraw_lock);
clp = clntraw_private;
@@ -101,6 +101,8 @@ clnt_raw_create(prog, vers)
clp->_raw_buf = __rpc_rawcombuf;
clntraw_private = clp;
}
+ xdrs = &clp->xdr_stream;
+ client = &clp->client_object;
/*
* pre-serialize the static part of the call msg and stash it away
*/
diff --git a/src/rpbc_clnt.c b/src/rpbc_clnt.c
index 75811f0..0e25747 100644
--- a/src/rpbc_clnt.c
+++ b/src/rpbc_clnt.c
@@ -109,7 +109,9 @@ static void delete_cache(struct netbuf *);
static void add_cache(const char *, const char *, struct netbuf *, char *);
static CLIENT *getclnthandle(const char *, const struct netconfig *, char **);
static CLIENT *local_rpcb(void);
+#if NOTUSED
static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *);
+#endif
/*
* This routine adjusts the timeout used for calls to the remote rpcbind.
@@ -625,7 +627,7 @@ rpcb_unset(program, version, nconf)
CLNT_DESTROY(client);
return (rslt);
}
-
+#ifdef NOTUSED
/*
* From the merged list, find the appropriate entry
*/
@@ -657,7 +659,7 @@ got_entry(relp, nconf)
}
return (na);
}
-
+#endif
/*
* Quick check to see if rpcbind is up. Tries to connect over
* local transport.
@@ -725,7 +727,9 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
CLIENT **clpp;
struct timeval *tp;
{
+#ifdef NOTUSED
static bool_t check_rpcbind = TRUE;
+#endif
CLIENT *client = NULL;
RPCB parms;
enum clnt_stat clnt_st;
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
index 040f4ce..ed16f00 100644
--- a/src/rpcb_clnt.c
+++ b/src/rpcb_clnt.c
@@ -109,7 +109,9 @@ static void delete_cache(struct netbuf *);
static void add_cache(const char *, const char *, struct netbuf *, char *);
static CLIENT *getclnthandle(const char *, const struct netconfig *, char **);
static CLIENT *local_rpcb(void);
+#ifdef NOTUSED
static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *);
+#endif
/*
* This routine adjusts the timeout used for calls to the remote rpcbind.
@@ -625,7 +627,7 @@ rpcb_unset(program, version, nconf)
CLNT_DESTROY(client);
return (rslt);
}
-
+#ifdef NOTUSED
/*
* From the merged list, find the appropriate entry
*/
@@ -657,6 +659,7 @@ got_entry(relp, nconf)
}
return (na);
}
+#endif
/*
* Quick check to see if rpcbind is up. Tries to connect over
@@ -725,7 +728,9 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
CLIENT **clpp;
struct timeval *tp;
{
+#ifdef NOTUSED
static bool_t check_rpcbind = TRUE;
+#endif
CLIENT *client = NULL;
RPCB parms;
enum clnt_stat clnt_st;

View File

@ -1,6 +1,6 @@
Name: libtirpc
Version: 0.1.9
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Transport Independent RPC Library
Group: System Environment/Libraries
License: SISSL
@ -32,6 +32,8 @@ Requires(devel): pkgconfig man
Patch01: libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch
Patch02: libtirpc-0.1.9-ipv6-socket.patch
Patch03: libtirpc-0.1.9-taddr2addr-typo.patch
Patch04: libtirpc-0.1.9-warnings.patch
Patch100: libtirpc-0.1.7-compile.patch
@ -42,9 +44,10 @@ developing programs which use the tirpc library.
%prep
%setup -q
%patch01 -p1
%patch02 -p1
%patch03 -p1
%patch04 -p1
%patch100 -p1
@ -143,6 +146,13 @@ rm -rf %{buildroot}
%{_mandir}/*/*
%changelog
* Tue Sep 16 2008 Steve Dickson <steved@redhat.com> 0.1.9-5
- Fix for taddr2addr conversion bug of local addresses
- Fixed some of warnings in: src/auth_time.c, src/clnt_dg.c and
src/clnt_raw.c
- Added some #ifdef NOTUSED around some code in src/rpbc_clnt.c
that was not being used...
* Thu Sep 4 2008 Steve Dickson <steved@redhat.com> 0.1.9-4
- Always make IPv6 sockets V6ONLY
- Fix incorrect sizeof() in __rpc_getbroadifs