Re: [PATCH] Make colon mandatory after map type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-08-27 at 08:46 -0300, Leonardo Chiquitto wrote:
> On Sun, Aug 26, 2012 at 11:58 PM, Ian Kent <raven@xxxxxxxxxx> wrote:
> > On Fri, 2012-08-24 at 13:27 -0300, Leonardo Chiquitto wrote:
> >> Hello,
> >>
> >> [This bug was found and fixed by Werner Fink <werner@xxxxxxx>, I'm just the
> >> messenger.]
> >>
> >> When the extension of the map file name is equal to the map type name,
> >> the automounter will fail to parse the master map.
> >>
> >> How to reproduce:
> >>
> >> # cat /etc/auto.master
> >> /media/autofs file:/etc/autofs.file --timeout=5 --ghost
> >> # cat /etc/auto.file
> >> test  server:/nfs
> >
> > I can't reproduce this with the current source and I can't see any
> > relevant patches in the last couple of versions that might have changed
> > it.
> 
> Strange. I tried some variations here and discovered that you must use
> a mount point with a long name:
> 
> /a-long-directory-name/autofs file:/etc/auto.file --timeout=5 --ghost
> 
> Aug 27 08:42:39 lotus automount[23185]: lookup_nss_read_map: reading
> map file /etc/auto.rect
> Aug 27 08:42:39 lotus automount[23185]: lookup(file): file map
> /etc/auto.rect missing or not readable
> Aug 27 08:42:39 lotus automount[23185]: do_read_map: lookup module file failed
> 
> Makes any difference in your setup?

Yep, I can reproduce that.


Try this patch.

autofs-5.0.7 - fix parse buffer initialization

From: Ian Kent <ikent@xxxxxxxxxx>

When parsing a master map entry, if the mount point path is longer than
the following map string the lexical analyzer buffer may not have a null
terminator where it is expected. If the map name string also contains a
string that is the same as a map type at the end the map name the map
name is not constructed correctly because of this lack of a string
terminator in the buffer.
---

 CHANGELOG        |    1 +
 lib/master_tok.l |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/CHANGELOG b/CHANGELOG
index 34c70fa..276d6ba 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@
 - fix nobind sun escaped map entries.
 - fix use cache entry after free in lookup_prune_one_cache().
 - fix ipv6 proximity calculation.
+- fix parse buffer initialization.
 
 25/07/2012 autofs-5.0.7
 =======================
diff --git a/lib/master_tok.l b/lib/master_tok.l
index 0d6edb7..30abb15 100644
--- a/lib/master_tok.l
+++ b/lib/master_tok.l
@@ -74,7 +74,8 @@ int my_yyinput(char *, int);
 #define unput(c) (*(char *) --line = c)
 #endif
 
-char buff[1024];
+#define BUFF_LEN	1024
+char buff[BUFF_LEN];
 char *bptr;
 char *optr = buff;
 unsigned int tlen;
@@ -174,6 +175,7 @@ OPTNTOUT	(-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
 		*bptr = '\0';
 		strcpy(master_lval.strtype, buff);
 		bptr = buff;
+		memset(buff, 0, BUFF_LEN);
 		return(PATH);
 	}
 


--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux