|
Ian Kent |
465c67 |
autofs-5.0.6 - fix initialization in rpc create_client()
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
From: Ian Kent <ikent@redhat.com>
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
251f55 |
Sometimes the RPC function create_client() gets a non-null stack
|
|
Ian Kent |
251f55 |
variable passed in which can cause a SEGV. Fix it by initializing
|
|
Ian Kent |
251f55 |
the passed in variable.
|
|
Ian Kent |
465c67 |
---
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
251f55 |
CHANGELOG | 1 +
|
|
Ian Kent |
251f55 |
lib/rpc_subs.c | 11 ++++++++---
|
|
Ian Kent |
251f55 |
2 files changed, 9 insertions(+), 3 deletions(-)
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
251f55 |
--- autofs-5.0.6.orig/CHANGELOG
|
|
Ian Kent |
251f55 |
+++ autofs-5.0.6/CHANGELOG
|
|
Ian Kent |
251f55 |
@@ -40,6 +40,7 @@
|
|
Ian Kent |
251f55 |
- fix sss wildcard match.
|
|
Ian Kent |
251f55 |
- fix dlopen() error handling in sss module.
|
|
Ian Kent |
251f55 |
- fix configure string length tests for sss library.
|
|
Ian Kent |
251f55 |
+- fix initialization in rpc create_client().
|
|
Ian Kent |
251f55 |
|
|
Ian Kent |
251f55 |
28/06/2011 autofs-5.0.6
|
|
Ian Kent |
251f55 |
-----------------------
|
|
Ian Kent |
251f55 |
--- autofs-5.0.6.orig/lib/rpc_subs.c
|
|
Ian Kent |
251f55 |
+++ autofs-5.0.6/lib/rpc_subs.c
|
|
Ian Kent |
251f55 |
@@ -316,6 +316,7 @@ static int create_client(struct conn_inf
|
|
Ian Kent |
465c67 |
int fd, ret;
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
fd = RPC_ANYSOCK;
|
|
Ian Kent |
465c67 |
+ *client = NULL;
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
if (info->client) {
|
|
Ian Kent |
465c67 |
if (!clnt_control(info->client, CLGET_FD, (char *) &fd)) {
|
|
Ian Kent |
251f55 |
@@ -344,7 +345,10 @@ static int create_client(struct conn_inf
|
|
Ian Kent |
251f55 |
memset(&hints, 0, sizeof(hints));
|
|
Ian Kent |
251f55 |
hints.ai_flags = AI_ADDRCONFIG;
|
|
Ian Kent |
251f55 |
hints.ai_family = AF_UNSPEC;
|
|
Ian Kent |
251f55 |
- hints.ai_socktype = SOCK_DGRAM;
|
|
Ian Kent |
251f55 |
+ if (info->proto->p_proto == IPPROTO_UDP)
|
|
Ian Kent |
251f55 |
+ hints.ai_socktype = SOCK_DGRAM;
|
|
Ian Kent |
251f55 |
+ else
|
|
Ian Kent |
251f55 |
+ hints.ai_socktype = SOCK_STREAM;
|
|
Ian Kent |
251f55 |
|
|
Ian Kent |
251f55 |
ret = getaddrinfo(info->host, NULL, &hints, &ai;;
|
|
Ian Kent |
251f55 |
if (ret) {
|
|
Ian Kent |
251f55 |
@@ -377,12 +381,13 @@ static int create_client(struct conn_inf
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
freeaddrinfo(ai);
|
|
Ian Kent |
465c67 |
|
|
Ian Kent |
465c67 |
+done:
|
|
Ian Kent |
465c67 |
if (!*client) {
|
|
Ian Kent |
465c67 |
info->client = NULL;
|
|
Ian Kent |
465c67 |
ret = -ENOTCONN;
|
|
Ian Kent |
465c67 |
goto out_close;
|
|
Ian Kent |
465c67 |
}
|
|
Ian Kent |
465c67 |
-done:
|
|
Ian Kent |
465c67 |
+
|
|
Ian Kent |
465c67 |
/* Close socket fd on destroy, as is default for rpcowned fds */
|
|
Ian Kent |
465c67 |
if (!clnt_control(*client, CLSET_FD_CLOSE, NULL)) {
|
|
Ian Kent |
465c67 |
clnt_destroy(*client);
|
|
Ian Kent |
251f55 |
@@ -800,7 +805,7 @@ static int rpc_get_exports_proto(struct
|
|
Ian Kent |
251f55 |
(xdrproc_t) xdr_void, NULL,
|
|
Ian Kent |
251f55 |
(xdrproc_t) xdr_exports, (caddr_t) exp,
|
|
Ian Kent |
251f55 |
info->timeout);
|
|
Ian Kent |
251f55 |
- if (status != RPC_PROGVERSMISMATCH)
|
|
Ian Kent |
251f55 |
+ if (status == RPC_SUCCESS)
|
|
Ian Kent |
251f55 |
break;
|
|
Ian Kent |
251f55 |
if (++vers_entry > 2)
|
|
Ian Kent |
251f55 |
break;
|