From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 10:39:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28FDF1BB; Tue, 28 Oct 2014 10:39:30 +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 055C86CD; Tue, 28 Oct 2014 10:39:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9SAdTWa071654; Tue, 28 Oct 2014 10:39:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SAdTVQ071653; Tue, 28 Oct 2014 10:39:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410281039.s9SAdTVQ071653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Oct 2014 10:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273770 - head/usr.sbin/ctld 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: Tue, 28 Oct 2014 10:39:30 -0000 Author: trasz Date: Tue Oct 28 10:39:29 2014 New Revision: 273770 URL: https://svnweb.freebsd.org/changeset/base/273770 Log: Fix build after previous commit. While here, improve error messages. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Tue Oct 28 10:33:31 2014 (r273769) +++ head/usr.sbin/ctld/parse.y Tue Oct 28 10:39:29 2014 (r273770) @@ -59,17 +59,15 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME -%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC NUM OPENING_BRACKET +%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC OPENING_BRACKET %token OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT %token ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %union { - uint64_t num; char *str; } -%token NUM %token STR %% @@ -106,7 +104,7 @@ debug: DEBUG STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -120,7 +118,7 @@ timeout: TIMEOUT STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -134,7 +132,7 @@ maxproc: MAXPROC STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -165,15 +163,31 @@ isns_server: ISNS_SERVER STR } ; -isns_period: ISNS_PERIOD NUM +isns_period: ISNS_PERIOD STR { - conf->conf_isns_period = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return (1); + } + + conf->conf_isns_period = tmp; } ; -isns_timeout: ISNS_TIMEOUT NUM +isns_timeout: ISNS_TIMEOUT STR { - conf->conf_isns_timeout = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return (1); + } + + conf->conf_isns_timeout = tmp; } ; @@ -612,7 +626,7 @@ lun_number: STR uint64_t tmp; if (expand_number($1, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $1); + yyerror("invalid numeric value"); free($1); return (1); } @@ -663,7 +677,7 @@ lun_blocksize: BLOCKSIZE STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -737,7 +751,7 @@ lun_size: SIZE STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); }