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

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