Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 174

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

diff --git a/CHANGELOG b/CHANGELOG
index 5bd1af5..eb59699 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -38,6 +38,7 @@
 - still more on multiply recursive bind mounts.
 - fix tokenizer to distinguish between global option and dn string.
 - fix incorrect return from spawn (Gordon Lack).
+- fix parsing of bad mount mount point in master map.
 
 1/9/2006 autofs-5.0.1 rc2
 -------------------------
diff --git a/lib/master_parse.y b/lib/master_parse.y
index 47d9a07..3250d39 100644
--- a/lib/master_parse.y
+++ b/lib/master_parse.y
@@ -127,15 +127,7 @@ #endif
 	} line
 	;
 
-line:	
-	| PATH
-	{
-		path = master_strdup($1);
-		if (!path) {
-			local_free_vars();
-			YYABORT;
-		}
-	}
+line:
 	| PATH map
 	{
 		path = master_strdup($1);
@@ -160,7 +152,9 @@ line:	
 	| PATH OPT_GHOST { master_notify($1); YYABORT; }
 	| PATH OPT_NOGHOST { master_notify($1); YYABORT; }
 	| PATH OPT_VERBOSE { master_notify($1); YYABORT; }
+	| PATH { master_notify($1); YYABORT; }
 	| QUOTE { master_notify($1); YYABORT; }
+	| OPTION { master_notify($1); YYABORT; }
 	| NILL { master_notify($1); YYABORT; }
 	| COMMENT { YYABORT; }
 	;
diff --git a/lib/master_tok.l b/lib/master_tok.l
index 71d8c26..4380d7e 100644
--- a/lib/master_tok.l
+++ b/lib/master_tok.l
@@ -77,6 +77,7 @@ #endif
 
 char buff[1024];
 char *bptr;
+char *optr = buff;
 
 %}
 
@@ -110,27 +111,25 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 %%
 
 <INITIAL>{
-	{NL} { }
-	{WS} { }
+	{NL} | 
+	\x00 {
+		if (optr != buff) {
+			*optr = '\0';
+			optr = buff;
+			strcpy(master_lval.strtype, buff);
+			return NILL;
+		}
+	}
 
 	#.*  { return COMMENT; }
 
-	"+" {
-		BEGIN(MAPSTR);
-		bptr = buff;
-		yyless(0);
-	}
-
 	"/" {
 		BEGIN(PATHSTR);
 		bptr = buff;
 		yyless(0);
 	}
 
-	"-" {
-		BEGIN(OPTSTR);
-		yyless(0);
-	}
+	.    { *optr++ = *master_text; }
 }
 
 <PATHSTR>{
@@ -141,36 +140,6 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 		return NILL;
 	}
 
-	{WS}/{INTMAP} {
-		BEGIN(MAPSTR);
-		*bptr = '\0';
-		strcpy(master_lval.strtype, buff);
-		return(PATH);
-	}
-
-	{WS}/{DNATTRSTR}= {
-		BEGIN(MAPSTR);
-		*bptr = '\0';
-		strcpy(master_lval.strtype, buff);
-		return(PATH);
-	}
-
-	{WS}/"-" {
-		BEGIN(OPTSTR);
-		*bptr = '\0';
-		strcpy(master_lval.strtype, buff);
-		bptr = buff;
-		return(PATH);
-	}
-
-	{WS}/{OPTIONSTR} {
-		BEGIN(OPTSTR);
-		*bptr = '\0';
-		strcpy(master_lval.strtype, buff);
-		bptr = buff;
-		return(PATH);
-	}
-
 	\\.  { *bptr++ = *(master_text + 1); }
 	\"   {
 		BEGIN(INITIAL);
@@ -202,7 +171,6 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 		return PATH;
 	}
 
-
 	.    { *bptr++ = *master_text; }
 }
 
@@ -243,12 +211,6 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 		yyless(0);
 	}
 
-	"/" {
-		BEGIN(PATHSTR);
-		bptr = buff;
-		yyless(0);
-	}
-
 	{OPTWS}/{NL} {
 		BEGIN(INITIAL);
 		*bptr = '\0';
@@ -268,6 +230,13 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 	}
 
 	{NL} |
+	\x00 {
+		BEGIN(INITIAL);
+		*bptr = '\0';
+		strcpy(master_lval.strtype, buff);
+		return(MAPNAME);
+	}
+
 	<<EOF>> {
 		BEGIN(INITIAL);
 		*bptr = '\0';
@@ -314,7 +283,9 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 	{WS}    { BEGIN(OPTSTR); }
 
 	{NL} |
-	<<EOF>>	{ BEGIN(INITIAL); }
+	\x00	{ BEGIN(INITIAL); }
+
+	<<EOF>> { BEGIN(INITIAL); }
 }
 
 <OPTSTR>{
@@ -355,7 +326,9 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 
 	{WS}	{}
 	{NL} |
-	<<EOF>>	{ BEGIN(INITIAL); }
+	\x00 { BEGIN(INITIAL); }
+
+	<<EOF>> { BEGIN(INITIAL); }
 }
 
 %%