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

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