Blame SOURCES/autofs-5.0.9-amd-lookup-allow-exec-to-be-used-by-amd-maps-in-master-map.patch

304803
autofs-5.0.9 - amd lookup allow amd maps to use exec in master map
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Amd uses the keyword exec for program maps (as it has a program mount
304803
type). Allow the use of the exec keyword to be used for executable
304803
maps in amd format master map entries. So just allow the keyword exec
304803
to be used as a synonym of program for both sun and amd format map
304803
entries since exec isn't otherwise used in master map entries.
304803
---
304803
 lib/master_parse.y   |   15 ++++++++++++---
304803
 lib/master_tok.l     |    2 +-
304803
 man/auto.master.5.in |    2 ++
304803
 3 files changed, 15 insertions(+), 4 deletions(-)
304803
304803
diff --git a/lib/master_parse.y b/lib/master_parse.y
304803
index 03aedf7..e31023d 100644
304803
--- a/lib/master_parse.y
304803
+++ b/lib/master_parse.y
304803
@@ -329,7 +329,10 @@ map:	PATH
304803
 		if ((tmp = strchr($1, ',')))
304803
 			*tmp++ = '\0';
304803
 
304803
-		type = master_strdup($1);
304803
+		if (strcmp($1, "exec"))
304803
+			type = master_strdup($1);
304803
+		else
304803
+			type = master_strdup("program");
304803
 		if (!type) {
304803
 			master_error("memory allocation error");
304803
 			local_free_vars();
304803
@@ -360,7 +363,10 @@ map:	PATH
304803
 		if ((tmp = strchr($1, ',')))
304803
 			*tmp++ = '\0';
304803
 
304803
-		type = master_strdup($1);
304803
+		if (strcmp($1, "exec"))
304803
+			type = master_strdup($1);
304803
+		else
304803
+			type = master_strdup("program");
304803
 		if (!type) {
304803
 			master_error("memory allocation error");
304803
 			local_free_vars();
304803
@@ -391,7 +397,10 @@ map:	PATH
304803
 		if ((tmp = strchr($1, ',')))
304803
 			*tmp++ = '\0';
304803
 
304803
-		type = master_strdup($1);
304803
+		if (strcmp($1, "exec"))
304803
+			type = master_strdup($1);
304803
+		else
304803
+			type = master_strdup("program");
304803
 		if (!type) {
304803
 			master_error("memory allocation error");
304803
 			local_free_vars();
304803
diff --git a/lib/master_tok.l b/lib/master_tok.l
304803
index d43c1dd..9ba53f6 100644
304803
--- a/lib/master_tok.l
304803
+++ b/lib/master_tok.l
304803
@@ -119,7 +119,7 @@ DNNAMESTR2	([[:alnum:]_.\-]+)
304803
 INTMAP		(-hosts|-null)
304803
 MULTI		((multi)(,(sun|hesiod))?(:{OPTWS}|{WS}))
304803
 MULTISEP	([\-]{2}[[:blank:]]+)
304803
-MTYPE		((file|program|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod|amd))?(:{OPTWS}|{WS}))
304803
+MTYPE		((file|program|exec|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod|amd))?(:{OPTWS}|{WS}))
304803
 
304803
 
304803
 OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--timeout{OPTWS}|--timeout{OPTWS}={OPTWS})
304803
diff --git a/man/auto.master.5.in b/man/auto.master.5.in
304803
index 2267550..83be83c 100644
304803
--- a/man/auto.master.5.in
304803
+++ b/man/auto.master.5.in
304803
@@ -93,6 +93,8 @@ The map is a regular text file.
304803
 .B program
304803
 The map is an executable program, which is passed a key on the command
304803
 line and returns an entry (everything besides the key) on stdout if successful.
304803
+Optinally, the keyword exec may be used as a synonym for program to avoid
304803
+confusion with amd formated maps mount type program.
304803
 .TP
304803
 .B yp
304803
 The map is a NIS (YP) database.