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

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