svn commit: r270405 - head/usr.sbin/autofs

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Aug 23 11:51:47 UTC 2014


Author: trasz
Date: Sat Aug 23 11:51:46 2014
New Revision: 270405
URL: http://svnweb.freebsd.org/changeset/base/270405

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

Modified:
  head/usr.sbin/autofs/common.c

Modified: head/usr.sbin/autofs/common.c
==============================================================================
--- head/usr.sbin/autofs/common.c	Sat Aug 23 11:46:52 2014	(r270404)
+++ head/usr.sbin/autofs/common.c	Sat Aug 23 11:51:46 2014	(r270405)
@@ -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-head mailing list