Blame SOURCES/autofs-5.1.3-add-missing-MODPREFIX-to-logging-in-amd-parser.patch

304803
autofs-5.1.3 - add missing MODPREFIX to logging in amd parser
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Some of the logging in the amd parser is missing the log identifier
304803
MODPREFIX so add it.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG           |    1 +
304803
 modules/parse_amd.c |   25 ++++++++++++++-----------
304803
 2 files changed, 15 insertions(+), 11 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -269,6 +269,7 @@
304803
 - improve debug logging of lookup key.
304803
 - fix cachefs parse message not being logged.
304803
 - fix typo in amd_parse.c.
304803
+- add missing MODPREFIX to logging in amd parser.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/parse_amd.c
304803
+++ autofs-5.0.7/modules/parse_amd.c
304803
@@ -245,7 +245,7 @@ static int match_my_name(unsigned int lo
304803
 	}
304803
 
304803
 	if (!v || !v->val) {
304803
-		error(logopt, "error: ${host} not set");
304803
+		error(logopt, MODPREFIX "error: ${host} not set");
304803
 		goto out;
304803
 	}
304803
 
304803
@@ -259,7 +259,7 @@ static int match_my_name(unsigned int lo
304803
 	/* Get host canonical name */
304803
 	ret = getaddrinfo(v->val, NULL, &hints, &cni);
304803
 	if (ret) {
304803
-		error(logopt,
304803
+		error(logopt, MODPREFIX
304803
 		      "hostname lookup failed: %s\n", gai_strerror(ret));
304803
 		goto out;
304803
 	}
304803
@@ -269,7 +269,7 @@ static int match_my_name(unsigned int lo
304803
 	/* Resolve comparison name to its names and compare */
304803
 	ret = getaddrinfo(name, NULL, &hints, &ni);
304803
 	if (ret) {
304803
-		error(logopt,
304803
+		error(logopt, MODPREFIX
304803
 		      "hostname lookup failed: %s\n", gai_strerror(ret));
304803
 		freeaddrinfo(cni);
304803
 		goto out;
304803
@@ -282,7 +282,7 @@ static int match_my_name(unsigned int lo
304803
 				  numeric, sizeof(numeric), NULL, 0,
304803
 				  NI_NUMERICHOST);
304803
 		if (ret) {
304803
-			error(logopt,
304803
+			error(logopt, MODPREFIX
304803
 			      "host address info lookup failed: %s\n",
304803
 			      gai_strerror(ret));
304803
 			freeaddrinfo(cni);
304803
@@ -293,7 +293,7 @@ static int match_my_name(unsigned int lo
304803
 		ret = getnameinfo(haddr->ai_addr, haddr->ai_addrlen,
304803
 				  host, NI_MAXHOST, NULL, 0, 0);
304803
 		if (ret) {
304803
-			error(logopt,
304803
+			error(logopt, MODPREFIX
304803
 			      "host address info lookup failed: %s\n",
304803
 			      gai_strerror(ret));
304803
 			freeaddrinfo(cni);
304803
@@ -330,7 +330,8 @@ static int eval_selector(unsigned int lo
304803
 	case SEL_FLAG_MACRO:
304803
 		v = macro_findvar(sv, s->sel->name, strlen(s->sel->name));
304803
 		if (!v) {
304803
-			error(logopt, "failed to get selector %s", s->sel->name);
304803
+			error(logopt, MODPREFIX
304803
+			      "failed to get selector %s", s->sel->name);
304803
 			return 0;
304803
 		}
304803
 
304803
@@ -499,7 +500,7 @@ static int eval_selector(unsigned int lo
304803
 				else
304803
 					v = macro_findvar(sv, "hostd", 5);
304803
 				if (!v || !*v->val) {
304803
-					error(logopt,
304803
+					error(logopt, MODPREFIX
304803
 					     "failed to get value of ${host}");
304803
 					break;
304803
 				}
304803
@@ -666,7 +667,8 @@ static char *normalize_hostname(unsigned
304803
 
304803
 		ret = getaddrinfo(host, NULL, &hints, &ni);
304803
 		if (ret) {
304803
-			error(logopt, "hostname lookup failed: %s", gai_strerror(ret));
304803
+			error(logopt, MODPREFIX
304803
+			      "hostname lookup failed: %s", gai_strerror(ret));
304803
 			return NULL;
304803
 		}
304803
 		name = strdup(ni->ai_canonname);
304803
@@ -1302,7 +1304,7 @@ static unsigned int validate_generic_opt
304803
 			 * Can't use entry->type as the mount type to reprot
304803
 			 * the error since entry->type == "bind" not "lofs".
304803
 			 */
304803
-			error(logopt, "lofs: mount device not given");
304803
+			error(logopt, MODPREFIX "lofs: mount device not given");
304803
 			return 0;
304803
 		} else if (!*entry->rfs)
304803
 			return 0;
304803
@@ -1575,7 +1577,7 @@ static int match_selectors(unsigned int
304803
 
304803
 	/* No selectors, always match */
304803
 	if (!s) {
304803
-		debug(logopt, "no selectors found in location");
304803
+		debug(logopt, MODPREFIX "no selectors found in location");
304803
 		return 1;
304803
 	}
304803
 
304803
@@ -2000,7 +2002,8 @@ int parse_mount(struct autofs_point *ap,
304803
 	free_amd_entry(cur_defaults);
304803
 
304803
 	if (rv)
304803
-		debug(ap->logopt, "no more locations to try, returning fail");
304803
+		debug(ap->logopt, MODPREFIX
304803
+		      "no more locations to try, returning fail");
304803
 done:
304803
 	free_amd_entry_list(&entries);
304803
 	free_amd_entry(defaults_entry);