svn commit: r270901 - stable/10/usr.sbin/autofs

Edward Tomasz Napierala trasz at FreeBSD.org
Sun Aug 31 21:53:43 UTC 2014


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);
 			}


More information about the svn-src-all mailing list