Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2014 11:51:47 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270405 - head/usr.sbin/autofs
Message-ID:  <201408231151.s7NBploo070876@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 			}



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