Blame SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch

80b5cf
autofs-5.1.6 - initialize struct addrinfo for getaddrinfo() calls
80b5cf
80b5cf
From: Ian Kent <raven@themaw.net>
80b5cf
80b5cf
The getaddrinfo() call may have become more fussy about initialization
80b5cf
of the passed in struct addrinfo that receives the results.
80b5cf
80b5cf
It's good practice to initialize it prior to the gataddrinfo() call just
80b5cf
in case.
80b5cf
80b5cf
Signed-off-by: Ian Kent <raven@themaw.net>
80b5cf
---
80b5cf
 CHANGELOG            |    1 +
80b5cf
 lib/parse_subs.c     |    1 +
80b5cf
 lib/rpc_subs.c       |    1 +
80b5cf
 modules/dclist.c     |    1 +
80b5cf
 modules/parse_amd.c  |    3 +++
80b5cf
 modules/replicated.c |    2 ++
80b5cf
 6 files changed, 9 insertions(+)
80b5cf
80b5cf
--- autofs-5.0.7.orig/CHANGELOG
80b5cf
+++ autofs-5.0.7/CHANGELOG
80b5cf
@@ -352,6 +352,7 @@
80b5cf
 - fix missing initialization of autofs_point flags.
80b5cf
 - also use strictexpire for offsets.
80b5cf
 - fix trailing dollar sun entry expansion.
80b5cf
+- initialize struct addrinfo for getaddrinfo() calls.
80b5cf
 
80b5cf
 25/07/2012 autofs-5.0.7
80b5cf
 =======================
80b5cf
--- autofs-5.0.7.orig/lib/parse_subs.c
80b5cf
+++ autofs-5.0.7/lib/parse_subs.c
80b5cf
@@ -474,6 +474,7 @@ unsigned int get_network_proximity(const
80b5cf
 	hints.ai_socktype = SOCK_DGRAM;
80b5cf
 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
80b5cf
 
80b5cf
+	ni = NULL;
80b5cf
 	ret = getaddrinfo(name_or_num, NULL, &hints, &ni);
80b5cf
 	if (ret) {
80b5cf
 		logerr("hostname lookup for %s failed: %s",
80b5cf
--- autofs-5.0.7.orig/lib/rpc_subs.c
80b5cf
+++ autofs-5.0.7/lib/rpc_subs.c
80b5cf
@@ -699,6 +699,7 @@ static int create_client(struct conn_inf
80b5cf
 	else
80b5cf
 		hints.ai_socktype = SOCK_STREAM;
80b5cf
 
80b5cf
+	ai = NULL;
80b5cf
 	ret = getaddrinfo(info->host, NULL, &hints, &ai;;
80b5cf
 	if (ret) {
80b5cf
 		error(LOGOPT_ANY,
80b5cf
--- autofs-5.0.7.orig/modules/dclist.c
80b5cf
+++ autofs-5.0.7/modules/dclist.c
80b5cf
@@ -355,6 +355,7 @@ static char *getdnsdomainname(unsigned i
80b5cf
 	hints.ai_family = AF_UNSPEC;
80b5cf
 	hints.ai_socktype = SOCK_DGRAM;
80b5cf
 
80b5cf
+	ni = NULL;
80b5cf
 	ret = getaddrinfo(name, NULL, &hints, &ni);
80b5cf
 	if (ret) {
80b5cf
 		error(logopt,
80b5cf
--- autofs-5.0.7.orig/modules/parse_amd.c
80b5cf
+++ autofs-5.0.7/modules/parse_amd.c
80b5cf
@@ -269,6 +269,7 @@ static int match_my_name(struct autofs_p
80b5cf
 	hints.ai_socktype = SOCK_DGRAM;
80b5cf
 
80b5cf
 	/* Get host canonical name */
80b5cf
+	cni = NULL;
80b5cf
 	ret = getaddrinfo(v->val, NULL, &hints, &cni);
80b5cf
 	if (ret) {
80b5cf
 		error(logopt, MODPREFIX
80b5cf
@@ -280,6 +281,7 @@ static int match_my_name(struct autofs_p
80b5cf
 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
80b5cf
 
80b5cf
 	/* Resolve comparison name to its names and compare */
80b5cf
+	ni = NULL;
80b5cf
 	ret = getaddrinfo(exp_name, NULL, &hints, &ni);
80b5cf
 	if (ret) {
80b5cf
 		error(logopt, MODPREFIX
80b5cf
@@ -777,6 +779,7 @@ static char *normalize_hostname(unsigned
80b5cf
 		hints.ai_family = AF_UNSPEC;
80b5cf
 		hints.ai_socktype = SOCK_DGRAM;
80b5cf
 
80b5cf
+		ni = NULL;
80b5cf
 		ret = getaddrinfo(host, NULL, &hints, &ni);
80b5cf
 		if (ret) {
80b5cf
 			error(logopt, MODPREFIX
80b5cf
--- autofs-5.0.7.orig/modules/replicated.c
80b5cf
+++ autofs-5.0.7/modules/replicated.c
80b5cf
@@ -923,6 +923,7 @@ static int add_host_addrs(struct host **
80b5cf
 	hints.ai_family = AF_UNSPEC;
80b5cf
 	hints.ai_socktype = SOCK_DGRAM;
80b5cf
 
80b5cf
+	ni = NULL;
80b5cf
 	ret = getaddrinfo(name, NULL, &hints, &ni);
80b5cf
 	if (ret)
80b5cf
 		goto try_name;
80b5cf
@@ -943,6 +944,7 @@ try_name:
80b5cf
 	hints.ai_family = AF_UNSPEC;
80b5cf
 	hints.ai_socktype = SOCK_DGRAM;
80b5cf
 
80b5cf
+	ni = NULL;
80b5cf
 	ret = getaddrinfo(name, NULL, &hints, &ni);
80b5cf
 	if (ret) {
80b5cf
 		error(LOGOPT_ANY,