From owner-svn-src-all@FreeBSD.ORG Thu Jul 31 22:13:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5397A941; Thu, 31 Jul 2014 22:13:32 +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 4102B204A; Thu, 31 Jul 2014 22:13:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6VMDW2v043419; Thu, 31 Jul 2014 22:13:32 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6VMDWWv043418; Thu, 31 Jul 2014 22:13:32 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407312213.s6VMDWWv043418@svn.freebsd.org> From: Devin Teske Date: Thu, 31 Jul 2014 22:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269354 - head/usr.sbin/bsdconfig/share 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 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: Thu, 31 Jul 2014 22:13:32 -0000 Author: dteske Date: Thu Jul 31 22:13:31 2014 New Revision: 269354 URL: http://svnweb.freebsd.org/changeset/base/269354 Log: Update command and add check for edge-case. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Thu Jul 31 22:09:50 2014 (r269353) +++ head/usr.sbin/bsdconfig/share/common.subr Thu Jul 31 22:13:31 2014 (r269354) @@ -222,7 +222,7 @@ f_have() # setvar $var_to_set [$value] # -# Implement setvar for shells such as unlike FreeBSD sh(1). +# Implement setvar for shells unlike FreeBSD sh(1). # if ! f_have setvar; then setvar() @@ -236,6 +236,10 @@ setvar() *) f_err "setvar: too many arguments\n" return $FAILURE esac + case "$__setvar_var_to_set" in *[!0-9A-Za-z_]*) + f_err "setvar: %s: bad variable name\n" "$__setvar_var_to_set" + return 2 + esac while case "$__setvar_r" in *\'*) : ;; *) false ; esac do __setvar_left="$__setvar_left${__setvar_right%%\'*}'\\''"