diff --git a/CHANGELOG b/CHANGELOG index 9f542df..82572f7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -47,6 +47,7 @@ - pass root length to mount_fullpath(). - remove unused function master_submount_list_empty(). - move amd mounts removal into lib/mounts.c. +- check for offset with no mount location. xx/xx/2018 autofs-5.1.5 - fix flag file permission. diff --git a/modules/parse_sun.c b/modules/parse_sun.c index 43233ca..13f449e 100644 --- a/modules/parse_sun.c +++ b/modules/parse_sun.c @@ -803,7 +803,20 @@ update_offset_entry(struct autofs_point *ap, memset(m_mapent, 0, MAPENT_MAX_LEN + 1); - /* Internal hosts map may have loc == NULL */ + if (!loc || !*loc) { + const char *type = ap->entry->maps->type; + + /* If it's not the internal hosts map it must have a + * mount location. + */ + if (!type || strcmp(type, "hosts")) { + error(ap->logopt, + MODPREFIX "syntax error in offset %s -> %s", + m_offset, loc); + return CHE_FAIL; + } + } + if (!*m_offset) { error(ap->logopt, MODPREFIX "syntax error in offset %s -> %s", m_offset, loc);