From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 17:29:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9706C1065673; Fri, 20 May 2011 17:29:03 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86B7D8FC1B; Fri, 20 May 2011 17:29:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHT35Y093853; Fri, 20 May 2011 17:29:03 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHT3Hv093851; Fri, 20 May 2011 17:29:03 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201105201729.p4KHT3Hv093851@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 20 May 2011 17:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222138 - stable/8/sbin/hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:29:03 -0000 Author: trociny Date: Fri May 20 17:29:03 2011 New Revision: 222138 URL: http://svn.freebsd.org/changeset/base/222138 Log: MFC r221632, r221643: r221632: Fix isitme(), which is used to check if node-specific configuration belongs to our node, and was returning false positive if the first part of a node name matches short hostname. r221643 (pjd): Allow to specify remote as 'none' again which was broken by r219351, where 'none' was defined as a value for checksum. Reported by: trasz Approved by: pjd (mentor) Modified: stable/8/sbin/hastd/parse.y Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Fri May 20 17:28:00 2011 (r222137) +++ stable/8/sbin/hastd/parse.y Fri May 20 17:29:03 2011 (r222138) @@ -92,8 +92,10 @@ isitme(const char *name) * Now check if it matches first part of the host name. */ pos = strchr(buf, '.'); - if (pos != NULL && pos != buf && strncmp(buf, name, pos - buf) == 0) + if (pos != NULL && (size_t)(pos - buf) == strlen(name) && + strncmp(buf, name, pos - buf) == 0) { return (1); + } /* * At the end check if name is equal to our host's UUID. @@ -287,6 +289,7 @@ yy_config_free(struct hastd_config *conf %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB +%type remote_str %type replication_type %type checksum_type %type compression_type @@ -794,7 +797,7 @@ resource_node_entry: source_statement ; -remote_statement: REMOTE STR +remote_statement: REMOTE remote_str { assert(depth == 2); if (mynode) { @@ -811,6 +814,12 @@ remote_statement: REMOTE STR } ; +remote_str: + NONE { $$ = strdup("none"); } + | + STR { } + ; + source_statement: SOURCE STR { assert(depth == 2);