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

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