rpms/autofs/FC-6 autofs-5.0.1-rc2-parse-bad-mountpoint.patch, NONE, 1.1.2.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Nov 21 13:08:28 UTC 2006


Author: ikent

Update of /cvs/dist/rpms/autofs/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv11928

Added Files:
      Tag: private-raven-autofs-fc-6-branch
	autofs-5.0.1-rc2-parse-bad-mountpoint.patch 
Log Message:
- ad actually add the patch.


autofs-5.0.1-rc2-parse-bad-mountpoint.patch:
 cache.c        |    6 ++++
 master_parse.y |   12 ++-------
 master_tok.l   |   75 ++++++++++++++++++---------------------------------------
 3 files changed, 33 insertions(+), 60 deletions(-)

--- NEW FILE autofs-5.0.1-rc2-parse-bad-mountpoint.patch ---
diff --git a/lib/cache.c b/lib/cache.c
index 009d271..cde54ba 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -351,6 +351,9 @@ struct mapent *cache_lookup(struct mapen
 {
 	struct mapent *me = NULL;
 
+	if (!key)
+		return NULL;
+
 	for (me = mc->hash[hash(key)]; me != NULL; me = me->next) {
 		if (strcmp(key, me->key) == 0)
 			goto done;
@@ -377,6 +380,9 @@ struct mapent *cache_lookup_distinct(str
 {
 	struct mapent *me;
 
+	if (!key)
+		return NULL;
+
 	for (me = mc->hash[hash(key)]; me != NULL; me = me->next) {
 		if (strcmp(key, me->key) == 0)
 			return me;
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); }
 }
 
 %%




More information about the fedora-cvs-commits mailing list