Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 22:13:32 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269354 - head/usr.sbin/bsdconfig/share
Message-ID:  <201407312213.s6VMDWWv043418@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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%%\'*}'\\''"



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