From owner-svn-src-all@FreeBSD.ORG Sat Aug 23 11:51:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5729621E; Sat, 23 Aug 2014 11:51:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 435F03C99; Sat, 23 Aug 2014 11:51:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7NBpl08070877; Sat, 23 Aug 2014 11:51:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7NBploo070876; Sat, 23 Aug 2014 11:51:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201408231151.s7NBploo070876@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 23 Aug 2014 11:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270405 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Aug 2014 11:51:47 -0000 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); }