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

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