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

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