Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2014 21:53:42 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270901 - stable/10/usr.sbin/autofs
Message-ID:  <201408312153.s7VLrgQl092020@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Aug 31 21:53:42 2014
New Revision: 270901
URL: http://svnweb.freebsd.org/changeset/base/270901

Log:
  MFC r270405:
  
  Don't fail on executable maps that return no entries.  This turns useless
  error message into useful one.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/autofs/common.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/autofs/common.c
==============================================================================
--- stable/10/usr.sbin/autofs/common.c	Sun Aug 31 21:52:26 2014	(r270900)
+++ stable/10/usr.sbin/autofs/common.c	Sun Aug 31 21:53:42 2014	(r270901)
@@ -716,7 +716,13 @@ parse_map_yyin(struct node *parent, cons
 	for (;;) {
 		ret = yylex();
 		if (ret == 0 || ret == NEWLINE) {
-			if (key != NULL || options != NULL) {
+			/*
+			 * In case of executable map, the key is always
+			 * non-NULL, even if the map is empty.  So, make sure
+			 * we don't fail empty maps here.
+			 */
+			if ((key != NULL && executable_key == NULL) ||
+			    options != NULL) {
 				log_errx(1, "truncated entry at %s, line %d",
 				    map, lineno);
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408312153.s7VLrgQl092020>